-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deployed d89d067 with MkDocs version: 1.6.1
- Loading branch information
tanbro
committed
Jan 16, 2025
1 parent
5ef3107
commit fa3f23c
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"index.html","title":"mkdocs-nbconvert","text":"<p>A MkDocs plug-in provides a source parser for <code>*.ipynb</code> Jupyter Notebook files, base on nbconvert.</p>"},{"location":"index.html#references","title":"References","text":"<ul> <li>https://tanbro.github.io/mkdocs-nbconvert/</li> <li>https://www.mkdocs.org/user-guide/plugins/</li> </ul>"},{"location":"index.html#build-the-site","title":"Build the site","text":"<p>The project itself's documentation site is a demo of how to use it.</p> <p>To build and serve the doc-site:</p> <pre><code>pip install -r requirements.txt\nmkdocs serve\n</code></pre> <p>Then open <code>http://127.0.0.1:8000</code> in your browser.</p>"},{"location":"authors.html","title":"AUTHORS","text":"<ul> <li>Liu Xue Yan ([email protected])</li> </ul>"},{"location":"changelog.html","title":"CHANGELOG","text":""},{"location":"changelog.html#v03","title":"v0.3","text":"<p>\ud83d\udcc5 Date 2024-4-7</p> <p>Mark the package's Development Status to 5 - Production/Stable</p>"},{"location":"changelog.html#v022","title":"v0.2.2","text":"<p>\ud83d\udcc5 Date 2024-3-11</p> <p>Update dependencies and tools to latest version.</p>"},{"location":"changelog.html#v021","title":"v0.2.1","text":"<p>Date: 2023-06-29</p> <ul> <li> <p>Release highlights:</p> <ul> <li>Add a new notebook execution configure: <code>exit_on_error</code></li> </ul> </li> <li> <p>Fixing:</p> <ul> <li><code>mkdocs</code> and <code>nbconvert</code> dependent versions in <code>pyproject.toml</code></li> <li>Typos</li> </ul> </li> <li> <p>Docs:</p> <ul> <li>Edit usage notebook</li> </ul> </li> </ul>"},{"location":"changelog.html#v02","title":"v0.2","text":"<p>Date: 2023-06-28</p> <ul> <li> <p>Release highlights:</p> <ul> <li>Now the plugin can execute notebooks before convert</li> </ul> </li> <li> <p>Break changes:</p> <ul> <li>No longer support for python earlier than 3.7</li> <li>Drop <code>setup.cfg</code>, only <code>pyproject.toml</code></li> </ul> </li> <li> <p>Library:</p> <ul> <li>Update to latest mkdocs</li> </ul> </li> <li> <p>Docs</p> <ul> <li>Update to latest mkdocs-material and re-build doc-site</li> </ul> </li> <li> <p>CI</p> <ul> <li>Many pre-commit checks</li> </ul> </li> </ul>"},{"location":"changelog.html#v013","title":"v0.1.3","text":"<p>Date: 2022-04-18</p> <ul> <li>Changes:<ul> <li>Switch to BSD 2-Clause License, and add the license file to repo.</li> <li>Drop supports of old python (<=3.6))</li> <li>Change the package's build system to PEP517</li> </ul> </li> </ul>"},{"location":"changelog.html#v012","title":"v0.1.2","text":"<p>Date: 2020-07-17</p> <ul> <li>New documentation site</li> </ul>"},{"location":"changelog.html#v01","title":"v0.1","text":"<p>Date: 2020-01-16</p> <p>A very early alpha version, not for production.</p>"},{"location":"notebooks/image.html","title":"Images","text":"<pre><code>import requests\n\nfrom IPython.display import display, Image\n</code></pre>"},{"location":"notebooks/image.html#show-image-from-url","title":"Show image from url","text":"<pre><code>base_url = \"https://www.bing.com\"\nimg_url = requests.get(f\"{base_url}/HPImageArchive.aspx?format=js&idx=0&n=1\").json()[\"images\"][0][\"url\"]\nimg_full_url = f\"{base_url}{img_url}\"\nprint(img_full_url)\ndisplay(Image(url=img_full_url, width=320, height=240))\n</code></pre> <pre><code>https://www.bing.com/th?id=OHR.PinnaclesPeaks_ZH-CN1603877182_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp\n</code></pre>"},{"location":"notebooks/image.html#show-image-file","title":"Show image file","text":"<pre><code>display(Image(filename=\"../static/img_01.jpeg\"))\n</code></pre>"},{"location":"notebooks/installation.html","title":"Installation","text":"<p>This MkDocs plugin is based on Jupyter nbconvert.</p> <p>When install the plugin, jupyter and nbconvert will also be installed.</p>"},{"location":"notebooks/installation.html#install-by-pip","title":"Install by pip","text":"<pre><code>pip install mkdocs-nbconvert\n</code></pre>"},{"location":"notebooks/installation.html#install-from-source","title":"Install from source","text":"<pre><code>git clone https://github.com/tanbro/mkdocs-nbconvert.git\ncd mkdocs-nbconvert\npip install .\n</code></pre>"},{"location":"notebooks/matplotlib.html","title":"Matplotlib","text":"<pre><code>import matplotlib.pyplot as plt\nimport numpy as np\n</code></pre>"},{"location":"notebooks/matplotlib.html#simple-plot","title":"Simple Plot","text":"<pre><code>x = np.linspace(0, 2, 100)\n\nplt.plot(x, x, label=\"linear\")\nplt.plot(x, x**2, label=\"quadratic\")\nplt.plot(x, x**3, label=\"cubic\")\n\nplt.xlabel(\"x label\")\nplt.ylabel(\"y label\")\n\nplt.title(\"Simple Plot\")\n\nplt.legend()\n\nplt.show()\n</code></pre>"},{"location":"notebooks/usage.html","title":"Usage","text":""},{"location":"notebooks/usage.html#mkdocs-configuration","title":"mkdocs configuration","text":"<p>Add the <code>nbconvert</code> into configuration file (<code>mkdocs.yml</code>)'s <code>plugins</code> list</p> <pre><code>plugins:\n - nbconvert\n</code></pre>"},{"location":"notebooks/usage.html#options","title":"Options","text":"<ul> <li> <p><code>input_dir</code>: Directory where to scan <code>*.ipynb</code> files</p> <p>Either absolute or relative path. When relative, it's from <code>mkdocs</code> configuration file's directory.</p> <p>When omitted, default value is <code>notebooks</code></p> </li> <li> <p><code>output_dir</code>: Export notebook files to markdown files in the directory.</p> <p>It MUST be a relative path to <code>doc_dir</code></p> <p>When omitted, default value is <code>notebooks</code>.</p> </li> <li> <p><code>recursive</code>: Whether scan <code>*.ipynb</code> files in subdirectories recursively</p> <p>When omitted, default value is <code>True</code></p> </li> <li> <p><code>execute_enabled</code>: Whether executing notebooks before convert. <code>false</code> by default</p> </li> <li> <p><code>execute_options</code>: Options for execution:</p> <ul> <li> <p><code>execute_options.run_path</code>: Specifies in which folder to execute the notebook. The plugin in will take <code>input_dir</code> as the path if not specified.</p> </li> <li> <p><code>execute_options.kernel_name</code>: The execution kernel. When not specified, the default Python kernel is chosen.</p> </li> <li> <p><code>execute_options.timeout</code>: The cell execution timeout. No timeout when not specified.</p> </li> <li> <p><code>execute_options.write_back</code>: Whether save executed result to the notebook file. <code>false</code> by default.</p> </li> <li> <p><code>exit_on_error</code>: Whether exit when an error occurred. Default is <code>true</code>.</p> </li> </ul> </li> </ul> <p>Options can be add to configuration file as below:</p> <pre><code>plugins:\n - nbconvert:\n input_dir: notebooks\n recursive: true\n output_dir: notebooks\n execute_enabled: true\n execute_options:\n write_back: true\n</code></pre> <p>In the above example, the plugin recursively searches Jupyter notebook files in <code>{{project_dir}}\\notebooks</code>, then converts them to markdown files to <code>{{project_dir}}\\docs\\notebooks</code>, where <code>{{project_dir}}\\docs</code> is the default value of <code>doc_dir</code> configure. A pre-execution will be performed, and the running result will be saved to original notebook files.</p>"},{"location":"notebooks/usage.html#nav","title":"Nav","text":"<p>In <code>nav</code> section, add <code>*.ipynb</code> files as normal markdown files with replacing extension <code>*.ipynb</code> to <code>*.md</code>, since they're converted to markdown files in <code>output_dir</code>:</p> <pre><code>nav:\n - index.md\n - Notebooks:\n - notebooks/installation.md\n - notebooks/usage.md\n - notebooks/image.md\n - notebooks/matplotlib.md\n - authors.md\n - changelog.md\n</code></pre> <p>Warning:</p> <p>converted <code>notebooks/*.md</code> files will be removed at the end of building.</p>"}]} | ||
{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"index.html","title":"mkdocs-nbconvert","text":"<p>A MkDocs plug-in provides a source parser for <code>*.ipynb</code> Jupyter Notebook files, base on nbconvert.</p>"},{"location":"index.html#references","title":"References","text":"<ul> <li>https://tanbro.github.io/mkdocs-nbconvert/</li> <li>https://www.mkdocs.org/user-guide/plugins/</li> </ul>"},{"location":"index.html#build-the-site","title":"Build the site","text":"<p>The project itself's documentation site is a demo of how to use it.</p> <p>To build and serve the doc-site:</p> <pre><code>pip install -r requirements.txt\nmkdocs serve\n</code></pre> <p>Then open <code>http://127.0.0.1:8000</code> in your browser.</p>"},{"location":"authors.html","title":"AUTHORS","text":"<ul> <li>Liu Xue Yan ([email protected])</li> </ul>"},{"location":"changelog.html","title":"CHANGELOG","text":""},{"location":"changelog.html#v031","title":"v0.3.1","text":"<p>\ud83d\udcc5 Date 2025-1-16</p> <ul> <li> <p>\ud83d\udd27 Upgrade:</p> <ul> <li><code>mkdocs</code> to 1.6.1</li> <li><code>nbconvert</code> to 7.16.5</li> <li>hooks in pre-commit</li> </ul> </li> <li> <p>\ud83d\udd28: Remove unused packages in <code>requirements.txt</code> and <code>pyproject.toml</code></p> </li> </ul>"},{"location":"changelog.html#v03","title":"v0.3","text":"<p>\ud83d\udcc5 Date 2024-4-7</p> <p>Mark the package's Development Status to 5 - Production/Stable</p>"},{"location":"changelog.html#v022","title":"v0.2.2","text":"<p>\ud83d\udcc5 Date 2024-3-11</p> <p>Update dependencies and tools to latest version.</p>"},{"location":"changelog.html#v021","title":"v0.2.1","text":"<p>Date: 2023-06-29</p> <ul> <li> <p>Release highlights:</p> <ul> <li>Add a new notebook execution configure: <code>exit_on_error</code></li> </ul> </li> <li> <p>Fixing:</p> <ul> <li><code>mkdocs</code> and <code>nbconvert</code> dependent versions in <code>pyproject.toml</code></li> <li>Typos</li> </ul> </li> <li> <p>Docs:</p> <ul> <li>Edit usage notebook</li> </ul> </li> </ul>"},{"location":"changelog.html#v02","title":"v0.2","text":"<p>Date: 2023-06-28</p> <ul> <li> <p>Release highlights:</p> <ul> <li>Now the plugin can execute notebooks before convert</li> </ul> </li> <li> <p>Break changes:</p> <ul> <li>No longer support for python earlier than 3.7</li> <li>Drop <code>setup.cfg</code>, only <code>pyproject.toml</code></li> </ul> </li> <li> <p>Library:</p> <ul> <li>Update to latest mkdocs</li> </ul> </li> <li> <p>Docs</p> <ul> <li>Update to latest mkdocs-material and re-build doc-site</li> </ul> </li> <li> <p>CI</p> <ul> <li>Many pre-commit checks</li> </ul> </li> </ul>"},{"location":"changelog.html#v013","title":"v0.1.3","text":"<p>Date: 2022-04-18</p> <ul> <li>Changes:<ul> <li>Switch to BSD 2-Clause License, and add the license file to repo.</li> <li>Drop supports of old python (<=3.6))</li> <li>Change the package's build system to PEP517</li> </ul> </li> </ul>"},{"location":"changelog.html#v012","title":"v0.1.2","text":"<p>Date: 2020-07-17</p> <ul> <li>New documentation site</li> </ul>"},{"location":"changelog.html#v01","title":"v0.1","text":"<p>Date: 2020-01-16</p> <p>A very early alpha version, not for production.</p>"},{"location":"notebooks/image.html","title":"Images","text":"<pre><code>import requests\n\nfrom IPython.display import display, Image\n</code></pre>"},{"location":"notebooks/image.html#show-image-from-url","title":"Show image from url","text":"<pre><code>base_url = \"https://www.bing.com\"\nimg_url = requests.get(f\"{base_url}/HPImageArchive.aspx?format=js&idx=0&n=1\").json()[\"images\"][0][\"url\"]\nimg_full_url = f\"{base_url}{img_url}\"\nprint(img_full_url)\ndisplay(Image(url=img_full_url, width=320, height=240))\n</code></pre> <pre><code>https://www.bing.com/th?id=OHR.PinnaclesPeaks_ZH-CN1603877182_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp\n</code></pre>"},{"location":"notebooks/image.html#show-image-file","title":"Show image file","text":"<pre><code>display(Image(filename=\"../static/img_01.jpeg\"))\n</code></pre>"},{"location":"notebooks/installation.html","title":"Installation","text":"<p>This MkDocs plugin is based on Jupyter nbconvert.</p> <p>When install the plugin, jupyter and nbconvert will also be installed.</p>"},{"location":"notebooks/installation.html#install-by-pip","title":"Install by pip","text":"<pre><code>pip install mkdocs-nbconvert\n</code></pre>"},{"location":"notebooks/installation.html#install-from-source","title":"Install from source","text":"<pre><code>git clone https://github.com/tanbro/mkdocs-nbconvert.git\ncd mkdocs-nbconvert\npip install .\n</code></pre>"},{"location":"notebooks/matplotlib.html","title":"Matplotlib","text":"<pre><code>import matplotlib.pyplot as plt\nimport numpy as np\n</code></pre>"},{"location":"notebooks/matplotlib.html#simple-plot","title":"Simple Plot","text":"<pre><code>x = np.linspace(0, 2, 100)\n\nplt.plot(x, x, label=\"linear\")\nplt.plot(x, x**2, label=\"quadratic\")\nplt.plot(x, x**3, label=\"cubic\")\n\nplt.xlabel(\"x label\")\nplt.ylabel(\"y label\")\n\nplt.title(\"Simple Plot\")\n\nplt.legend()\n\nplt.show()\n</code></pre>"},{"location":"notebooks/usage.html","title":"Usage","text":""},{"location":"notebooks/usage.html#mkdocs-configuration","title":"mkdocs configuration","text":"<p>Add the <code>nbconvert</code> into configuration file (<code>mkdocs.yml</code>)'s <code>plugins</code> list</p> <pre><code>plugins:\n - nbconvert\n</code></pre>"},{"location":"notebooks/usage.html#options","title":"Options","text":"<ul> <li> <p><code>input_dir</code>: Directory where to scan <code>*.ipynb</code> files</p> <p>Either absolute or relative path. When relative, it's from <code>mkdocs</code> configuration file's directory.</p> <p>When omitted, default value is <code>notebooks</code></p> </li> <li> <p><code>output_dir</code>: Export notebook files to markdown files in the directory.</p> <p>It MUST be a relative path to <code>doc_dir</code></p> <p>When omitted, default value is <code>notebooks</code>.</p> </li> <li> <p><code>recursive</code>: Whether scan <code>*.ipynb</code> files in subdirectories recursively</p> <p>When omitted, default value is <code>True</code></p> </li> <li> <p><code>execute_enabled</code>: Whether executing notebooks before convert. <code>false</code> by default</p> </li> <li> <p><code>execute_options</code>: Options for execution:</p> <ul> <li> <p><code>execute_options.run_path</code>: Specifies in which folder to execute the notebook. The plugin in will take <code>input_dir</code> as the path if not specified.</p> </li> <li> <p><code>execute_options.kernel_name</code>: The execution kernel. When not specified, the default Python kernel is chosen.</p> </li> <li> <p><code>execute_options.timeout</code>: The cell execution timeout. No timeout when not specified.</p> </li> <li> <p><code>execute_options.write_back</code>: Whether save executed result to the notebook file. <code>false</code> by default.</p> </li> <li> <p><code>exit_on_error</code>: Whether exit when an error occurred. Default is <code>true</code>.</p> </li> </ul> </li> </ul> <p>Options can be add to configuration file as below:</p> <pre><code>plugins:\n - nbconvert:\n input_dir: notebooks\n recursive: true\n output_dir: notebooks\n execute_enabled: true\n execute_options:\n write_back: true\n</code></pre> <p>In the above example, the plugin recursively searches Jupyter notebook files in <code>{{project_dir}}\\notebooks</code>, then converts them to markdown files to <code>{{project_dir}}\\docs\\notebooks</code>, where <code>{{project_dir}}\\docs</code> is the default value of <code>doc_dir</code> configure. A pre-execution will be performed, and the running result will be saved to original notebook files.</p>"},{"location":"notebooks/usage.html#nav","title":"Nav","text":"<p>In <code>nav</code> section, add <code>*.ipynb</code> files as normal markdown files with replacing extension <code>*.ipynb</code> to <code>*.md</code>, since they're converted to markdown files in <code>output_dir</code>:</p> <pre><code>nav:\n - index.md\n - Notebooks:\n - notebooks/installation.md\n - notebooks/usage.md\n - notebooks/image.md\n - notebooks/matplotlib.md\n - authors.md\n - changelog.md\n</code></pre> <p>Warning:</p> <p>converted <code>notebooks/*.md</code> files will be removed at the end of building.</p>"}]} |