A tool to convert Markdown files into formatted PDFs
MIT License
Libris is a Markdown to PDF conversion tool that collates multiple Markdown files into a single PDF.
sudo apt update
sudo apt install python3-pip
pip install libris
$schema
property of your configuration object to point to https://github.com/lazy-scrivener-games/libris/json-schemas/config-schema.json
, you will get auto-complete in any IDE or text editor that supports JSON Schema validation.libris <CONFIG_FILE_PATH>
docker build -t libris .
docker run -it --name libris libris bash
usage: libris [-h] [-w] [-v] config_file
Builds a PDF from a JSON configuration file that points to various Markdown source files.
positional arguments:
config_file A JSON file that specifies how to build the PDF. View the full docs for details.
optional arguments:
-h, --help show this help message and exit
-w, --watch Watch the source files and re-compile on changes.
-v, --verbose Prints additional logging data, including intermediate HTML.
-n, --no-validation Skips JSON validation. Use this if you are getting URL resolution errors.
Path | Description |
---|---|
libris | Libris program package folder |
libris/json-schemas | JSON schemas to validate configuration files |
libris/lib | Supporting functions and classes |
libris/example | Example markdown, CSS, and configuration file |
libris/scripts | Shell script installed on running pip install |
Path | Description |
---|---|
.gitattributes | Git attributes file |
.gitignore | Git ignore file |
.pylintrc | Linting rules |
config-docs.MD | Documentation for config files |
README.MD | Main project README |
requirements.txt | Python requirements list |
setup.py | Package setup file for pip |
libris (folder) | Libris program package folder |
libris/__init__.py | Module init file |
libris/__main__.py | Main program entry point |
libris/json-schemas (folder) | JSON schemas to validate configuration files |
libris/json-schemas/config-schema.json | JSON schema for overall configuration file |
libris/json-schemas/decorator-schema.json | JSON schema for decorator data |
libris/json-schemas/source-schema.json | JSON schema for individual markdown source data |
libris/json-schemas/sources-schema.json | JSON schema for markdown sources list |
libris/json-schemas/style-schema.json | JSON schema for individual CSS style |
libris/json-schemas/styles-schema.json | JSON schema for CSS styles list |
libris/lib (folder) | Supporting functions and classes |
libris/lib/constants.py | Program constants |
libris/lib/data_extractors.py | Functions that extract data from files |
libris/lib/pdf_builder.py | Functions that construct the PDF output |
libris/lib/watch.py | Functions that support the file watch feature |
libris/lib/__init__.py | Module init file |
example (folder) | Example markdown, CSS, and configuration file |
example/advanced-style.css | Example CSS stylesheet |
example/basic-style.css | Example CSS stylesheet |
example/chapter1.md | Example markdown |
example/chapter2.md | Example markdown |
example/chapter3.md | Example markdown |
example/example-config.json | Example libris configuration file |
scripts (folder) | Folder for shell script installed on running pip install |
scripts/libris | Shell script installed on running pip install |
python3 -m build
python3 -m twine upload dist/*