[PYTHON] Post a Jupyter Notebook as a blog post

This is a continuation of Last time.

Last time I posted a blog using Nikola's default formats, reStructuredText and Markdown. This time I will post a blog using ipynb format (Jupyter Notebook).

Preparation

Edit conf.py directly under the site directory. Add an entry with the extension ʻipynb`.

conf.py


POSTS = (
    ("posts/*.rst", "posts", "post.tmpl"),
    ("posts/*.md", "posts", "post.tmpl"),
    ("posts/*.txt", "posts", "post.tmpl"),
    ("posts/*.html", "posts", "post.tmpl"),
)
PAGES = (
    ("pages/*.rst", "pages", "page.tmpl"),
    ("pages/*.md", "pages", "page.tmpl"),
    ("pages/*.txt", "pages", "page.tmpl"),
    ("pages/*.html", "pages", "page.tmpl"),
)

conf.py


POSTS = (
    ("posts/*.rst", "posts", "post.tmpl"),
    ("posts/*.md", "posts", "post.tmpl"),
    ("posts/*.txt", "posts", "post.tmpl"),
    ("posts/*.html", "posts", "post.tmpl"),
    ("posts/*.ipynb", "posts", "post.tmpl"),
)
PAGES = (
    ("pages/*.rst", "pages", "page.tmpl"),
    ("pages/*.md", "pages", "page.tmpl"),
    ("pages/*.txt", "pages", "page.tmpl"),
    ("pages/*.html", "pages", "page.tmpl"),
    ("pages/*.ipynb", "pages", "page.tmpl"),
)

Post

Execute the following command.

nikola new_post -f ipynb
Creating New Post
-----------------

Title:

Entering the title of the article will generate a post / titlename.ipynb file. Edit this file on Jupyter.

Build and confirm

The build is the same as last time.

nikola build
nikola serve -b

It will be posted like this.

image.png

Post from an already created ipynb file

  "nikola": {
    "tags": "",
    "title": "post4",
    "date": "2017-06-17 15:15:00 UTC+09:00",
    "type": "text",
    "slug": "post4",
    "category": "",
    "link": "",
    "description": ""
  }
nikola build
nikola serve -b

image.png

In this way, you can post as a blog post just by adding the notebook metadata.

Recommended Posts

Post a Jupyter Notebook as a blog post
How to import NoteBook as a module in Jupyter (IPython)
Make a sound with Jupyter notebook
How to import NoteBook as a module in Jupyter (IPython)
Use Jupyter Notebook as a unit test and manual creation tool
I want to blog with Jupyter Notebook
Make Jupyter Notebook a service on CentOS
Run Jupyter notebook on a remote server
Powerful Jupyter Notebook
Jupyter notebook password
Jupyter Notebook memo
Try a state-space model (Jupyter Notebook + IR kernel)
Simply display a line graph on Jupyter Notebook
Get started Jupyter Notebook
Open Jupyter Lab (or Jupyter Notebook) by specifying a directory
Drawing a tree structure with D3.js in Jupyter Notebook
3 Jupyter notebook (Python) tricks
[Cloud103] # 3 Jupyter Notebook again
Recommendation of Jupyter Notebook, a coding environment for data scientists
Opens in a new window when launching Jupyter Notebook (Windows)
I want to use a virtual environment with jupyter notebook!
<Python> Build a dedicated server for Jupyter Notebook data analysis
The usual way to add a Kernel with Jupyter Notebook
A very convenient way to give a presentation on Jupyter Notebook
Try clustering with a mixed Gaussian model on a Jupyter Notebook
A note when I can't open Jupyter Notebook on Windows
Automatically opens in a new window when launching Jupyter Notebook
Shortcut key for Jupyter notebook
Introduced Jupyter Notebook to CentOS 7
Using Graphviz with Jupyter Notebook
Display HTML in Jupyter notebook
Use pip with Jupyter Notebook
Multiprocessing error in Jupyter Notebook
Try using Jupyter Notebook dynamically
[Super Basics] About jupyter Notebook
High charts on Jupyter notebook
View PDF on Jupyter Notebook
Use Cython with Jupyter Notebook
homebrew, pyenv, anaconda, Jupyter Notebook
Use Remotte as a user
Play with Jupyter Notebook (IPython Notebook)
[Complete version] Jupyter Notebook shortcut
Run Jupyter Notebook on windows
How to use Jupyter Notebook
python3.8 venv environment jupyter notebook
A simple way to launch Jupyter Notebook / Lab and set a password
How to batch start a python program created with Jupyter notebook
I wanted to create a smart presentation with Jupyter Notebook + nbpresent
Build a comfortable psychological experiment / analysis environment with PsychoPy + Jupyter Notebook