Skip to main content

Plugin for mkdocs to generate markdown documents from jupyter notebooks.

Project description

mknotebooks

mknotebooks is a plugin for MkDocs, which makes it more convenient to include Jupyter notebooks in your project documentation.

Install

pip install mknotebooks

Usage

Simply include any notebooks you want to use in the docs source directory, and add mknotebooks to the plugin section of your mkdocs.yml.

You can optionally execute the notebooks, by setting execute: true in the config, and include a hidden preamble script, to be run before executing any cells using preamble: "<path/to/your/script>". The default cell execution timeout can be overridden by setting timeout: <timeout>, where <timeout> is an integer number of seconds. By default, execution will be aborted if any of the cells throws an error, but you can set allow_errors: true to continue execution and include the error message in the cell output.

Any static images, plots, etc. will be extracted from the notebook and placed alongside the output HTML.

Mknotebooks applies default styling to improve the appearance of notebook input/output cells and pandas dataframes. If these interfere with any other CSS stylesheets that you're using, you can disable these via the following options.

- mknotebooks:
   enable_default_jupyter_cell_styling: false
   enable_default_pandas_dataframe_styling: false

Example

An example docs project demonstrating the above is included. Try it out by running pipenv install && pipenv run mkdocs serve.

Inspecting generated markdown

You can also export the generated markdown by setting write_markdown: true in your mkdocs.yml. This will write the generated markdown to a .md.tmp file alongside the original notebook.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mknotebooks-0.3.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file mknotebooks-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: mknotebooks-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for mknotebooks-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5722a5e2e1522f67827d8bacebcaa621fa788521c14c61074d1b5aa47ffebbd
MD5 91df21d1131c9368a2ae518b06db07b6
BLAKE2b-256 2fc478513f3bcbc05f12c321c5d0268e363ea4000c47f43661010d10dbdc7eb8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page