Skip to main content

Convert Jupyter Notebooks to Jekyll-ready Markdown files

Project description

JekyllNB: Jupyter Notebooks to Jekyll Markdown

Test Status Documentation Status Coverage Status LGTM DeepSource PyPI Version Downloads License Code Style

JekyllNB extends Jupyter's command line tool nbconvert to add the Jekyll front matter to Markdown files and save generated images to a desired location. This allows you to easily convert all your notebooks to the required format and immediately build your Jekyll site. It works great in a GitHub Actions workflow to convert your notebooks to Markdown and deploy to GitHub Pages. See JekyllNB in action here.

Installation

JekyllNB is available on PyPI and can be installed with pip.

pip install jekyllnb

Usage

JekyllNB is a Jupyter app just like nbconvert. Call it with jupyter jekyllnb. The preprocessor reads metadata from your notebook to populate the Jekyll front matter. Add a jekyll section to your notebook metadata similar to:

"jekyll": {
    "layout": "notebook",
    "permalink": "/hello/",
    "title": "Hello World!"
}

The exporter will add the following front matter to the generated Markdown:

---
layout: notebook
permalink: /hello/
title: Hello World!
---

Options

Since jekyllnb extends nbconvert, all existing options are supported. The following new options are available:

  • --site-dir: Root directory of your Jekyll site. Markdown (page-dir) and image (image-dir) folders will be created here if they do not exist.
  • --page-dir: Directory for generated Markdown files (e.g. _pages or _posts).
  • --image-dir: Directory for images. Images are organized into folders for each notebook by default. Alias for the nbconvert option NbConvertApp.output_files_dir.
  • --no-auto-folder: Flag to turn off the default behavior of organizing images by notebook name within image-dir. (default: false)

nbconvert

JekyllNB also supports nbconvert by registering an entry point for the exporter. You can use the Jekyll exporter with nbconvert by calling jupyter nbconvert --to jekyll.

Note: The options above are not available with nbconvert.

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

jekyllnb-0.3.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

jekyllnb-0.3.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file jekyllnb-0.3.1.tar.gz.

File metadata

  • Download URL: jekyllnb-0.3.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.0 Linux/5.4.0-1031-azure

File hashes

Hashes for jekyllnb-0.3.1.tar.gz
Algorithm Hash digest
SHA256 a43a1e2fda94ef90f33f8bbee592ed921e6dc604253a68e47a5200b2dffb143b
MD5 8204200da5d7a7d7ac0a9c75ceecbef0
BLAKE2b-256 e23c3854e22fa18b22410b5afe33734d9e580b85a9811cd1a01b29e80978f03c

See more details on using hashes here.

File details

Details for the file jekyllnb-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: jekyllnb-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.0 Linux/5.4.0-1031-azure

File hashes

Hashes for jekyllnb-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 120d2aa60477e45df10ceb9f98c8eb9132e628d79a76379568c78dcc68754504
MD5 dc526a8e8af7ff3d000fbb7eb68253f9
BLAKE2b-256 f018ce23a39136ec62bb1433851c724ade4f5a288befc0c3d8baa48d67cc8ee2

See more details on using hashes here.

Supported by

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