Environment:
Python 3.6
Django 1.11
I saved a .ipynb file as .html because I want to implement this html to show it on my homepage (that is not yet online).
I use Bootstrap 4.0 beta as a style on my homepage. I have a navbar that is inherited into any html file of this project which works perfectly fine.
But the HTML file of the jupyter notebook can only be displayed correctly when I do not inherit the navbar. If I try to inherit, the navbar is not displayed correctly any more.
My plan is to build my own blog where I post either markdown files (when I do not include Python or R code) or jupyter notebook or rmarkdown notebook.
Both RMarkdown or Jupyter Notebooks can be converted to html, markdown or also pdf. But having tried the first 2, it does not work. If opened in a browser, they are displayed perfectly as you all know. But of course I want to maintain the navigation that I already implemented.
So I hope you can give me a hint how I can do that; I am still a beginner, especially with Django. But I tried a lot of things:
- I first had my homepage ready and used the Django app zinnia. I could post the RMarkdown with useable results but not the Jupyter notebooks (because of the same problem).
- I tried converting into Markdown and use that in Zinnia but the result was worse.
- Tried to manipulate the html files of the notebooks but this did not change anything.
- Tried to convert manually with nbconvert in the terminal (I think this is the same conversion method because there was no difference)
- Build a new page from scratch (this time using bootstrap 4 whereas first I used 3). But same problem remains.
The only thing that worked is to either leave out the navbar or to leave out the styling. But obviously other people have found perfect solutions as there are many pages online that have jupyter notebooks nicely implemented.
I have a base.html in which the navbar is created and the bootstrap styling is loaded. All other html files inherit from this file like this:
{% extends 'base.html' %}
{% block content %}
(here is the individual html content or the html code of the jupyter notebook)
{% endblock %}
EDIT: I just found this: https://nipunbatra.github.io/blog/2017/Jupyter-powered-blog.html
It looks like this guy found a way to do it when he ran into the same problem but I cannot understand everything.
If you have a hint for me please let me know. For all who ran into the same problem, maybe you can solve the problem using the info from that blog post.