Skip to main content

biblio-config: true labels: abstract: Abstract affiliations: Affiliations authors: Authors description: Description doi: Doi keywords: Keywords modified: Modified published: Published related_formats: Other Formats toc-title: Table of contents

Pypi version Pypi Downloads Github Activity Python versions GitHub Actions License

mkquartodocs

Example

Make gorgeous reproducible documentation with quarto and mkdocs

It is a plugin for mkdocs that renders quarto markdown documents into github, so they are built with the rest of the documentation.

Why?

In many instances the documentation contains runnable code, and it makes sense that you verify that the code runs and keep the output of the code in sync with the current status of the document and software packages involved.

But mainly I really got tired of manually rendering documents and copying outpus.

Usage

  1. Install the dependencies: Installation
  2. Add the plugin to your configuration: Configuration
  3. Add .qmd files to your ./docs/ directoy
  4. Run mkdocs build

This will render code chunks and save the outputs! Check out https://quarto.org/ for more examples on how to use the format.

This ....

```{python}
print(1+2)
```

Will become this ...

:::: {.cell execution_count="1"}

print(1+2)

::: {.cell-output .cell-output-stdout} 3 ::: ::::

Installation

  1. Make sure you have quarto installed in your computer.

  2. Install mkquartodocs

pip install mkquartodocs

Configuration

Add mkquartodocs to your plugins in your mkdocs.yml

# Whatever is in your mkdocs.yml configuration file....
# ...

plugins:
  - mkquartodocs

Available configuration options:

  • quarto_path: Specifies where to look for the quarto executable.
  • keep_output: If true it will skip the cleanup step in the directory.
  • ignore_pattern: a python regular expressions that if matched will mark the file to not be rendered. Note that they need to be full matches
  • force_rebuild: If true it will force a rebuild of the quarto documents (instead of trying to skip the document if the .md already exists)
# Whatever is in your mkdocs.yml configuration file....
# ...

plugins:
  - mkquartodocs:
      quarto_path: /home/my_folder/some/weird/place/to/have/executables/quarto
      keep_output: true
      ignore: (.*broken.*.qmd)|(.*page[0-9].qmd)

# mkquartodocs will try to render every quarto document in the
# docs directory, you can specify the page names using either the .qmd
# or the .md extension

nav:
  - Home: README.md
  - Examples:
    - 'Simple python execution': 'examples/example.qmd'
    - 'Simple dataframe execution': 'examples/dataframe_example.qmd'
    - 'Simple mermaid execution': 'examples/mermaid_example.qmd'
    - 'Simple matplotlib execution': 'examples/matplotlib_example.qmd'


# These are also required depending on what features you want enabled.
theme:
  name: material

markdown_extensions:
  - pymdownx.highlight:
      anchor_linenums: true
  - pymdownx.superfences

Running

NOTHING !!! you do not have to run it manually!!

When you call mkdocs build, it should automatically find your .qmd files, render them, generate the output and clean after itself.

TODO

The things that need to/could be added to the project:

  • quarto project support
  • render in temporary directory, posibly with a 'safe' argument
  • addition of files not in the docs directory, 'include' argument
  • add readme to testing data
  • move INFO - mkquartodocs: Running RemoveCellDataPreprocessor to debug log

Metadata

Release files for mkquartodocs 0.7.0

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

Source distribution (sdist)

Source distribution for mkquartodocs 0.7.0
File Size Uploaded Provenance Actions
mkquartodocs-0.7.0.tar.gz 1.1 MB Without provenance Details for mkquartodocs-0.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.1 MB

Release files / mkquartodocs-0.7.0.tar.gz

Download URL mkquartodocs-0.7.0.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
d995c0cdfecb14ef24334d50d183cbe5b557f6fd85c1c8ad17015e1c4da6be80
BLAKE2b-256 checksum
How to use checksums
c8d0f4542440a909a2928c374e93c9ab3a0df0ddd80291318268ac9a57c4ccbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / mkquartodocs-0.7.0-py3-none-any.whl

Download URL mkquartodocs-0.7.0-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e39692c0d5d2086afe8993a11684a5bc929823bf1ab4d95a06e9f4de741125b
BLAKE2b-256 checksum
How to use checksums
b76c28d24754beed3112856a9ba2ebe098915495e796e8ef073d4e77952ab7ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Security for mkquartodocs 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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