![](https://private-user-images.githubusercontent.com/10183277/287466489-85c768f6-fe27-43a1-998c-ac89e926cba1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3NDgzMDMsIm5iZiI6MTcyNTc0ODAwMywicGF0aCI6Ii8xMDE4MzI3Ny8yODc0NjY0ODktODVjNzY4ZjYtZmUyNy00M2ExLTk5OGMtYWM4OWU5MjZjYmExLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA3VDIyMjY0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc5ZDdkZWIzOWRlZjMxNDVmOGJkMDM2MDE3MzBjMWQwMGY2YjFkM2YwY2E4NmI2NDBkZTYxZjgyZTZkM2YxMWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.iZ1zB9Xsm08Nscpv449Ty1zXdIVjcg4_rtWQ94rqUtk)
A highly configurable plugin for MkDocs that exports your pages as PDF documents.
Additionally, it can combine your entire documentation into a single PDF file.
- 🚀 Fast - All PDF documents are generated concurrently!
- 🎨 Customizable - full control over the resulting documents
- Combine all your pages into a single PDF document
- Create cover pages
- Define custom scripts and stylesheets to customize your PDF documents
- Add buttons to the top of your pages (example)
- Compatible with
material
andreadthedocs
themes- Check out sample PDF documents here
- ⭐ Powerful - it uses a headless browser and some awesome libraries under the hood to generate PDF documents
- Playwright to automate browsers
- Paged.js polyfills included (provide Paged Media and Generated Content CSS modules)
- Sass support included for your stylesheets
- Python
>= 3.9
- MkDocs
>= 1.4
The plugin is hosted on PyPI and can be installed via pip
(or your favourite package manager):
pip install mkdocs-exporter
The following configuration excerpt from the mkdocs.yml
configuration file used by this documentation should cover the basic functionalities of this plugin:
plugins:
- exporter:
formats:
pdf:
enabled: !ENV [MKDOCS_EXPORTER_PDF, true]
concurrency: 8
stylesheets:
- resources/stylesheets/pdf.scss
covers:
front: resources/templates/covers/front.html.j2
back: resources/templates/covers/back.html.j2
aggregator:
enabled: true
output: .well-known/site.pdf
covers: all
Check out a sample PDF generated by this plugin, it includes custom CSS and features cover pages.
- Combine all pages into a single PDF document (✅ released in
v6.0.0
) - Create a GitHub action that includes all dependencies to build the documentation and generate PDF documents
Feel free to request additional features by submitting an issue or contributing through a pull request.
We welcome contributions from the community to enhance MkDocs Exporter.
Whether you want to report a bug, suggest a feature, improve the documentation, or contribute code, your help is appreciated!
This project is licensed under the MIT License (MIT)
, which you can read here.