mkdocs-nbsync
🔄 Stop fighting with notebook documentation!
The Problem: Screenshots break. Exports get forgotten. Code and docs drift apart. 😩
The Solution: One simple syntax that keeps everything in sync:
{#figure-name}
That's it! No more manual exports. No more broken documentation. 🎉
mkdocs-nbsync is a MkDocs plugin that seamlessly embeds Jupyter notebook visualizations in your documentation, solving the disconnect between code development and documentation.
Why Use mkdocs-nbsync?
The Documentation Challenge
Data scientists, researchers, and technical writers face a common dilemma:
- Development happens in notebooks - ideal for experimentation and visualization
- Documentation lives in markdown - perfect for narrative and explanation
- Connecting the two is painful - screenshots break, exports get outdated
Our Solution
This plugin creates a live bridge between your notebooks and documentation by:
- Keeping environments separate - work in the tool best suited for each task
- Maintaining connections - reference specific figures from notebooks
- Automating updates - changes to notebooks reflect in documentation
Key Benefits
-
True Separation of Concerns: Develop visualizations in Jupyter notebooks and write documentation in markdown files, with each tool optimized for its purpose.
-
Intuitive Markdown Syntax: Use standard image syntax with a simple extension to reference notebook figures:
{#figure-id} -
Automatic Updates: When you modify your notebooks, your documentation updates automatically in MkDocs serve mode.
-
Clean Source Documents: Your markdown remains readable and focused on content, without code distractions or complex embedding techniques.
-
Enhanced Development Experience: Take advantage of IDE features like code completion and syntax highlighting in the appropriate environment.
Quick Start
1. Installation
pip install mkdocs-nbsync
2. Configuration
Add to your mkdocs.yml:
plugins:
- mkdocs-nbsync:
src_dir: ../notebooks
3. Mark Figures in Your Notebook
In your Jupyter notebook, identify figures with a comment:
# #my-figure
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(8, 4))
ax.plot([1, 2, 3, 4], [10, 20, 25, 30])
4. Reference in Markdown
Use standard Markdown image syntax with the figure identifier:
{#my-figure}
The Power of Separation
Creating documentation and developing visualizations involve different workflows and timeframes. When building visualizations in Jupyter notebooks, you need rapid cycles of execution, verification, and modification.
This plugin is designed specifically to address these separation of concerns, allowing you to:
- Focus on code in notebooks without documentation distractions
- Focus on narrative in markdown without code interruptions
- Maintain powerful connections between both environments
Each environment is optimized for its purpose, while the plugin handles the integration automatically.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
This project is licensed under the MIT License.
Metadata
Release files for mkdocs-nbsync 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mkdocs_nbsync-0.2.2.tar.gz | 5.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mkdocs_nbsync-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.1 kB
Release files / mkdocs_nbsync-0.2.2.tar.gz
| Download URL | mkdocs_nbsync-0.2.2.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
18e1d1ddb3621ec7dc240b68ac43d15c74be8c6395bcaf1b083ee367ce7b1a45
|
|
BLAKE2b-256 checksum How to use checksums |
25e2b73954224a26871db7fb6c910092d970816b4fc3cca251151c9d31e25630
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.7
|
Release files / mkdocs_nbsync-0.2.2-py3-none-any.whl
| Download URL | mkdocs_nbsync-0.2.2-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47d23476a9178b0296d570ae13c8c1c2d00690c7ea8823244fe3e5c265fb07ac
|
|
BLAKE2b-256 checksum How to use checksums |
b354b287a826aa5d33e39b936177fd02fcac1dbf060124adf6f4fc6853a6b5da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.7
|
Security for mkdocs-nbsync 0.2.2
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.