Convert ipynbs to Jekyll-compatible HTML/Markdown for GitHub Pages (adds front matter, navigation, asset fixes)
Project description
Python Package for Converting IPython Jupyter Notebooks to Jekyll Readable (.md, .html)
This repository contains tools for converting .ipynb files to markdown and/or html so that they can be used by Jekyll (the static compiler that GitHub pages uses)
Notebook Conversion Workflow
This tool converts Jupyter Notebooks (.ipynb) into HTML pages suitable for use in a static Jekyll site, with front matter, navigation, and asset handling.
-
Input
- Jupyter Notebooks (
.ipynb) located in a configurednb_read_pathdirectory. - Configuration dictionary specifying read/write paths and asset subdirectories.
- Jupyter Notebooks (
-
Processing
- Parses metadata: title, topics (from first cell).
- Converts notebook to HTML using
nbconvert. - Fixes relative links for images and assets (e.g.,
src="/images/foo.png"→ Jekyll-compatible paths). - Adds YAML front matter for Jekyll layout integration.
- Inserts Prev/Next navigation links between notebooks.
-
Output
- Writes processed notebooks as
.htmlfiles tonb_write_path. - Copies any linked notebook assets (e.g., images) to the correct
assets/subfolder for Jekyll to use.
- Writes processed notebooks as
Installation
Install from PyPI using pip:
pip3 install nbconvertjkl
or clone the repository and install using:
# clone repo and activate virtualenv then install requirements
pip install -r requirements.txt
Usage
To launch interactive command line site build
python -m nbconvertjkl
Contributing
To contribute or work locally:
-
Set up the environment
# Clone the repo git clone https://github.com/yourusername/nbconvertjkl.git cd nbconvertjkl # Make sure you are using a compatible Python version python3 --version # if not, use pyenv to install the correct version pyenv install 3.6.15 pyenv shell 3.6.15 # (Optional) Create a virtualenv python3 -m venv .venv source .venv/bin/activate # Install dependencies and package in editable mode pip install -e .
-
Run the tool locally
# Main entry point python -m nbconvertjkl --config path/to/config.yml
-
Run tests
# Run tests pytest tests/
-
(Optional) Build and check package locally Building is handles in the release-build job of the github action on release.
But if you want to build locally for debugging or whatever, you can do so:
# Build and check package python -m build # will gnerate source + wheel (dist/nbconvertjkl-0.1.0-py3-none-any.whl and dist/nbconvertjkl-0.1.0.tar.gz) python -m twine check dist/* # check the package metadata is valid before uploading to PyPI
You can also test install from local build:
pip uninstall nbconvertjkl # remove any previous version pip install dist/nbconvertjkl-0.1.0-py3-none-any.whl # install from local wheel
Project details
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 nbconvertjkl-0.0.1.tar.gz.
File metadata
- Download URL: nbconvertjkl-0.0.1.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cee2e0312cead71c4f0ae90d7b2b4d6adcd0b4024f84b092a28071b52eb3dd1d
|
|
| MD5 |
2293f159bc95ccf7249f4ee5121d1ca1
|
|
| BLAKE2b-256 |
d85528485d52a195f0c78ed6661bae27b17e356262e6584b046872d08167474a
|
Provenance
The following attestation bundles were made for nbconvertjkl-0.0.1.tar.gz:
Publisher:
python-publish.yml on fuzzy-tribble/nbconvertjkl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nbconvertjkl-0.0.1.tar.gz -
Subject digest:
cee2e0312cead71c4f0ae90d7b2b4d6adcd0b4024f84b092a28071b52eb3dd1d - Sigstore transparency entry: 207575441
- Sigstore integration time:
-
Permalink:
fuzzy-tribble/nbconvertjkl@b7643e5da5b24e5ac57f54f1a9b6a8a94e5fad09 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/fuzzy-tribble
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b7643e5da5b24e5ac57f54f1a9b6a8a94e5fad09 -
Trigger Event:
release
-
Statement type:
File details
Details for the file nbconvertjkl-0.0.1-py3-none-any.whl.
File metadata
- Download URL: nbconvertjkl-0.0.1-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce95141b22a739074b2498422ae54b51069847e2013d5860695a2b2411331dce
|
|
| MD5 |
39a24bcae64317f32c0ae2e171d34dca
|
|
| BLAKE2b-256 |
439ceeca8bcfc092a1b919db4cf0b2c2f4d1201c969311798ad2293439735ab1
|
Provenance
The following attestation bundles were made for nbconvertjkl-0.0.1-py3-none-any.whl:
Publisher:
python-publish.yml on fuzzy-tribble/nbconvertjkl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nbconvertjkl-0.0.1-py3-none-any.whl -
Subject digest:
ce95141b22a739074b2498422ae54b51069847e2013d5860695a2b2411331dce - Sigstore transparency entry: 207575442
- Sigstore integration time:
-
Permalink:
fuzzy-tribble/nbconvertjkl@b7643e5da5b24e5ac57f54f1a9b6a8a94e5fad09 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/fuzzy-tribble
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b7643e5da5b24e5ac57f54f1a9b6a8a94e5fad09 -
Trigger Event:
release
-
Statement type: