Hi, newbie here.
- I created 2 ipynb notebooks using Wolfram Jupyter Kernel.
https://github.com/akvsak/www/blob/master/_notebooks/2022-05-21-wolfram-fast.ipynb
https://github.com/akvsak/www/blob/master/_notebooks/2022-05-21-wolframtest.ipynb
- Also created a website at https://akvsak.github.io/www
- When I place the 2 notebooks into the
_notebooks
directory andgit push
, both the blog posts are generated properly as HTML on the website.
https://akvsak.github.io/www/wolfram/2022/05/21/wolframtest.html
https://akvsak.github.io/www/wolfram/2022/05/21/wolfram-fast.html
Now I tried to do the same thing locally using just the notebook2html
code as a script.
- I installed nbdev using pip and used the notebook2html script locally.
- Below is the file
w2h.py
that I created.
"""Converts Jupyter Notebooks to Jekyll compliant blog posts"""
from datetime import datetime
import re, os, logging
from nbdev import export2html
from nbdev.export2html import Config, Path, _to_html, _re_block_notes
from fast_template import rename_for_jekyll
## apply monkey patches
# export2html._nb2htmlfname = _nb2htmlfname
# export2html.notebook2html(fname='nb1.ipynb', template_file='fastpages.tpl', execute=False)
export2html.notebook2html(fname='wf.ipynb', dest='c:/akvsak/www3/tools/',execute=False)
-
It works locally for the included notebook file
2020-02-20-test.ipynb
and generates the HTML file. -
But, I get the following error when using locally on any of the 2 wolfram generated ipynb notebooks :
converting: wf.ipynb
'list object' has no attribute 'get'
Conversion failed on the following:
wf.ipynb
python --version
Python 3.8.6
nbdev verion 1.2.8
Is there any setting I need to include in the local script to make it work locally? New to python, so any clue would be helpful. Thanks for reading.
Summary: wolfram generated notebooks render to html using github pages but not when used locally.