notebook - 1/1¶
AttributeError: module ‘jinja2’ has no attribute ‘Markup¶
The notebook conversion fails again due to the following error:
Gallery of notebook¶
The module sphinx-gallery
became quite popular. I discovered that
sphinx-nbexamples was doing the same.
I integrated the first one into pyquickhelper but I did something
different for the second as I already had some custom logic to handle
which creates a thumbnail by getting the last image if there is one
or the last result output cell. The module uses matploblib to builds an image
with text results.
You can check the results at Notebook Gallery.
Open the notebook from a virtual environment¶
On Windows, I did not check on Linux,
the short cut
jupyter-notebook.exe is not present
in the virtual environment. Here is a simple python
program to launch the notebook server from
the virtual environement.
Export a notebook with no code¶
Sometimes, you just want to remove all codes from your report. You can just reasd the json of a notebook and remove all codes by yourself or you can add an extra preprocessor which removes all the code in a notebook. We do something similar to this example. First we create a preprocessor:
Why do I see invered question in a notebook converted into PDF?¶
Convert a notebook into slides¶
I thought it would be easy to convert a notebook into slides. I would just have to execute nbconvert. I went through two issues. The first one came from reveal.js. My first tries did not work. I decided to take the version included in the module sphinxjp.themes.revealjs and I also updated the output of nbconvert to remove external links as much as possible.
Add a custom menu to the notebook¶
Visualize differences between two files in a notebook¶
It is now possible to visualize the differences between two files directly from a notebook: