Skip to main content

Reader for ipynb files

Project description

pelican-jupyter-reader: A Plugin for Pelican

PyPI version

This Pelican plugin provides a Jupyter Notebook (i.e. *.ipynb) reader. The plugin indends to allow users to simply drop Jupyter notebooks in their Pelican content directory and have the notebooks rendered (beautifully) in a Pelican static website.

Installation

This plugin can be installed via:

pip install pelican-jupyter-reader

Quckstart

  • Add the plugin to pelicanconf.py:
# ...

from pelican.plugins import pelican_jupyter_reader
PLUGINS = [pelican_jupyter_reader]

# ...
{
    "pelican": {
        "date": "2020-04-10",
        "title": "this is a title",
        "tags": "thats, awesome",
        "category": "yeah",
        "slug": "my-super-post",
        "authors": "Alexis Metaireau, Conan Doyle",
        "summary": "Short version for index and feeds"
    },
    "kernelspec": {
        "display_name": "Python 3",
        "language": "python",
        "name": "python3"
    },
//...
  • Drop your Jupyter notebook in the pelican content directory, build your site, and deploy! :rocket:

Notes

The Jupyter nbconvert configuration for preprocessors and the HTMLExporter are exposed in your Pelican config, pelicanconf.py. This means you can do some useful manipulation of your notebooks while reading.

For example, to use the basic template for the HTMLExporter, you could add the following to your pelicanconf.py:

from traitlets.config import Config
NBCONVERT_CONFIG = Config()
NBCONVERT_CONFIG.HTMLExporter.template = 'basic'

To strip empty cells from the notebook before publishing, you might add this option to pelicanconf.py:

# ...
NBCONVERT_CONFIG.RegexRemovePreprocessor.patterns = \
    ['\\s*\\Z']

Other nbconvert configuration options can be found here.

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

pelican-jupyter-reader-0.2.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

pelican_jupyter_reader-0.2.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file pelican-jupyter-reader-0.2.1.tar.gz.

File metadata

  • Download URL: pelican-jupyter-reader-0.2.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Darwin/18.7.0

File hashes

Hashes for pelican-jupyter-reader-0.2.1.tar.gz
Algorithm Hash digest
SHA256 620dfa66e03755fe95fc8a2588673ffbf5050622a9d1c7abc70df883e46bc23d
MD5 17fd5d96ebc75b48c59e6b15103798b2
BLAKE2b-256 992205589eb6b6d0509905bb195610f8d48f6ac92d6c49049736e21a2f075dde

See more details on using hashes here.

File details

Details for the file pelican_jupyter_reader-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pelican_jupyter_reader-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 56b1016c7b24e607839703f283aa2d859d6be797209f185350fdb411b848d1e7
MD5 a5e54b23ae2b35b99ecb179ec80b4504
BLAKE2b-256 ed9bab819b728ea2e35f0b834d94dba20de4127429ba0152e6167d8b06708b46

See more details on using hashes here.

Supported by

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