hplgit / doconce

Lightweight markup language - document once, include anywhere
http://hplgit.github.io/doconce/doc/web/index.html
Other
311 stars 60 forks source link

ipynb2doconce: fix encoding #65

Closed ischurov closed 8 years ago

ischurov commented 8 years ago

There are several small enhancements:

  1. make nbformat importer happy (IPython.nbfornat is deprected, using nbformat instead)
  2. check that we have modern enough verions of ipynb-file explicitly to give better error message
  3. write temporary strings to list and then use "".join instead of dostr+=... as it is more effective (see Shlemiel the painter's algorithm for details)
  4. temproray fix for encoding problem (see also #64 ).
hplgit commented 8 years ago

Thanks! Since many users are struggling with IPython versions and the notebook, we need a fallback on IPython.nbformat if they have not successfully upgraded to nbformat, so I did a nested try for those imports. Also upgraded this import in ipynb.py for writing notebooks.