The SoS CodeMirror mode, as defined in kernel.js, is a Python mode + magic and SoS statements. It does not highlight code in other languages correctly. In theory, we should
- use
R code mirror mode (plus magics) for R cells, and so on.
- Recognize SoS actions and highlight lines after
R: as R code etc. It should in theory also recognize expand=True etc to correctly identify and highlight SoS expressions.
Item 1 could be done when the language of a cell is switched. We should be able to create new codemirror mode and switch to it. There is however a slight problem with the name of the language (e.g. R) might not match name of code mirror.
Item 2 could be done with nested codemirror mode, and there are examples such as htmlmixedmode.
The SoS CodeMirror mode, as defined in kernel.js, is a Python mode + magic and SoS statements. It does not highlight code in other languages correctly. In theory, we should
Rcode mirror mode (plus magics) forRcells, and so on.R:as R code etc. It should in theory also recognizeexpand=Trueetc to correctly identify and highlightSoSexpressions.Item 1 could be done when the language of a cell is switched. We should be able to create new codemirror mode and switch to it. There is however a slight problem with the name of the language (e.g. R) might not match name of code mirror.
Item 2 could be done with nested codemirror mode, and there are examples such as htmlmixedmode.