Skip to main content

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.

  1. Input

    • Jupyter Notebooks (.ipynb) located in a configured nb_read_path directory.
    • Configuration dictionary specifying read/write paths and asset subdirectories.
  2. 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.
  3. Output

    • Writes processed notebooks as .html files to nb_write_path.
    • Copies any linked notebook assets (e.g., images) to the correct assets/ subfolder for Jekyll to use.

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:

  1. 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 .
    
  2. Run the tool locally

    # Main entry point
    python -m nbconvertjkl --config path/to/config.yml
    
  3. Run tests

    # Run tests
    pytest tests/
    
  4. (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 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

nbconvertjkl-0.0.2.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nbconvertjkl-0.0.2-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file nbconvertjkl-0.0.2.tar.gz.

File metadata

  • Download URL: nbconvertjkl-0.0.2.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for nbconvertjkl-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c48b2e0af26f26289b1f974459b1e8f431e52670371999dec9adaade8e0a22db
MD5 c4cf083766494f9b9dbb031bf972cb4e
BLAKE2b-256 86d18e4d8c1940b2e60b1611491e1b360935a51c5091c0fc9ba67f11dbdfb4b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbconvertjkl-0.0.2.tar.gz:

Publisher: python-publish.yml on fuzzy-tribble/nbconvertjkl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nbconvertjkl-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: nbconvertjkl-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for nbconvertjkl-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 853ea41d77d8d9190a7fb86f5ae27dbf3e182bff15bc7040348f572014b90d81
MD5 ee5de8ad58c483ee9f39bb0023415305
BLAKE2b-256 4adf4c94f14bc717cf9363e7e9b903ce08264879046fbdb32a3d4eec84ec67a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbconvertjkl-0.0.2-py3-none-any.whl:

Publisher: python-publish.yml on fuzzy-tribble/nbconvertjkl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page