Skip to content

Integration of a jupyter notebook in a web page, simple example

Notifications You must be signed in to change notification settings

cbernet/jupyter_web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jupyter Notebook Web Page integration

This repository demonstrates how to perform a full integration of a jupyter notebook in a web page.

The code is highlighted with pygments. Math equations are rendered with MathJax. The jupyter notebook is converted to HTML with nbconvert. The main style is from bootstrap. Custom CSS classes are provided in this repo for a consistent style between the included jupyter HTML file, and the mother HTML page.

This setup is fully explained in my article https://thedatafrog.com/jupyter-notebooks-web-pages.

Description of the repository

The file templates/overfitting.html has been generated with

jupyter nbconvert --execute --template basic overfitting.ipynb

templates/main.html is the template web page in which we want to include

render.py is a simple custom python script that generates index.html from the template. This script is just for demonstration purposes. For real websites, I use django and its template engine.

the css directory contains custom CSS classes for the styling of the various elements in the web page:

Rendering the HTML file

Just do

python render.py

And open the resulting index.html in your browser to see the results.

If you edit template.html do not forget to render again.

Results

Here is what I get in my django website:

About

Integration of a jupyter notebook in a web page, simple example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published