{"id":21580,"library":"mkdocs-with-pdf","title":"MkDocs with PDF","description":"A MkDocs plugin that generates a single PDF file from your MkDocs documentation repository. Version 0.9.3 is the latest stable release (requires Python >=3.6). The project is actively maintained, with periodic releases fixing bugs and adding features.","status":"active","version":"0.9.3","language":"python","source_language":"en","source_url":"https://github.com/orzih/mkdocs-with-pdf","tags":["mkdocs","pdf","documentation","plugin"],"install":[{"cmd":"pip install mkdocs-with-pdf","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required to build documentation and serve as the plugin base.","package":"mkdocs","optional":false},{"reason":"Used to render the PDF; must be installed separately on some systems.","package":"weasyprint","optional":false}],"imports":[{"note":"","wrong":null,"symbol":"MkdocsWithPdfPlugin","correct":"from mkdocs_with_pdf import MkdocsWithPdfPlugin"}],"quickstart":{"code":"# Ensure mkdocs.yml has the plugin enabled:\n# plugins:\n#   - with-pdf\n\n# Then build your docs:\nmkdocs build","lang":"python","description":"Enable the plugin in your mkdocs.yml and build the site to generate a PDF."},"warnings":[{"fix":"Follow the WeasyPrint installation docs: https://doc.courtbouillon.org/weasyprint/stable/first_steps.html","message":"WeasyPrint requires external system dependencies (e.g., cairo, Pango). Install them according to your OS or the PDF generation will fail silently.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade Python to 3.6+ or pin version to 0.8.3.","message":"Python 3.5 support was dropped in v0.9.0. If you use Python 3.5, stick with v0.8.3.","severity":"breaking","affected_versions":">=0.9.0"},{"fix":"Set theme.features.tabs to false or switch to a different theme.","message":"The plugin does not work with the 'material' theme's navigation tabs when 'tabs' is set to true. You may need a custom theme or workaround.","severity":"gotcha","affected_versions":"all"},{"fix":"Update your mkdocs.yml to use the new exclude_pages pattern (e.g., '*/api/*').","message":"The 'exclude_pages' option changed its behavior in v0.9.0. Previously it excluded pages by relative path, now it uses a pattern or regex.","severity":"deprecated","affected_versions":">=0.9.0"},{"fix":"Upgrade to v0.9.3 or ensure page titles include letters.","message":"If your page titles contain numbers only (e.g., '404'), the plugin may crash. This was fixed in v0.9.3.","severity":"gotcha","affected_versions":"<0.9.3"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install cairo: on Ubuntu: sudo apt-get install libcairo2-dev; on macOS: brew install cairo; on Windows: use GTK+ installer.","cause":"Missing system dependency for WeasyPrint.","error":"OSError: cannot load library 'libcairo.so.2'"},{"fix":"Run 'pip install mkdocs-with-pdf' to install the plugin.","cause":"The package is not installed or not in the current environment.","error":"ModuleNotFoundError: No module named 'mkdocs_with_pdf'"},{"fix":"Upgrade to v0.9.3 and ensure 'exclude_pages' uses the new pattern format (list of globs or regexes).","cause":"Occurs when the 'exclude_pages' option is misconfigured (e.g., using old syntax).","error":"AttributeError: 'NoneType' object has no attribute 'name'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}