question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jupyter notebook to emacs' org-mode format

See original GitHub issue

Emacs’ org mode format (extension .org) has a well documented syntax for code blocks:

#+NAME: <name>
#+BEGIN_SRC <language> <switches> <header arguments>
  <body>
#+END_SRC

We could implement a notebook to/from org converter.

Further notes:

  • The NAME option seems optional.
  • Examples are available here
  • Org mode has a header with metadata. Can it hold the Jupyter notebook metadata?
  • Also, it’s not clear how cell metadata could be represented in org mode

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:16
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
mwoutscommented, May 13, 2020

@srnnkls , if that can help, I have prepared a branch with a tentative implementation of the org format based on pandoc (back and forth), see the last three commits here: https://github.com/mwouts/jupytext/commits/org_pandoc:

Note that the round trip test does not work. Is it correct that pandoc’s conversion only works in one direction (ipynb to org)? Any way, feel free to experiment with this, and replace either converter with your favorite one.

Two additional comments:

  • Jupytext removes the outputs before calling pandoc (because they are preserved in the .ipynb file), so no headache with outputs…
  • pandoc is used for the md:pandoc format, but that is not Jupytext’s default markdown format (see the example files at https://github.com/mwouts/jupytext/tree/master/demo )
1reaction
mwoutscommented, May 16, 2020

Just a note for the people who subscribed to this thread… I have opened an issue at pandoc regarding the round trip ipynb-org-ipynb: https://github.com/jgm/pandoc/issues/6367.

The issue also raises the question of how the notebook cells should be represented in org mode. Personally I think that the representation should remain as simple as possible, because the users are going to type it 😃 But obviously, it is simpler for the programmers (and maybe also safer in the long run?) to use explicit cell markers. Anyway… if you have an opinion about this, please follow the pandoc thread as well!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Org-mode as a lightweight Jupyter notebook
An org file is a plain text file, and you can execute embedded code right there in your editor. You don't need a...
Read more >
Replacing Jupyter Notebook with Org Mode - SqrtMinusOne
Yet another solution is to use emacs-jupyter's option :pandoc t , which invokes pandoc to convert HTML, LaTeX, and Markdown to Org. Predictably, ......
Read more >
Convert Jupyter notebook to Emacs Org mode for ... - Alldocs
Looking for a free text converter? Look no more, upload your Jupyter notebook files and convert them to Emacs Org mode files. Yes,...
Read more >
Integrating jupyter notebook (ipython) into org-mode notebook
Run code on remote ipython kernels with Emacs and orgmode provides a basic example using exactly that library, and there are more related ......
Read more >
Comparing org-mode in Emacs vs Notebooks in Jupyter - Reddit
I have a feeling that Jupyter notebooks in nowadays remind me org-mode in Emacs. Both can be used: for text notes;
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found