Open jannis-baum opened 7 months ago
There is nbconvert
, this is a bit slow though. Faster would be to have a Python server running that gives us the HTMLs, this way we could save some time on the initialization
import nbformat
from nbconvert import HTMLExporter
notebook = nbformat.read('notebook_path', as_version=4)
html_exporter = HTMLExporter(template_name='classic')
(body, resources) = html_exporter.from_notebook_node(notebook)
print(body)
Using Python here is not good; maybe we can reimplement https://github.com/jsvine/notebookjs with pluggable markdown parser & highlighting; then we can plug in Vivify's existing parser & highlighting
@tuurep do you use Notebooks/are you interested in this feature as well?
I tend to avoid them tbh and write python directly 😄
But sure I'm interested, and actually as a reader I could have use for it
And I can test this if it helps
Sounds good! I was also avoiding them for the longest time haha but recently they have been adding up and I find myself in the browser running Jupyter Lab way too much.
My ultimate goal with this is to have Vivify render Notebooks very quickly and in its style and then make another Vim extension that uses jupytext to open and edit the .ipynb
files and run a kernel in the background that we use to execute cells from Vim and then live-update the .ipynb
to be displayed by Vivify🤩 Getting excited haha, then we will essentially have the same "edit in Vim, view in the browser" paradigm for Notebooks as for Markdown
Actually, really cool :smile:
ipynb
file, also see nbformat docsplain
& parsed ansi