Package: mkdocs-jupyter
mkdocs-jupyter: Use Jupyter Notebooks in mkdocsDocs demo SiteAdd Jupyter Notebooks directly to the mkdocs navigationSupport for multiple formats:.ipynband.pyfiles (usingjupytext)Same style as regular Jupyter NotebooksSupport Jupyter ThemesOption to execute the notebook before convertingSupport foripywidgetsSupport for mkdocs TOCOption to include notebook sourceInstallationpipinstallmkdocs-jupyterConfigurationIn themkdocs.ymluse Jupyter notebooks (.ipynb) or Python scripts (.py)
as pages:nav:-Home:index.md-Notebook page:notebook.ipynb-Python file:python_script.pyplugins:-mkdocs-jupyterTitles and Table of ContentsThe first h1 header (#) in your notebook will be used as the title.# This H1 header will be the the title.This can be turned off in the configuration (in which case the filename will be
used as title):plugins:-mkdocs-jupyter:ignore_h1_titles:TrueIn order to see the table of contents you need to maintain a hierarchical
headers structure in your notebooks. You must use h2 headers (##) and not h1
(#)## This H2 title will show in the table of contentsIf you want tonest headersin the TOC you need to add additional levels
later in the same markdown cell or new bottom markdown cells:## This header will show as top level in the table of contents<content>### This one will be displayed inside the above levelIncluding or Ignoring FilesYou can control which files are included or ignored via lists of glob patterns:plugins:-mkdocs-jupyter:include:["*.ipynb"]# Default: ["*.py", "*.ipynb"]ignore:["some-irrelevant-files/*.ipynb"]Execute NotebookYou can tell the plugin to execute the notebook before converting, default isFalse:plugins:-mkdocs-jupyter:execute:trueYou can tell the plugin to ignore the execution of some files (with glob
matching):plugins:-mkdocs-jupyter:execute_ignore:-"my-secret-files/*.ipynb"To fail when notebook execution fails setallow_errorstofalse:plugins:-mkdocs-jupyter:execute:trueallow_errors:falseKernelBy default the plugin will use the kernel specified in the notebook to execute
it. You can specify a custom kernel name to use for all the notebooks:plugins:-mkdocs-jupyter:kernel_name:python3Ingore Code InputBy default the plugin will show full code and regular cell output details. You
can hide cell code input for all the notebooks:plugins:-mkdocs-jupyter:show_input:FalseYou can also decide to hide theOut[#]output notation and other cell metadata
for all the notebooks:plugins:-mkdocs-jupyter:no_input:TrueRemove Cell Using TagsBy default the plugin will show full code and regular cell output details. You
can hide cell code input for specific cells using tags:plugins:-mkdocs-jupyter:remove_tag_config:remove_input_tags:-hide_codeMore detailed on removing cell based on tag, seeNbConvert
Customization)Jupyter themesYou can configure the different Jupyter themes. For example if using material
withslatecolor scheme you can use the Jupyter Labdarktheme:plugins:
    - mkdocs-jupyter:
          theme: dark

theme:
    name: material
    palette:
        scheme: slateExtra CSS classesThis option will add a custom CSS class to thedivcontainer that highlights
the code cells. This can be useful to add custom styles to the code cells.plugins:
  - mkdocs-jupyter:
      highlight_extra_classes: "custom-css-classesRequireJSBy default RequireJS is not loaded. This is required for Plotly.
You can enable it with:plugins:
    - mkdocs-jupyter:
          include_requirejs: trueDownload notebook linkYou can tell the plugin to include the notebook source to make it easy to show a
download button in the theme, default isFalse:plugins:
    - mkdocs-jupyter:
          include_source: TrueThis setting will also create apage.nb_urlvalue that you can use in your
theme to make a link in each page.For example inmkdocs-material(seecustomization),
you can create amain.htmlfile like this:{%extends"base.html"%}{%blockcontent%}{%ifpage.nb_url%}<a href="{{page.nb_url}}" title="Download Notebook" class="md-content__button md-icon">{%include".icons/material/download.svg"%}</a>{%endif%}{{super()}}{%endblockcontent%}StylesThis extensions includes the Jupyter Lab nbconvert CSS styles and does some
modifications to make it as generic as possible in order for it to work with a
variety of mkdocs themes. This is not always possible and the theme we test the
most ismkdocs-material.It's possible you might need to do some CSS changes to make it look as good as
you want, for example for the material theme take a look at theircustomization
docs.Create amain.htmlfile like:{%extends"base.html"%}{%blockcontent%}{{super()}}<style>// Do whatever changes you need here.jp-RenderedHTMLCommon p {color: red}</style>{%endblockcontent%}Mkdocs Material notesAny markdown specific features such asadmonitionswon't work with mkdocs-jupyter because those features are not supported by
Jupyter itself and we usenbconvertto make
the conversion.To use this type of features you have to define the HTML directly in the
markdown cells:<divclass="admonition note"><pclass="admonition-title">Note</p><p>If two distributions are similar, then their entropies are similar,
        implies the KL divergence with respect to two distributions will be
        smaller...</p></div>