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
- :rocket: Fast - PDF documents are generated concurrently!
- :star: 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
- :paintbrush: 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
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.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8de68b143ee195f5d0639d4d28ed482161025ffbd18ef5f13e477c0c8f7437e |
|
MD5 | 89903c6b2c313e6d7e0b0b4d99b4ef9a |
|
BLAKE2b-256 | 47784b384463333ff18294d04ce01c351f06967852f588703b282c62ae450bed |