gregsexton / ob-ipython

org-babel integration with Jupyter for evaluation of (Python by default) code blocks
739 stars 109 forks source link

Update to auto configure code #138

Closed nnicandro closed 6 years ago

nnicandro commented 6 years ago

This is essentially a refactor of #74 to be more in line with the code style of the project and a few minor changes.

The whole process of auto configuring kernels as it currently stands involves the following steps:

  1. Parsing the kernel name and language from the output of jupyter kernelspec list --json
  2. Adding jupyter-<language> to org-src-lang-modes if not already present. In the case that <language> already exists in org-src-lang-modes use the corresponding mode for the language when adding jupyter-<language>.
  3. Set org-babel-default-header-args:jupyter-<language> to a default value if not already set. The default consists of setting the :session and :kernel header args where the default :session is just "<language>".
  4. Aliasing the org-babel functions for jupyter-<language> to the ipython versions that are currently implemented.
gregsexton commented 6 years ago

You're awesome. Thanks for doing this. I've been meaning to get round to #74 for a long time.

gregsexton commented 6 years ago

Merged!