Skip to content

Latest commit

 

History

History
79 lines (58 loc) · 1.97 KB

README.md

File metadata and controls

79 lines (58 loc) · 1.97 KB

Jupyter Notebooks To Web Page starter

Colab

This repository contains a boilerplate for:

Installation

To install:

1.Clone this repository:

git clone [email protected]:AAYBS/jntwp.io.git

2.Create virtual environment and activate it:

python3 -m venv jntwp
source qtp/bin/activate

3.Install Python packages into your virtual environment:

pip install -r requirements.txt

Development

All of the jupyter notebooks that should be converted to pages must be inside notebooks directory.

Run locally

Run the pelican command to generate site:

pelican content

Now, the site is generated inside output directory. To launch pelican web server:

cd output
python -m pelican.server

Preview the site by navigating to http://localhost:8000/ in your browser.

Converting notebooks

Use nbconvert to convert a Jupyter notebook (input) to a a different format (output). The basic command structure is:

jupyter nbconvert --to <output format> <input notebook> --output <output_dir>

The current setup uses markdown so run:

jupyter nbconvert --to markdown notebooks/mynotebook.ipynb --output /content

Markdown structure

Note: Each markdown file must have:

  • Title: My First Review
  • Date: 2010-12-03 10:20
  • Category: Review

Publish to gihub pages

To publish a Pelican site as a Project Page you need to push the content of the output dir generated by Pelican to a repository’s gh-pages branch on GitHub.

pelican content -o output -s pelicanconf.py
ghp-import output

Then push to gh-pages branch:

git push origin gh-pages