This repository contains a boilerplate for:
- Converting Jupyter notebooks to markdown or html
- Push them to static site generator (Pelican)
- Deploy the site on GitHub pages
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
All of the jupyter notebooks that should be converted to pages must be inside notebooks
directory.
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.
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
Note: Each markdown file must have:
- Title: My First Review
- Date: 2010-12-03 10:20
- Category: Review
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