add files
parent
c61efa38e6
commit
9a6ac4e611
@ -1,20 +1,3 @@
|
||||
# computer archaeology jp multimedia playlist and utility
|
||||
|
||||
## multimedia playlist
|
||||
In this playlist, you will find a list of multimedia content to navigate the space of "computer archaeology jp":
|
||||
|
||||
* a handful of songs
|
||||
* an NES long play
|
||||
* a manual manga
|
||||
* an advertisement
|
||||
* an audio book
|
||||
* a book
|
||||
|
||||
## utility
|
||||
Jinja templating engine for a web zine project.
|
||||
|
||||
Usage
|
||||
|
||||
## thank you
|
||||
Supported by the Race x Technology Micro Grant program of the Media Archaeology Lab
|
||||
|
||||
# README
|
||||
a utility to generate an index page for my works similar to the combination of a portfolio and annotated index sheet.
|
||||
|
@ -0,0 +1,27 @@
|
||||
from flask import Flask
|
||||
app = Flask(__name__)
|
||||
|
||||
HTML_TEMPLATE = """
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Biyi Wen Works Index</title>
|
||||
<style>
|
||||
img{
|
||||
display:block;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Biyi Wen Works Index</h1>
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
|
||||
@app.route("/")
|
||||
def homepage():
|
||||
return HTML_TEMPLATE
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(use_reloader=True, debug=True)
|
@ -0,0 +1,14 @@
|
||||
import json
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
with open("worklist.json","r") as d:
|
||||
worklist = json.load(d)
|
||||
|
||||
fileLoader = FileSystemLoader("templates")
|
||||
env = Environment(loader=fileLoader)
|
||||
|
||||
rendered = env.get_template("worklist.html").render(worklist=worklist,title="Test")
|
||||
fileName = "works.html"
|
||||
|
||||
with open(f"{fileName}","w") as f:
|
||||
f.write(rendered)
|
@ -0,0 +1,26 @@
|
||||
import csv
|
||||
import json
|
||||
|
||||
def csv_to_json(csvFilePath, jsonFilePath):
|
||||
jsonArray = []
|
||||
|
||||
#read csv file
|
||||
with open(csvFilePath, encoding='utf-8') as csvf:
|
||||
#load csv file data using csv library's dictionary reader
|
||||
csvReader = csv.DictReader(csvf)
|
||||
|
||||
#convert each csv row into python dict
|
||||
for row in csvReader:
|
||||
#add this python dict to json array
|
||||
jsonArray.append(row)
|
||||
|
||||
#convert python jsonArray to JSON String and write to file
|
||||
with open(jsonFilePath, 'w', encoding='utf-8') as jsonf:
|
||||
jsonString = json.dumps(jsonArray, ensure_ascii=False, indent=4)
|
||||
print(jsonString)
|
||||
jsonf.write(jsonString)
|
||||
|
||||
csvFilePath = r'worklist.csv'
|
||||
jsonFilePath = r'worklist.json'
|
||||
|
||||
csv_to_json(csvFilePath, jsonFilePath)
|
@ -0,0 +1,51 @@
|
||||
|
||||
|
||||
img
|
||||
{
|
||||
display: block;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
|
||||
/** make live selection of random links **/
|
||||
div.container
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
h1.title
|
||||
{
|
||||
font-size: 60px;
|
||||
color: purple;
|
||||
font-family: "Cursive";
|
||||
|
||||
}
|
||||
|
||||
a.archive
|
||||
{
|
||||
color: red;
|
||||
font-size:30px;
|
||||
}
|
||||
|
||||
a.print
|
||||
{
|
||||
color: yellow;
|
||||
font-size:45px;
|
||||
}
|
||||
|
||||
a.video
|
||||
{
|
||||
color: blue;
|
||||
font-size:50px;
|
||||
}
|
||||
|
||||
a.audio
|
||||
{
|
||||
color: violet;
|
||||
font-size:60px;
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title> Biyi Wen Works Index {{ title }}</title>
|
||||
<link rel="stylesheet" type="text/css" href="static/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class ="heading">
|
||||
<h1 class = "title">Biyi Wen Works Index</h1>
|
||||
</div>
|
||||
<div class="gallery">
|
||||
{% for item in worklist %}
|
||||
|
||||
"{{item.type}}"
|
||||
{{item.type}}
|
||||
"{{item.title}}"
|
||||
{{item.title}}
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class ="footnote"> Index page is generated with Jinja with an idiosyncratic CMS.</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,127 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title> Biyi Wen Works Index Test</title>
|
||||
<link rel="stylesheet" type="text/css" href="static/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class ="heading">
|
||||
<h1 class = "title">Biyi Wen Works Index</h1>
|
||||
</div>
|
||||
<div class="gallery">
|
||||
|
||||
|
||||
"Artist book and intervention"
|
||||
Artist book and intervention
|
||||
"RGB Reader"
|
||||
RGB Reader
|
||||
|
||||
|
||||
|
||||
"Artist book and intervention"
|
||||
Artist book and intervention
|
||||
"How Many Cats?"
|
||||
How Many Cats?
|
||||
|
||||
|
||||
|
||||
"Networked publication"
|
||||
Networked publication
|
||||
"Libraries amongst others: A network publication"
|
||||
Libraries amongst others: A network publication
|
||||
|
||||
|
||||
|
||||
"Archive"
|
||||
Archive
|
||||
"The Repeater Archive "
|
||||
The Repeater Archive
|
||||
|
||||
|
||||
|
||||
"Online conference"
|
||||
Online conference
|
||||
"avant la lettre: media archaeology cn"
|
||||
avant la lettre: media archaeology cn
|
||||
|
||||
|
||||
|
||||
"Hybrid and interactive installation"
|
||||
Hybrid and interactive installation
|
||||
"dot_text_tile"
|
||||
dot_text_tile
|
||||
|
||||
|
||||
|
||||
""
|
||||
|
||||
"Channel Channel"
|
||||
Channel Channel
|
||||
|
||||
|
||||
|
||||
""
|
||||
|
||||
"Contextual Electronics"
|
||||
Contextual Electronics
|
||||
|
||||
|
||||
|
||||
""
|
||||
|
||||
"bpNichol Reader"
|
||||
bpNichol Reader
|
||||
|
||||
|
||||
|
||||
""
|
||||
|
||||
"Machine Learning 4 Cats"
|
||||
Machine Learning 4 Cats
|
||||
|
||||
|
||||
|
||||
""
|
||||
|
||||
"The Radio Book "
|
||||
The Radio Book
|
||||
|
||||
|
||||
|
||||
""
|
||||
|
||||
"textArchaeology"
|
||||
textArchaeology
|
||||
|
||||
|
||||
|
||||
""
|
||||
|
||||
"IRIS"
|
||||
IRIS
|
||||
|
||||
|
||||
|
||||
""
|
||||
|
||||
"The Library Is Open"
|
||||
The Library Is Open
|
||||
|
||||
|
||||
|
||||
""
|
||||
|
||||
""
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class ="footnote"> Index page is generated with Jinja with an idiosyncratic CMS.</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue