wiki-to-print/command-line
2023-03-29 18:46:27 +02:00
..
css publishing the code of a CC version of wiki-to-print 2023-02-01 17:32:15 +01:00
js publishing the code of a CC version of wiki-to-print 2023-02-01 17:32:15 +01:00
templates publishing the code of a CC version of wiki-to-print 2023-02-01 17:32:15 +01:00
Makefile publishing the code of a CC version of wiki-to-print 2023-02-01 17:32:15 +01:00
README.md docs: getting started from scratch 2023-03-29 18:46:27 +02:00
requirements.txt docs: getting started from scratch 2023-03-29 18:46:27 +02:00
update.py publishing the code of a CC version of wiki-to-print 2023-02-01 17:32:15 +01:00

CLI for wiki-to-print

The script uses the MediaWiki API to download all content (text + images) from a specified wiki page.

It saves it as a HTML page, which can be turned into a PDF with Paged.js.

Folder structure

.
├── css
│   ├── baseline.css
│   ├── pagedjs.css
│   └── print.css
├── fonts
├── images
├── js
│   ├── paged.js
│   └── paged.polyfill.js
├── Makefile
├── templates
│   ├── template.html
│   └── template.inspect.html
└── update.py

How to use it?

  1. Change the wiki and pagename (e.g. Pdf:Foobar) variables in update.py on line 221 + 222.
  2. Copy paste your CSS into print.css
  3. python3 -m venv .venv && source .venv/bin/activate
  4. pip install -r requirements.txt
  5. Run import nltk; nltk.download('punkt') in a python3 interpreter
  6. Run $ python3 update.py
  7. Run $ make
  8. Open localhost:8000 in your browser