Code Monkey home page Code Monkey logo

jekyllnb's Introduction

JekyllNB: Jupyter Notebooks to Jekyll Markdown

Test Status Quality 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.

jekyllnb's People

Contributors

dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar horaceg avatar klane avatar pre-commit-ci[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.