How is wiki-to-print made?

From Creative Crowds wiki
Jump to navigation Jump to search

Technically seen, wiki-to-print is a web application made in Python with Flask, that can be installed on the same server as where the MediaWiki is installed, or on any other server that you can access with sudo rights.

In practice, it's a version of a DIY configuration and that glues different things together: it takes a wiki page and a stylesheet as input sources (using Python) and renders them into a HTML page (using Pandoc) and a PDF preview page (using Paged.js).

Code

The source code of the wiki-to-print version that is installed at CC can be found at: https://git.vvvvvvaria.org/CC/wiki-to-print/.

The git repository contains the following files and folders:

├── static/
├── templates/
├── Makefile
├── README.md
├── api.py
├── config.json 
├── config.py
├── requirements.txt
└── web-interface.py
  • static/: folder for static files used by Flask (eg. css and js scripts)
  • templates/: folder for Jinja templates used by Flask
  • Makefile: script you can use to install or run the Flask application
  • api.py: script with all the functions that are used by the Flask application
  • config.json: config script for your wiki-to-print installation
  • config.py: script that binds config.json with web-interface.py
  • requirements.txt: list of software dependencies for wiki-to-print
  • web-interface.py: the Flask application

Other versions and variants of this wiki workflow can be found here: