Plugin for mkdocs to generate markdown documents from jupyter notebooks.
Slowing down. Last release over 3 years ago, little activity since. Fine for existing code; think twice for a new project.
Consider insteadmkdocs-jupyterPythie’s Index: 70361.3K downloads/moCompare →
pip install mknotebooks
mknotebooks
mknotebooks is a plugin for MkDocs enabling you to include Jupyter notebooks directly in your project documentation.
Install
pip3 install mknotebooks
Usage
- Add
mknotebooksto the plugin section of yourmkdocs.yml - Include any notebooks (
.ipynbfiles) you want to use in thedocs/directory just as you would.mdfiles.
Example:
# mkdocs.yml
nav:
- your_notebook.ipynb
plugins:
- mknotebooks
Any static images, plots, etc. will be extracted from the notebook and placed alongside the output HTML.
Options
You can optionally execute the notebooks, by setting execute: true in the config. You can 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.
Example:
# mkdocs.yml
plugins:
- mknotebooks
execute: false
timeout: 100
preamble: "<path/to/your/script>"
allow_errors: false
Styling
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.
# mkdocs.yml
- mknotebooks:
enable_default_jupyter_cell_styling: false
enable_default_pandas_dataframe_styling: false