A highly-configurable plugin for MkDocs that exports your pages to PDF files.
Project description
MkDocs Exporter
A highly-configurable plugin for MkDocs that exports your pages to PDF files.
Features
- 🚀 Fast - PDF documents are generated concurrently!
- ⭐ Powerful - it uses a headless browser and some awesome libraries under the hood to generate PDF files
- Paged.js polyfills are included by default (Paged Media and Generated Content CSS modules)
- Sass support (via
libsass
) for your stylesheets
- 🎨 Customizable - full control over the resulting documents
- Built for and compatible with
mkdocs-material
- Cover pages with templating support (for instance, with the
macros
plugin) - Define custom scripts and stylesheets to customize your PDF documents
- Define "buttons" at the top of your documentation pages
- Built for and compatible with
Prerequisites
- Python
>= 3.7
- MkDocs
>= 1.1
Installation
The plugin is hosted on PyPI and can be installed via pip
(or your favourite package manager):
pip install mkdocs-exporter
Usage
Three plugins are currently available:
mkdocs/exporter
(required): base plugin which must precede the othersmkdocs/exporter/pdf
(optional): plugin that exports your pages as individual PDF documentsmkdocs/exporter/extras
(optional): provides extra functionalities (buttons, HTML utilities...)
Example
The following configuration excerpt from mkdocs.yml
should cover the basic functionalities of this plugin:
plugins:
- mkdocs/exporter
- mkdocs/exporter/pdf:
concurrency: 8
covers:
front: resources/templates/covers/front.html.j2
back: resources/templates/covers/back.html.j2
stylesheets:
- resources/stylesheets/pdf.scss
- mkdocs/exporter/extras:
buttons:
- title: Download as PDF
enabled: !!python/name:mkdocs_exporter.plugins.pdf.button.enabled
icon: !!python/name:mkdocs_exporter.plugins.pdf.button.icon
href: !!python/name:mkdocs_exporter.plugins.pdf.button.href
download: !!python/name:mkdocs_exporter.plugins.pdf.button.download
Check out a sample PDF generated by this plugin from the default page of the Material for MkDocs theme.
It has been built with some custom CSS and features cover pages.
Roadmap
- Documentation (based on
MkDocs
and featuring this plugin) - Ensure full compatibility with other themes than
mkdocs-material
- Combine all pages as one PDF
Feel free to request additional features by submitting an issue or by contributing through a pull request.
License
This project is licensed under the MIT License (MIT)
, which you can read here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mkdocs_exporter-1.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b6c9e94f6f7ad946650e8876b96af5ad6e009ca2cd7c3c52644521184bc29d4 |
|
MD5 | 0f70f5b74fc617ec4ba144b11846c809 |
|
BLAKE2b-256 | 8790d1f4613e110b80bb0679ed17d590167b572d72dc4675f9ee33a0559e22e0 |