You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
|
|
# 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.
|
|
|
|
1. Copy paste your CSS into print.css
|
|
|
|
1. `python3 -m venv .venv && source .venv/bin/activate`
|
|
|
|
1. `pip install -r requirements.txt`
|
|
|
|
1. Run `import nltk; nltk.download('punkt')` in a `python3` interpreter
|
|
|
|
1. Run `$ python3 update.py`
|
|
|
|
1. Run `$ make`
|
|
|
|
1. Open `localhost:8000` in your browser
|