jkitchin / ox-ipynb

org-mode exporter to Jupyter notebooks
173 stars 40 forks source link

Top-level metadata is emitted as a list (should be dict) #10

Closed dangirsh closed 6 years ago

dangirsh commented 6 years ago

When trying to open an ipynb converted with this tool, I encountered this error from Jupyter:

pop() takes at most 1 argument (2 given)

I traced it down to the top-level metadata being emitted as this list:

  "metadata": [
    [
      "org"
    ],
    null,
    null
  ],

Googling around for the error, I saw that the metadata should be a dict. I manually replaced it with:

"metadata": {},

which fixed the error. I can now open my ipynb.

Emacs version 25.3.1 Jupyter version 4.4.0

I used ox-ipynb-export-to-buffer, then saved the resulting buffer as an ipynb.

dangirsh commented 6 years ago

Ah, this only happens for me when the first code block in my file was Emacs Lisp (for org-mode config). Problem disappears when I removed those blocks (so the first block is now ipython).

jkitchin commented 6 years ago

Maybe you can put those in a heading at the end with a :noexport: tag on them.