interactive
interactive copied to clipboard
No way to export notebook to .html (and nbconvert doesn't work)
Is your feature request related to a problem? Please describe.
I need to convert a .Net Interactive generated .ipynb notebook to html.
There's no built in way to do that.
The classic conversion using nbconvert fails with error.
Describe the solution you'd like Have an option to export or render notebook to html.
Describe alternatives you've considered
- nbconvert
- pandoc
That's an example nbconvert (6.4.4) error report:
[NbConvertApp] ERROR | Notebook JSON is invalid: data must be valid exactly by one of oneOf definition
Failed validating <unset> in notebook:
On instance:
<unset>
[NbConvertApp] ERROR | Notebook is invalid after preprocessor <nbconvert.preprocessors.tagremove.TagRemovePreprocessor object at 0x7f5ea3470d90>
Traceback (most recent call last):
File "/home/peter/bin/anaconda3/bin/jupyter-nbconvert", line 11, in <module>
sys.exit(main())
File "/home/peter/bin/anaconda3/lib/python3.8/site-packages/jupyter_core/application.py", line 264, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/home/peter/bin/anaconda3/lib/python3.8/site-packages/traitlets/config/application.py", line 846, in launch_instance
app.start()
File "/home/peter/bin/anaconda3/lib/python3.8/site-packages/nbconvert/nbconvertapp.py", line 369, in start
self.convert_notebooks()
File "/home/peter/bin/anaconda3/lib/python3.8/site-packages/nbconvert/nbconvertapp.py", line 541, in convert_notebooks
self.convert_single_notebook(notebook_filename)
File "/home/peter/bin/anaconda3/lib/python3.8/site-packages/nbconvert/nbconvertapp.py", line 506, in convert_single_notebook
output, resources = self.export_single_notebook(notebook_filename, resources, input_buffer=input_buffer)
File "/home/peter/bin/anaconda3/lib/python3.8/site-packages/nbconvert/nbconvertapp.py", line 435, in export_single_notebook
output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
File "/home/peter/bin/anaconda3/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 190, in from_filename
return self.from_file(f, resources=resources, **kw)
File "/home/peter/bin/anaconda3/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 208, in from_file
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
File "/home/peter/bin/anaconda3/lib/python3.8/site-packages/nbconvert/exporters/html.py", line 210, in from_notebook_node
return super().from_notebook_node(nb, resources, **kw)
File "/home/peter/bin/anaconda3/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py", line 376, in from_notebook_node
nb_copy, resources = super().from_notebook_node(nb, resources, **kw)
File "/home/peter/bin/anaconda3/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 147, in from_notebook_node
nb_copy, resources = self._preprocess(nb_copy, resources)
File "/home/peter/bin/anaconda3/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 336, in _preprocess
self._validate_preprocessor(nbc, preprocessor)
File "/home/peter/bin/anaconda3/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 305, in _validate_preprocessor
nbformat.validate(nbc, relax_add_props=True)
File "/home/peter/bin/anaconda3/lib/python3.8/site-packages/nbformat/validator.py", line 302, in validate
raise error
nbformat.validator.NotebookValidationError: data must be valid exactly by one of oneOf definition
Failed validating <unset> in notebook:
On instance:
<unset>