Browse Source

syncing local files

master
manetta 2 years ago
parent
commit
ab8358a490
  1. 15
      command-line/Makefile
  2. 4
      command-line/css/baseline.css
  3. 143
      command-line/css/print.css
  4. 3
      command-line/templates/template.html
  5. 16
      command-line/update.py

15
command-line/Makefile

@ -1,7 +1,3 @@
STYLESHEET:=volumetric-regimes.css
.PHONY: css
all: run
install:
@ -20,12 +16,6 @@ wiki:
python3 update.py
@echo "Pulling updates from the wiki: Unfolded (wiki) --> Unfolded.html (file)"
css:
# ---
# sync the CSS on the pad with the local print.css file
./venv/bin/etherpump gettext $(STYLESHEET) > ./css/print.css
@echo "Saving CSS: $(STYLESHEET) (pad) --> print.css (file)"
multi:
# ---
# multistamp Multi Remix on top of the pdf
@ -35,5 +25,10 @@ multi:
upload:
scp -r Unfolded.html css js fonts varia:public_html/volumetric-regimes/
uploadpdf:
resample Unfolded-with-Multi.pdf 150
scp Unfolded-with-Multi-resampled.pdf varia:public_html/volumetric-regimes/Unfolded.pdf
@echo "Uploaded to: https://vvvvvvaria.org/~mb/volumetric-regimes/Unfolded.pdf"
uploadimages:
scp -r images varia:public_html/volumetric-regimes/

4
command-line/css/baseline.css

@ -14,6 +14,6 @@
white calc(var(--baseline) - 1px), var(--baseline-color) var(--baseline));
background-size: cover;
background-repeat: repeat-y;
/* start of the first baseline: half of the line-height: 9px */
background-position-y: 9px;
/* start of the first baseline: half of the line-height: 18px / 2 = 9px */
background-position-y: 7px;
}

143
command-line/css/print.css

@ -93,11 +93,9 @@ body{
/*size: 152.4mm 228.6mm;*/ /* Size of the online PDF */
/*size: 152mm 229mm;*/ /* Size listed in cover generator of Lightning Source */
/*size: 164mm 237mm;*/ /* Size of the physical printed DB06 book */
size: 576px 864px;
/*size: 152.4mm 228.6mm;*/
/* 3mm =~ 12px */
bleed: 12px;
/*size: 576px 864px;*/
size: 152.4mm 228.6mm;
bleed: 3mm;
marks: crop;
@bottom-center{
@ -179,7 +177,7 @@ body{
}
@page contribution:first{
/* exception for running-header on the first page of a contribution */
margin-top: 128px;
margin-top: 127px;
@top-center{
content: none;
@ -274,7 +272,7 @@ div.contribution{
}
div.section.nomarks,
div.section.toc,
div.contribution.beirut-82 div.thumb,
/*div.contribution.beirut-82 div.thumb,*/
div.enlarged-image{
page: nomarks;
}
@ -362,6 +360,9 @@ div.series{
column-fill: auto;
height: 207mm;
}
div.series p{
margin-bottom: var(--small-line-height);
}
/* Table of Contents */
div.toc *{
@ -444,14 +445,12 @@ div.item_index{
text-align: right;
}
/* Invasive imagination and its agential cuts - figures */
div.two-columns{
columns: 2 auto;
column-fill: auto;
column-gap: 14mm;
}
div.two-columns img,
/*div.two-columns img,*/
div.two-columns div.thumb{
display: block;
float: left;
@ -460,6 +459,32 @@ div.two-columns{
div.two-columns div.thumb img{
width: 55mm !important;
}
/* SUPER hacky... */
/* Exception for Nicolas' text */
div.two-columns a[href="#File:Inscriptions_2.jpg"] {
left: -54mm;
display: block;
}
div.two-columns div.thumbcaption{
width: 48mm;
}
/* Exceptions for one of the images in Nicolas' text,
to not display the caption on the left image in case there are two side by side */
div.two-columns a[href="#File:Inscriptions.jpg"] + div.thumbcaption {
display: none;
}
/* And to move the caption of the right image to the left,
so it functions as a caption for both */
div.two-columns a[href="#File:Inscriptions_2.jpg"] + div.thumbcaption {
width: 108mm !important;
margin-left: -60mm !important;
}
div.two-columns a[href="#File:Overexposed.jpg"] + div.thumbcaption {
margin-left: -42mm !important;
width: 90mm !important;
}
/* general elements*/
@ -568,6 +593,10 @@ h5, h6{
page-break-after: avoid;
hyphens: none;
}
.no-margin-top > *,
.no-margin-top img{
margin-top: 0 !important;
}
p{
text-indent: var(--first-indent);
margin: 0;
@ -576,6 +605,7 @@ p{
/* all exceptions on the text-indent */
div.title-wrapper + p,
div.note > p,
div.no-margin-top + p,
p.image + p,
div.list-without-markers p,
div.no-text-indent p,
@ -605,8 +635,7 @@ p{
text-indent: unset !important;
}
div.previously_published p,
div.biographies p,
div.series p{
div.biographies p{
margin-bottom: var(--line-height);
}
div.contribution.information-for-users div.title-wrapper + p + p > b,
@ -635,6 +664,7 @@ ul > li {
div.cover ul > li::before,
ul.references > li::before,
div.toc ul > li::before,
div.bibliography ul > li::before,
div.item_index ul > li::before {
content: none !important;
margin-left: unset;
@ -674,7 +704,8 @@ ul > li {
margin-left: -0.25em;
}
/* notes (ol.references) and references (ul.references) */
/* notes (ol.references) and references (ul.references) and bibliography (div.two-columns) */
div.bibliography ul,
ol.references,
ul.references{
font-size: var(--small-font-size);
@ -685,11 +716,13 @@ ul > li {
padding: 0;
orphans: 3;
}
div.bibliography li,
ol.references li,
ul.references li{
hyphens: none !important;
page-break-inside: auto !important;
}
div.bibliography li,
ul.references > li{
text-indent: -1em;
margin-bottom: unset !important;
@ -775,45 +808,74 @@ img{
/* Exception for Invasive Imagination images */
div.invasive-imagination div.thumb{
margin-bottom: 2em;
width: 75mm !important;
width: 105mm !important;
}
div.invasive-imagination div.thumb img{
width: 100% !important;
}
/* Exception for Maria Dada's text on Beirut 82 */
div.enlarged-image img,
div.invasive-imagination div.thumb div.thumbcaption{
width: calc(100% - 7mm);
}
div.invasive-imagination a[href="#File:Figure06.png"] img{
width: 365px !important;
}
/* Exception for Maria Dada's images */
div.contribution.beirut-82 div.thumb img{
width: auto !important;
max-width: auto !important;
height: 175mm !important;
max-height: 175mm !important;
height: 68mm !important;
margin: 0 !important;
}
div.contribution.beirut-82 div.thumb img{
margin-top: -10mm;
margin-left: -22mm !important;
}
div.contribution.beirut-82 div.thumb img[src="./images/Strategy_and_Tactics.jpg"]{
margin-left: -17mm !important;
div.contribution.beirut-82 div.thumb {
display: inline-block;
margin: var(--line-height) 0 -0.5em 0!important;
}
/* Exception for So-called plants */
div.contribution.so-called-plants img{
width: 85mm !important;
margin-left: var(--second-indent) !important;
margin-bottom: 0 !important;
}
div.contribution.so-called-plants h4{
margin-top: 9px !important;
}
/*div.enlarged-image img{
width: auto !important;
max-width: auto !important;
height: 175mm !important;
max-height: 175mm !important;
}*/
/* BASELINE FINAL TWEAKS */
img[src="./images/Imagen_2.png"]{
margin-top: 19px;
margin-top: 17px;
}
img[src="./images/Brk02.gif"]{
margin-bottom: 8px;
}
img[src="./images/Image20.png"]{
margin-top: 23px;
margin-bottom: 13px;
margin-bottom: 16px;
}
img[src="./images/CharmedS1EP2.jpg"]{
margin-bottom: 15px;
}
img[src="./images/CharmedS1EP22.jpg"]{
margin-bottom: 7px;
}
img[src="./images/DisintegrationEffect2.png"]{
margin-top: 23px;
}
img[src="./images/CollapseWoman1.jpg"]{
margin-top: 23px;
margin-bottom: 13px;
margin-top: 0 !important;
margin-bottom: 20px;
}
img[src="./images/Image92.gif"]{
margin-bottom: 11px;
}
img[src="./images/FKrig171.gif"]{
margin-top: -4px;
}
img[src="./images/AdvanceRig1.png"]{
margin-top: 22px;
@ -821,20 +883,18 @@ img{
img[src="./images/Rigonfour1.png"]{
margin-top: 23px;
}
img[src="./images/FKrig171.gif"]{
margin-top: -3px;
}
img[src="./images/DigestingDuck1.png"]{
margin-top: -2px;
}
img[src="./images/RiggingDan1.jpg"]{
margin-top: 20px;
margin-top: 16px;
margin-bottom: 11px;
}
img[src="./images/McKayRig1.jpg"]{
margin-top: -4px;
margin-top: -5px;
}
img[src="./images/TalismanRig1.jpg"]{
margin-top: -5px;
margin-bottom: 24px;
}
img[src="./images/Blender.jpg"]{
margin-top: 20px;
@ -1018,6 +1078,9 @@ table{
vertical-align: top;
padding: 0.5em !important;
}
td > p {
margin-top: var(--small-line-height);
}
tr:first-of-type td {
border: 0 !important;
border-left: 1px solid black !important;
@ -1057,16 +1120,24 @@ a:hover{
text-decoration: none;
page-break-inside: avoid;
}
/* specific details, uitzonderingen */
a.external{
word-break: break-all;
}
/* Disable for item index */
div.item_index a.external{
word-break: unset !important;
}
span.endash{
letter-spacing: -0.05em;
margin-left: -0.05em;
}
span.forced-hyphen::after{
all: unset !important;
display: contents !important;
content: "\200B" !important;
}
@media print{
html, body{

3
command-line/templates/template.html

@ -4,8 +4,11 @@
<meta charset="utf-8">
<link href="./css/pagedjs.css" rel="stylesheet" type="text/css">
<link href="./css/print.css" rel="stylesheet" type="text/css" media="print">
<!-- BASELINE GRID -->
<!-- <link href="./css/baseline.css" rel="stylesheet" type="text/css" media="print"> -->
<!-- ------------- -->
<script>
// Hyphenopoly is used for the hyphenation of the book.
// Thank you paged.js team for the Hyphenopoly tip!
// config for hyphenopoly
var Hyphenopoly = {

16
command-line/update.py

@ -133,11 +133,11 @@ def add_item_inventory_links(html):
for match in matches:
html = html.replace(match, f'<li><span class="item_nr">{ match }</span>')
print("\n-------------\n")
print("The following items ('###') appear [#, #, ...] many times in the book:\n")
# print("\n-------------\n")
# print("The following items ('###') appear [#, #, ...] many times in the book:\n")
sorted_index = dict(sorted(index.items()))
print(sorted_index)
print("\n-------------\n")
# print(sorted_index)
# print("\n-------------\n")
return html
@ -176,7 +176,6 @@ def tweaking(html):
html = html.replace('', '<span class="star">✶</span>')
html = html.replace('<p><a href="#File', '<p class="image"><a href="#File') # give <p>'s that contain an non-thumb image a .image class
html = html.replace('', '<span class="endash"> – </span>') # control the white spaces around an endash
html = html.replace('', '<span class="endash"> — </span>') # control the white spaces around an endash
pattern1 = r'''<h2><span class="mw-headline" id=".*">.*</span><span class="mw-editsection"><span class="mw-editsection-bracket"></span></span></h2>
<p><b>.*?</b>
@ -203,6 +202,13 @@ def tweaking(html):
for match in results:
html = html.replace(match, f'<div class="title-wrapper">{ match }</div>')
# # add a "word break oppertunity" after each hyphen in compound words, but avoid url's and class names
# pattern = r'(?!\b[/|"])([a-z][a-z][a-z][-])'
# results = re.findall(rf'{ pattern }', html)
# for match in results:
# print(match)
# html = html.replace(match, f'{ match }<wbr>')
return html
def clean_up(html):

Loading…
Cancel
Save