This repository demonstrates:
- A conversion of a Jupyter notebook into a static HTML
- Serving this HTML using Github Pages
python -m venv ./venv/github-pages/
- Create a virtual environment.\venv\github-pages\Scripts\Activate.ps1
- Activate it (use the right script depending on your terminal, this one is forWindows-PowerShell
)pip install -r requirements.txt
- install the packages into the virtual environmentpython -m ipykernel install --user --name=github_pages --display-name=github_pages
- set up the IPython kernel in the virtual environment, such that this environment could be used in VSCode. Notice the name that we provide to the environment. This is how it will be identified in VSCode.
jupyter nbconvert --to html ./notebooks/example.ipynb --output-dir ./docs --TagRemovePreprocessor.enabled=True --TagRemovePreprocessor.remove_input_tags="['noshow']"
- converts the notebook into an HTML file.
(reference: official docs. Jekyll built-in support: official docs)
- Enable Github Pages through the repository settings. For this the repository will have to be public, or your user should be on the Pro program.
- The public URL is:
GITHUB-USER-NAME.github.io/REPOSITORY-NAME
, and the landing page isindex.html
. NOte that you can you set your own domain if you own one, and this can be set via the repository's settings.