Skip to main content

Export docs

Description: Export documents to a single file. It makes use of a template so the format can be whatever you want (JSON, CSV, One big HTML file, what-ever).

Dependencies

mkdocs > 1.1

Configuration

Configuration options: export_filename: Name of the exported file. Defaults to docs.json export_folder: Folder to save export into. Defaults the global site_dir setting (works with mkdocs serve as well) export_template: Path to the file which contains the template for the export page. It is None by default, which means that the package-provided template is used. It can be an absolute path, or relative to the folder in which mkdocs is run.

Add configuration to mkdocs.yml

plugins:
  - mkdocsexport:
    export_filename = "filename.ext"
    export_folder = "path/to/folder"
    export_template = "path/to/template"

Usage

Install this plugin (it will also install mkdocs if required)

pip install mkdocsexport

or

pip install git+https://github.com/philips-labs/MkdocsExportPlugin.git

Customization

The layout of the exported page is a jinja2 template file. The package provides such a template by default, with the following content:

[
    {% for page in pages %}
    {
        "title": "{{page.title}}",
        "file": "{{page.file.name}}",
        "content":"{{page.content|escape}}"
    }{%if loop.nextitem %},{%endif%}
    {% endfor %}
]

You can also provide your own template. The page object contains all the metadata in a mkdocs page, and in addition a .filename attribute, which contains the file name of the source of the page (relative to the docs folder), which can be used to link to that page.

Metadata

Release files for mkdocsexport 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mkdocsexport 1.0.1
File Size Uploaded
mkdocsexport-1.0.1.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mkdocsexport 1.0.1
File Interpreter ABI Platform
mkdocsexport-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.5 kB

Release files / mkdocsexport-1.0.1.tar.gz

Download URL mkdocsexport-1.0.1.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
270bd0e28ecfa3fb4f9f75d30c5952b20882492e70198ca7fea241e9f8e499e7
BLAKE2b-256 checksum
How to use checksums
0e517062922494d3ef13a6e2fb0d96f72009b876231b21aa91f3de818884ddcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

Release files / mkdocsexport-1.0.1-py3-none-any.whl

Download URL mkdocsexport-1.0.1-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b3c9dfff30eab3094a76a207a1f54cf48e4fe41ed1f54d9b8d5a57c8250617c
BLAKE2b-256 checksum
How to use checksums
2e6cdb7a058516bd05a3a0a0815e161a704522ff21b8b0da235d4c1f89ac13db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page