Closed sglyon closed 4 years ago
hi @sglyon the default behaviour for the extension is the use the project wide default language (in sphinx) for matching with the kernel. If a code-block differs to the default it will be added as markdown as it cannot be executed using the default kernel. Perhaps that is your issue?
in the lecture site we use .. highlight:: {{ programming_language }}
to set the default language at the top of each file.
Ok, I was hoping that this could be configured at the project level and thought that perhaps the jupyter_lang_synonyms
or jupyter_kernels
settings in the conf.py would let me do it.
Is that right?
Per https://github.com/QuantEcon/lectures_quantecon_datascience/issues/101, it looks like jupyter_lang_synonyms = ["python"]
is sufficient to include in the src/conf.py
.
To be clear, though, I don't know if it's possible to configure a general map. I think what jupyter_lang_synonyms
does is map the array entries to the project wide default --- is that correct?
hey @sglyon sorry just saw this. The jupyter_lang_synonyms
is really there to allow ipython
highlighted code to be recognised as python
code in a mixed code sense in projects that use both. The default lang for sphinx is python. Is data science going to be in multiple languages?
We are going to make the python
kernel the default for jupyter_kernels
until we learn how to infer it from the documents. That way you will have an example to go by for any other language. See Issue #196
@sglyon did this thread answer your question?
the use here is
jupyter_lang_synonyms = ['ipython', 'python2'] # synonyms for python3 highlighting for code-blocks
Hi team, sorry if this is posted somewhere else, but I couldn't find it.
My want is to be able to able to define a code-block like this
and be able to configure that when the code block's language is
XXX
a specific jupyter kernel will be used. If languageXXX
is not configured with or linked to a kernel then the default behavior will be to include the associated code as a highlighted code block in a markdown cell.Is this possible?
Thanks!