Notebook.sh: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
No edit summary
Line 1: Line 1:
The script below uses <code>curl</code>, <code>pandoc</code>, <code>weasyprint</code>, <code>pdfbook2</code> and [[User:Manetta/Booklet-stylesheet.css]] as a stylesheet to render a PDF from a wiki page.
The script below uses <code>curl</code>, <code>pandoc</code>, <code>weasyprint</code>, <code>pdfbook2</code> and [[User:Manetta/Booklet-stylesheet.css|Booklet-stylesheet.css]] as a stylesheet to render a PDF from a wiki page.


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">

Revision as of 15:19, 21 November 2023

The script below uses curl, pandoc, weasyprint, pdfbook2 and Booklet-stylesheet.css as a stylesheet to render a PDF from a wiki page.

WIKIPAGE=""

curl https://pzwiki.wdka.nl/mediadesign/$WIKIPAGE?action=raw > $WIKIPAGE.mediawiki
pandoc --from mediawiki --to html $WIKIPAGE.mediawiki --css https://pzwiki.wdka.nl/mediadesign/User:Manetta/Booklet-stylesheet.css?action=raw --output $WIKIPAGE.html
weasyprint $WIKIPAGE.html --stylesheet https://pzwiki.wdka.nl/mediadesign/User:Manetta/Booklet-stylesheet.css?action=raw $WIKIPAGE.pdf
pdfbook2 --paper=a4paper --short-edge --no-crop $WIKIPAGE.pdf