index_thesis

master
Michael Murtaugh 5 months ago
parent 903d2a7fa3
commit 3c3701d413

@ -1,13 +1,17 @@
index.json: index.html
python3 scripts/extract_rdf.py > $@
index_titles.html: index.json scripts/templates/index_titles.html scripts/index_new.py
python3 scripts/index_new.py
venv/:
python3 -m venv venv
source venv/bin/activate
pip install html5lib jinja2 rdflib pyrdfa3
index.json: index.html
python3 scripts/extract_rdf.py > $@
merge.json: index.json covers.json
python3 scripts/merge_json.py index.json covers.json > $@
index_titles.html: merge.json scripts/templates/index_titles.html scripts/index_new.py
python3 scripts/index_new.py index_titles.html index_titles.html
index_thesis.html: merge.json scripts/templates/index_thesis.html scripts/index_new.py
python3 scripts/index_new.py index_thesis.html index_thesis.html

@ -0,0 +1,84 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>XPUB Projects</title>
<link rel="stylesheet" href="style.css" />
<style>
@font-face {
font-family: inconsolata;
src: url(fonts/inconsolata.ttf);
}
@font-face {
font-family: inconsolatabold;
src: url(fonts/inconsolatabold.ttf);
}
body {
margin: 3%;
font-family:inconsolata, sans-serif;
background: lightgray;
}
a { text-decoration: none; color: black }
a:hover { text-decoration: underline; color: blue; }
.thesis {
float: left;
margin: 10px;
}
</style>
</head>
<body>
<div class="thesis"><a href="https://project.xpub.nl/868-mhz/asphaltspur.pdf" title="thesis"><img src="https://project.xpub.nl/868-mhz/asphaltspur.cover.jpg">868 MHz</a></div>
<div class="thesis"><a href="https://project.xpub.nl/generatingstories/thesis.pdf" title="thesis"><img src="https://project.xpub.nl/generatingstories/thesis.cover.jpg">a and a</a></div>
<div class="thesis"><a href="https://project.xpub.nl/alt-reality-lexicon/pdf/Publication-AltRealityLexBook.pdf" title="thesis"><img src="https://project.xpub.nl/alt-reality-lexicon/pdf/Publication-AltRealityLexBook.cover.jpg">Alt Reality Lexicon</a></div>
<div class="thesis"><a href="https://project.xpub.nl/anomolous-faces/pdf/Publication-POD_Thesis_Max-Franklin.pdf" title="thesis"><img src="https://project.xpub.nl/anomolous-faces/pdf/Publication-POD_Thesis_Max-Franklin.cover.jpg">Anomolous faces</a></div>
<div class="thesis"><a href="https://project.xpub.nl/attempting-diffraction/pdf/Camilo_Garcia_Aycardi_Graduation_Thesis_XPUB_.pdf" title="thesis"><img src="https://project.xpub.nl/attempting-diffraction/pdf/Camilo_Garcia_Aycardi_Graduation_Thesis_XPUB_.cover.jpg">Attempting Diffraction</a></div>
<div class="thesis"><a href="https://project.xpub.nl/back-it-up/pdf/Publication-Karina_ABC_thesis.pdf" title="thesis"><img src="https://project.xpub.nl/back-it-up/pdf/Publication-Karina_ABC_thesis.cover.jpg">Back It Up</a></div>
<div class="thesis"><a href="https://project.xpub.nl/cartographies-of-counter-speculation/pdf/garcia-paloma-cartographies-of-invisibility.pdf" title="thesis"><img src="https://project.xpub.nl/cartographies-of-counter-speculation/pdf/garcia-paloma-cartographies-of-invisibility.cover.jpg">Cartographies of Counter Speculation</a></div>
<div class="thesis"><a href="https://project.xpub.nl/RuralComputing/pdf/thesis.pdf" title="thesis"><img src="https://project.xpub.nl/RuralComputing/pdf/thesis.cover.jpg">Concert, Computation, Conviviality</a></div>
<div class="thesis"><a href="https://project.xpub.nl/desire_revolution/pdf/A%20SAILORS%20GUIDE%20TO%20EARTH_Clara%20Noseda.pdf" title="thesis"><img src="https://project.xpub.nl/desire_revolution/pdf/A%20SAILORS%20GUIDE%20TO%20EARTH_Clara%20Noseda.cover.jpg">CONSIDER DISASTER, DESIRE REVOLUTION: A repository for astropolitical research</a></div>
<div class="thesis"><a href="https://project.xpub.nl/notitleyet/pdf/Martin_Foucaut_Graduation_Thesis_XPUB_2022.pdf" title="thesis"><img src="https://project.xpub.nl/notitleyet/pdf/Martin_Foucaut_Graduation_Thesis_XPUB_2022.cover.jpg">Count On Me</a></div>
<div class="thesis"><a href="https://project.xpub.nl/dear-cross-maker/supi_Cross-Making.pdf" title="thesis"><img src="https://project.xpub.nl/dear-cross-maker/supi_Cross-Making.cover.jpg">Dear (Cross) Maker,</a></div>
<div class="thesis"><a href="https://project.xpub.nl/eigengrau/pdf/Phantasmagoria_Zalan_Szakacs_Thesis.pdf" title="thesis"><img src="https://project.xpub.nl/eigengrau/pdf/Phantasmagoria_Zalan_Szakacs_Thesis.cover.jpg">Eigengrau</a></div>
<div class="thesis"><a href="https://project.xpub.nl/frabjousish/pdf/thesis.pdf" title="thesis"><img src="https://project.xpub.nl/frabjousish/pdf/thesis.cover.jpg">Frabjousish</a></div>
<div class="thesis"><a href="https://project.xpub.nl/habitat/Thesis--Habitat--Living-sharing-adapting---Jacopo-Lega.pdf" title="thesis"><img src="https://project.xpub.nl/habitat/Thesis--Habitat--Living-sharing-adapting---Jacopo-Lega.cover.jpg">Habitat</a></div>
<div class="thesis"><a href="https://project.xpub.nl/hacking-maintenance-with-care/pdf/HMWC.pdf" title="thesis"><img src="https://project.xpub.nl/hacking-maintenance-with-care/pdf/HMWC.cover.jpg">Hacking Maintenance with Care</a></div>
<div class="thesis"><a href="https://project.xpub.nl/hello-worlding/Hello%20Worlding%20-%20kamo%20-%20THE%20REAL%20ONE.pdf" title="thesis"><img src="https://project.xpub.nl/hello-worlding/Hello%20Worlding%20-%20kamo%20-%20THE%20REAL%20ONE.cover.jpg">Hello Worlding</a></div>
<div class="thesis"><a href="https://project.xpub.nl/howtobeasocialjusticewarrior/img/Masterthesis_MiriamSch%C3%B6b_TheLeftCanMeme.pdf" title="thesis"><img src="https://project.xpub.nl/howtobeasocialjusticewarrior/img/Masterthesis_MiriamSch%C3%B6b_TheLeftCanMeme.cover.jpg">How to be a social justice warrior</a></div>
<div class="thesis"><a href="https://project.xpub.nl/ilinx/pdf/OHE.pdf" title="thesis"><img src="https://project.xpub.nl/ilinx/pdf/OHE.cover.jpg">ilinx</a></div>
<div class="thesis"><a href="https://project.xpub.nl/instant-warnet/pdf/Berting-Making-Silences-On-Social-Media.pdf" title="thesis"><img src="https://project.xpub.nl/instant-warnet/pdf/Berting-Making-Silences-On-Social-Media.cover.jpg">Instant Warnet</a></div>
<div class="thesis"><a href="https://project.xpub.nl/is-it-time-to-eat-or-is-there-no-more-time-to-eat/pdf/your-body-will-make-itself-heard.pdf" title="thesis"><img src="https://project.xpub.nl/is-it-time-to-eat-or-is-there-no-more-time-to-eat/pdf/your-body-will-make-itself-heard.cover.jpg">Is it time to eat, or is there no more time to eat?</a></div>
<div class="thesis"><a href="https://project.xpub.nl/lets-amplify-unspeakable-things/pdf/diakrousi-lets-amplify-unspeakable-things.pdf" title="thesis"><img src="https://project.xpub.nl/lets-amplify-unspeakable-things/pdf/diakrousi-lets-amplify-unspeakable-things.cover.jpg">Let's Amplify Unspeakable Things</a></div>
<div class="thesis"><a href="https://project.xpub.nl/lever_burns/pdf/Ezn_LeverBurns.pdf" title="thesis"><img src="https://project.xpub.nl/lever_burns/pdf/Ezn_LeverBurns.cover.jpg">Lever Burns</a></div>
<div class="thesis"><a href="https://project.xpub.nl/low-tech-chronicles/PDF/Mark_van_den_Heuvel_thesis_light-edition.pdf" title="thesis"><img src="https://project.xpub.nl/low-tech-chronicles/PDF/Mark_van_den_Heuvel_thesis_light-edition.cover.jpg">Low-Tech Chronicles</a></div>
<div class="thesis"><a href="https://project.xpub.nl/makeinclusivewebsites/pdf/MaxLehmann_Thesis_compressed.pdf" title="thesis"><img src="https://project.xpub.nl/makeinclusivewebsites/pdf/MaxLehmann_Thesis_compressed.cover.jpg">Make Inclusive Websites</a></div>
<div class="thesis"><a href="https://project.xpub.nl/minor_stories/pdf/(compressed)_spark(l)ing_curiosities_through_intimate_publishing.pdf" title="thesis"><img src="https://project.xpub.nl/minor_stories/pdf/%28compressed%29_spark%28l%29ing_curiosities_through_intimate_publishing.cover.jpg">Minor Stories</a></div>
<div class="thesis"><a href="https://project.xpub.nl/modular-matter/modular-matter-Jian_Haake.pdf" title="thesis"><img src="https://project.xpub.nl/modular-matter/modular-matter-Jian_Haake.cover.jpg">MODULAR MATTER</a></div>
<div class="thesis"><a href="https://project.xpub.nl/networks-of-care/pdf/networksofcare_thesis.pdf" title="thesis"><img src="https://project.xpub.nl/networks-of-care/pdf/networksofcare_thesis.cover.jpg">Networks of Care</a></div>
<div class="thesis"><a href="https://project.xpub.nl/nothanks/pdf/THESIS-compressed.pdf" title="thesis"><img src="https://project.xpub.nl/nothanks/pdf/THESIS-compressed.cover.jpg">No thanks, I'll make my own</a></div>
<div class="thesis"><a href="https://project.xpub.nl/how-to-make-a-notebook-that/Thesis-Paper-Notebooks.pdf" title="thesis"><img src="https://project.xpub.nl/how-to-make-a-notebook-that/Thesis-Paper-Notebooks.cover.jpg">Paper Notebooks: From an Industrial Model to a Tool of Expression</a></div>
<div class="thesis"><a href="https://project.xpub.nl/parallel-colonialism/pdf/bohye-woo-thesis-2020.pdf" title="thesis"><img src="https://project.xpub.nl/parallel-colonialism/pdf/bohye-woo-thesis-2020.cover.jpg">Parallel Colonialism</a></div>
<div class="thesis"><a href="https://project.xpub.nl/poetic-software/pdf/poetic_software_thesis.pdf" title="thesis"><img src="https://project.xpub.nl/poetic-software/pdf/poetic_software_thesis.cover.jpg">Poetic Software</a></div>
<div class="thesis"><a href="https://project.xpub.nl/referendum-medialogs/pdf/Publication-referendum_medialogs.pdf" title="thesis"><img src="https://project.xpub.nl/referendum-medialogs/pdf/Publication-referendum_medialogs.cover.jpg">Referendum Medialogs</a></div>
<div class="thesis"><a href="https://project.xpub.nl/smart-speaker-theatre/pdf/ghost_in_the_speaker.pdf" title="thesis"><img src="https://project.xpub.nl/smart-speaker-theatre/pdf/ghost_in_the_speaker.cover.jpg">Smart Speaker Theatre</a></div>
<div class="thesis"><a href="https://project.xpub.nl/sobremesa/pdf/thesis.pdf" title="thesis"><img src="https://project.xpub.nl/sobremesa/pdf/thesis.cover.jpg">Sobremesa</a></div>
<div class="thesis"><a href="https://project.xpub.nl/sound-jams/alnik-xpub-thesis.pdf" title="thesis"><img src="https://project.xpub.nl/sound-jams/alnik-xpub-thesis.cover.jpg">Sound Jams: Deluxe Edition</a></div>
<div class="thesis"><a href="https://project.xpub.nl/syster-papyri-magicae/pdf/ArtemisGryllaki-Thesis.pdf" title="thesis"><img src="https://project.xpub.nl/syster-papyri-magicae/pdf/ArtemisGryllaki-Thesis.cover.jpg">Syster Papyri Magicae</a></div>
<div class="thesis"><a href="https://project.xpub.nl/tactical-watermarks/pdf/Thesis_Master_PSC_HD.pdf" title="thesis"><img src="https://project.xpub.nl/tactical-watermarks/pdf/Thesis_Master_PSC_HD.cover.jpg">Tactical Watermarks</a></div>
<div class="thesis"><a href="https://project.xpub.nl/terrafying-hear-say/pdf/thesis.pdf" title="thesis"><img src="https://project.xpub.nl/terrafying-hear-say/pdf/thesis.cover.jpg">Terrafying Hear/Say</a></div>
<div class="thesis"><a href="https://project.xpub.nl/thanks_for_listening/thesis_mitsitron.pdf" title="thesis"><img src="https://project.xpub.nl/thanks_for_listening/thesis_mitsitron.cover.jpg">Thanks for listening</a></div>
<div class="thesis"><a href="https://project.xpub.nl/the-bootleg-library/pdf/thesis.pdf" title="thesis"><img src="https://project.xpub.nl/the-bootleg-library/pdf/thesis.cover.jpg">the bootleg library</a></div>
<div class="thesis"><a href="https://project.xpub.nl/the-constitution/pdf/Tisa-Ne%C5%BEa-Herlec_The-Constitution.pdf" title="thesis"><img src="https://project.xpub.nl/the-constitution/pdf/Tisa-Ne%C5%BEa-Herlec_The-Constitution.cover.jpg">The Constitution</a></div>
<div class="thesis"><a href="https://project.xpub.nl/the-repeater-archive/pdf/Biyi_Wen_Thesis.pdf" title="thesis"><img src="https://project.xpub.nl/the-repeater-archive/pdf/Biyi_Wen_Thesis.cover.jpg">The Repeater Archive</a></div>
<div class="thesis"><a href="https://project.xpub.nl/social-shelves-project/xpub_master-thesis_gersande-schellinx.pdf" title="thesis"><img src="https://project.xpub.nl/social-shelves-project/xpub_master-thesis_gersande-schellinx.cover.jpg">The Social Shelf Project</a></div>
<div class="thesis"><a href="https://project.xpub.nl/to-whom-it-may-affect/somewhere-highway-publishing.pdf" title="thesis"><img src="https://project.xpub.nl/to-whom-it-may-affect/somewhere-highway-publishing.cover.jpg">"To whom it may affect"</a></div>
<div class="thesis"><a href="https://project.xpub.nl/unlearning-the-rules-of-collectivity/pdf/Publication-thesis%20Giuliade%20Giovanelli.pdf" title="thesis"><img src="https://project.xpub.nl/unlearning-the-rules-of-collectivity/pdf/Publication-thesis%20Giuliade%20Giovanelli.cover.jpg">Unlearning the Rules of Collectivity</a></div>
<div class="thesis"><a href="https://project.xpub.nl/unpublishing/pdf/Thesis-N.Rotem-Stibbe.pdf" title="thesis"><img src="https://project.xpub.nl/unpublishing/pdf/Thesis-N.Rotem-Stibbe.cover.jpg">Unpublishing</a></div>
<div class="thesis"><a href="https://project.xpub.nl/usx/Nami%20Kim_graduation%20thesis_Xpub.pdf" title="thesis"><img src="https://project.xpub.nl/usx/Nami%20Kim_graduation%20thesis_Xpub.cover.jpg">User Sentimental eXperience</a></div>
<div class="thesis"><a href="https://project.xpub.nl/virtualgarden/XPUB-Cyberhotels-KB.pdf" title="thesis"><img src="https://project.xpub.nl/virtualgarden/XPUB-Cyberhotels-KB.cover.jpg">Virtual Gardens</a></div>
<div class="thesis"><a href="https://project.xpub.nl/when-you-might-go-astray/pdf/wymga.pdf" title="thesis"><img src="https://project.xpub.nl/when-you-might-go-astray/pdf/wymga.cover.jpg">When you might go astray</a></div>
<div class="thesis"><a href="https://project.xpub.nl/writing_cure/pdf/Avital_Barkai_thesis_compressed.pdf" title="thesis"><img src="https://project.xpub.nl/writing_cure/pdf/Avital_Barkai_thesis_compressed.cover.jpg">Writing Cure</a></div>
</body>
</html>

@ -1,20 +1,19 @@
import json
from jinja2 import Template, Environment, FileSystemLoader
env = Environment(loader=FileSystemLoader("scripts/templates"))
# import jinjafy.filters
# for name, fn in jinjafy.filters.all.items():
# env.filters[name] = fn
import argparse
from common import load_json
data = load_json()
# with open("index.json") as fin:
# data = json.load(fin)
# data['projects'] = [x for x in data['@graph'] if x['type'] == 'project']
# data['projects'].sort(key=lambda x: x['title'].strip('"').lower())
ap = argparse.ArgumentParser("")
ap.add_argument("template")
ap.add_argument("output")
args = ap.parse_args()
env = Environment(loader=FileSystemLoader("scripts/templates"))
import jinjafilters
for name, fn in jinjafilters.all.items():
env.filters[name] = fn
template = env.get_template("index_titles.html")
with open("index_titles.html", "w") as fout:
data = load_json("merge.json")
template = env.get_template(args.template)
with open(args.output, "w") as fout:
print (template.render(**data), file=fout)

@ -0,0 +1,101 @@
from itertools import zip_longest
from urllib.parse import quote as urlquote, unquote as urlunquote
import time
from markdown import markdown as markdown_
import json as json_
import math
def datetimeformat (t, format='%Y-%m-%d %H:%M:%S'):
return time.strftime(format, time.localtime(t))
def append (t, at, rstrip=True):
if rstrip:
return t.rstrip() + at
else:
return t+at
def append_edit_link (t, url=None):
# <a href="/cgi-bin/aa/indexedit.cgi?url={{c.url|urlencode}}">
if url:
return t.rstrip() + '<a href="/cgi-bin/aa/indexedit.cgi?url={0}">&#9997;</a>'.format(urlquote(url))
else:
return t.rstrip() + '<a href="/cgi-bin/aa/indexedit.cgi">&#9997;</a>'
def grouper(iterable, n, fillvalue=None):
"grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
args = [iter(iterable)] * n
return zip_longest(fillvalue=fillvalue, *args)
def humanize_bytes(bytesize, precision=2):
"""
Humanize byte size figures
"""
abbrevs = (
(1 << 50, 'PB'),
(1 << 40, 'TB'),
(1 << 30, 'GB'),
(1 << 20, 'MB'),
(1 << 10, 'kB'),
(1, 'bytes')
)
if bytesize == 1:
return '1 byte'
for factor, suffix in abbrevs:
if bytesize >= factor:
break
if factor == 1:
precision = 0
return '%.*f %s' % (precision, bytesize / float(factor), suffix)
def timecode(rawsecs, fract=True, alwaysfract=True, fractdelim='.', alwayshours=True):
# returns a string in HH:MM:SS[.xxx] notation
# if fract is True, uses .xxx if either necessary (non-zero)
# OR alwaysfract is True
hours = math.floor(rawsecs / 3600)
rawsecs -= hours * 3600
mins = math.floor(rawsecs / 60)
rawsecs -= mins * 60
if fract:
secs = math.floor(rawsecs)
rawsecs -= secs
if (rawsecs > 0 or alwaysfract):
fract = "%.03f" % rawsecs
if hours or alwayshours:
return "%02d:%02d:%02d%s%s" % (hours, mins, secs, fractdelim, \
fract[2:])
else:
return "%02d:%02d%s%s" % (mins, secs, fractdelim, fract[2:])
else:
if hours or alwayshours:
return "%02d:%02d:%02d" % (hours, mins, secs)
else:
return "%02d:%02d" % (mins, secs)
else:
secs = round(rawsecs)
if hours or alwayshours:
return "%02d:%02d:%02d" % (hours, mins, secs)
else:
return "%02d:%02d" % (mins, secs)
def markdown (src):
return markdown_(src)
def json (src):
return json_.dumps(src, indent=2)
all = {
'datetimeformat': datetimeformat,
'grouper': grouper,
'timecode': timecode,
'humanize_bytes': humanize_bytes,
'urlquote': urlquote,
'markdown': markdown,
'append': append,
'json': json,
'append_edit_link': append_edit_link
}

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>XPUB Projects</title>
<link rel="stylesheet" href="style.css" />
<style>
@font-face {
font-family: inconsolata;
src: url(fonts/inconsolata.ttf);
}
@font-face {
font-family: inconsolatabold;
src: url(fonts/inconsolatabold.ttf);
}
body {
margin: 3%;
font-family:inconsolata, sans-serif;
background: lightgray;
}
a { text-decoration: none; color: black }
a:hover { text-decoration: underline; color: blue; }
.thesis {
float: left;
margin: 10px;
}
</style>
</head>
<body>
{% for project in projects %}
<div class="thesis"><a href="{{project.thesis}}" title="thesis"><img src="{{project.cover}}">{{project.title}}</a></div>
{%- endfor %}
</body>
</html>
Loading…
Cancel
Save