gregsexton / ob-ipython

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

set syntax highlighting for other kernels #175

Open ssfrr opened 6 years ago

ssfrr commented 6 years ago

I'm using ob-ipython with a julia kernel, and it seems to be working pretty well (exciting!). One issue is that emacs doesn't know I'm editing julia code inside the block, so the syntax highlighting is for python. I'm creating the block as follows:

#+BEGIN_SRC ipython :session :results raw drawer :kernel julia-0.6
using Plots
gr()
plot(rand(200))
#+END_SRC

Is there any way to have emacs set the syntax mode inside the source block based on the :kernel argument?

MasonProtter commented 6 years ago

Did you ever end up finding a fix for this?

ssfrr commented 6 years ago

nope, haven't figured out a good solution yet

MasonProtter commented 6 years ago

Apparently, Org just uses the syntax highlighting for whatever it sees right after #+BEGIN_SRC so in this case, I guess it would look for an ipython-mode. I wonder if there's a way to just tell it to use Julia highlighting for all ipython blocks.

kdjaks commented 6 years ago

Syntax highlighting seems to work correctly when using #+BEGIN_SRC jupyter-julia ...