From 5dd5c90c9ee926d78d884786fd9fd5dffa9e22dd Mon Sep 17 00:00:00 2001 From: Tim Vink Date: Thu, 23 May 2024 23:06:00 +0200 Subject: [PATCH] Update export-HTML.md guide --- docs/how-to/export-HTML.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/how-to/export-HTML.md b/docs/how-to/export-HTML.md index ea2331c..9ddbce9 100644 --- a/docs/how-to/export-HTML.md +++ b/docs/how-to/export-HTML.md @@ -1,20 +1,20 @@ # 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. +After enabling the `print-site` plugin in your `mkdocs.yml`, you will have your entire site combined into a single page. -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](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs). We can do this quite easily using the [htmlark](https://github.com/BitLooter/htmlark) python package: +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. +This works because all the resources the page uses, such images, stylesheets (CSS) and interactive elements (javascript) are embedded into in a single HTML file using [data URLs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs). +You can create a .html file export using your internet browser (f.e. save as > webpage, single page). You can also do this programmatically, for example using the [htmlark](https://github.com/BitLooter/htmlark) python package: ```shell -pip install http html5lib requests -pip install htmlark +pip install htmlark[http,parsers] ``` To create the export: ```shell mkdocs build - cd site/ # when mkdocs.yml has use_directory_urls: true (the default)