Browse Source

added custom hacks to make all the TOC page nrs work

master
manetta 3 years ago
parent
commit
e517fdfbb3
  1. 62
      command-line/update.py

62
command-line/update.py

@ -93,57 +93,6 @@ def download_media(html, images, wiki):
return html
def insert_variable_geometry(html):
vg = """
<script>
/*Sketch.js from the Chapter Variable Geometry in Aesthetic Programming - A Handbook of Software Studies, by Winnie Soon & Geoff Cox (2020) - http://aesthetic-programming.net/*/
/*Inspired by David Reinfurt's work - Multi*/
let moving_size = 50;
let static_size = 20;
function setup() {
createCanvas(windowWidth, windowHeight);
frameRate(15);
}
function draw() {
//background
background(230);
//left
noStroke()
fill(0);
rect(97, 169, 79, 12);
//right
rect(365, 184, 20, 15);
fill(20, 20, 120);
beginShape();
vertex(365, 199);
vertex(385, 199);
vertex(372, 216);
vertex(358, 216);
endShape(CLOSE);
//bottom
noFill();
stroke(130);
strokeWeight(2);
ellipse(255, 350, static_size, static_size);
//mouse interactions
stroke(180);
ellipse(mouseX, mouseY, moving_size, moving_size);
if (mouseIsPressed) {
static_size = floor(random(5, 20));
}
}
</script>"""
html = html.replace("$multi", vg)
return html
def add_item_inventory_links(html):
"""
html = string (HTML)
@ -180,6 +129,15 @@ def add_item_inventory_links(html):
return new_html
def tweaking(html):
"""
html = string (HTML)
"""
html = html.replace('<a href="#X,_y,_z_(4_filmstills)"', '<a href="#x,_y,_z_(4_filmstills)"') # change the anchor link in the TOC to lowercase
html = html.replace('<a href="#Rehearsal_as_the_%E2%80%98Other%E2%80%99_to_Hypercomputation"', '<a href="#Rehearsal_as_the_‘Other’_to_Hypercomputation"') # change the anchor link in the TOC to lowercase
html = html.replace('<a href="#We_hardly_encounter_anything_that_didn%E2%80%99t_really_matter"', '<a href="#We_hardly_encounter_anything_that_didn’t_really_matter"') # change the anchor link in the TOC to lowercase
return html
def clean_up(html):
"""
html = string (HTML)
@ -214,7 +172,7 @@ def parse_page(pagename, wiki):
html = download_media(html, images, wiki)
html = clean_up(html)
html = add_item_inventory_links(html)
# html = insert_variable_geometry(html)
html = tweaking(html)
html = fast_loader(html)
else:
html = None

Loading…
Cancel
Save