A companion tool for mkdocs-material that converts Jupyter notebooks into blog posts
Project description
mkprof
A companion tool for mkdocs-material for building and running a blog that natively supports Jupyter notebooks as articles.
If you think of of mkdocs as something like a table saw, then mkprof is a table saw jig, like a cross-cut sled. It is a doohicky you add to a general purpose tool that makes a specific set of operations safer, more repeatable, and faster.
Why is it called mkprof? Well, professors mentor doctoral candidates, and if mkdocs makes docs, then... look, naming things is hard and I was tired.
What it does
- Converts
.ipynbnotebooks in your posts directory to mkdocs-compatible Markdown, extracting figures, handling asset paths, and adding a notebook download link - Provides an interactive TUI that prompts for any missing blog frontmatter (title, date, description, tags, authors) with content-aware pre-filling
- Lints and auto-formats Markdown posts (mdformat, spell check, MathJax compatibility checks)
- Skips conversion when the generated
.mdis already newer than its source notebook mkprof initscaffolds a complete, opinionated site:hooks.pywith nav injection and recent-posts support, MathJax, dark/light palette toggle, tags, Blog section open by default in the sidebar (via a small script that sets Material's accordion checkbox, notnavigation.expand), and a CSS file with stubs for figures, photographs, tables, DataFrames, code blocks, and the recent-posts admonition — structural rules with color placeholders so you start with a working layout and make your own color decisions
mkprof is a pre-processor: it runs before mkdocs build, transforming
notebooks into Markdown that mkdocs-material already knows how to handle.
Requirements
- Python 3.11+
- mkdocs-material with the
built-in
blogplugin enabled
Installation
pip install mkprof
Quick start
Fresh site
mkprof init mysite
cd mysite
mkprof serve
mkprof init scaffolds a ready-to-use mkdocs-material site with the blog
plugin and mkprof pre-configured. Drop .ipynb notebooks into
docs/blog/posts/ and run mkprof to convert and build.
Existing mkdocs-material site
pip install mkprof
# run from your site root (the directory containing mkdocs.yml)
mkprof
mkprof reads your existing mkdocs.yml to locate docs_dir and your blog
posts directory. No extra config file is required for a standard layout.
For non-standard layouts or per-site overrides, add an extra.mkprof section
to your mkdocs.yml:
extra:
mkprof:
posts_dir: docs/content/posts # default: derived from blog plugin config
drafts_dir: _drafts # default: drafts
default_author: yourslug # default: inferred from authors.yml
Commands
mkprof TUI: convert notebooks + prompt to build or serve
mkprof serve TUI: convert notebooks + start mkdocs dev server
mkprof build TUI: convert notebooks + run mkdocs build
mkprof convert headless: convert notebooks only (CI-safe, no prompts)
mkprof init [DIR] scaffold a new site (default: current directory)
mkprof, mkprof serve, and mkprof build launch a Textual TUI that
prompts interactively for any missing blog frontmatter and lets you move
incomplete posts to drafts.
mkprof convert is non-interactive: it logs to stdout, skips notebooks
that are missing metadata without prompting, and exits non-zero on
conversion errors. Use it in CI:
- run: mkprof convert && mkdocs build
How it fits with mkdocs
mkprof is intentionally not a mkdocs plugin. It runs as a separate step
before mkdocs build, generating standard Markdown that mkdocs-material
handles natively. This keeps the conversion logic decoupled from mkdocs
internals and makes it straightforward to adapt when
Zensical matures.
License
MIT
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkprof-0.1.2.tar.gz.
File metadata
- Download URL: mkprof-0.1.2.tar.gz
- Upload date:
- Size: 297.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17363a164749d8b46d4d6d77947da82d42dfb000591860c09d1a8494a4e56d66
|
|
| MD5 |
b18184ab03dea20a7fa445fa76cd2166
|
|
| BLAKE2b-256 |
0dfc66f76f8dbfd2c518cf81b39fcdf2a295ef2c34bb91fd5c482b1a646f22a7
|
Provenance
The following attestation bundles were made for mkprof-0.1.2.tar.gz:
Publisher:
publish.yml on ryneches/mkprof
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkprof-0.1.2.tar.gz -
Subject digest:
17363a164749d8b46d4d6d77947da82d42dfb000591860c09d1a8494a4e56d66 - Sigstore transparency entry: 1642031054
- Sigstore integration time:
-
Permalink:
ryneches/mkprof@1f5bb98ca2aa72c831c8fcbc5981370e68118ff8 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/ryneches
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1f5bb98ca2aa72c831c8fcbc5981370e68118ff8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mkprof-0.1.2-py3-none-any.whl.
File metadata
- Download URL: mkprof-0.1.2-py3-none-any.whl
- Upload date:
- Size: 41.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0c0db1ef282532d3ceddf5bbe09c668c7f1f230ac60d2618599ea023fcf2db6
|
|
| MD5 |
6f1c774fa4b78fc3686c597625f2f352
|
|
| BLAKE2b-256 |
0e0423ab0affb5480a7617186dc84faf5d474b9034f931b131d2018b0cf3344c
|
Provenance
The following attestation bundles were made for mkprof-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on ryneches/mkprof
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkprof-0.1.2-py3-none-any.whl -
Subject digest:
c0c0db1ef282532d3ceddf5bbe09c668c7f1f230ac60d2618599ea023fcf2db6 - Sigstore transparency entry: 1642031121
- Sigstore integration time:
-
Permalink:
ryneches/mkprof@1f5bb98ca2aa72c831c8fcbc5981370e68118ff8 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/ryneches
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1f5bb98ca2aa72c831c8fcbc5981370e68118ff8 -
Trigger Event:
push
-
Statement type: