Skip to content

Export to HTML

After enabling the print-site plugin in your mkdocs.yml, you will have your entire site combined into a single page. That allows you to create a standalone HTML page: a single self-contained file that has all images, styling and scripts embedded. This means you could send a site as an email attachment, a use case common within companies where deploying static sites might be more involved.

In order to create a self-contained, standalone HTML file from the print page, we will need to embed images, CSS and javascript using data URLs. We can do this quite easily using the htmlark python package:

pip install http html5lib requests
pip install htmlark

To create the export:

mkdocs build
htmlark site/print_page.html -o standalone.html