You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that some language tags for fenced code blocks are differentially highlighted in jupyterlab compared to the html output from nbconvert. Would it be possible to use the same stylesheet between jupyterlab and nbconvert to make this consistent (not sure which one is more correct, if any)?
For all the example diff output below, jupyterlab is on the left and nbconvert HTML on the right
The text was updated successfully, but these errors were encountered:
joelostblom
changed the title
Language tags for fenced code blocks not highlighted the same as inside jupyterlab
Language tagged fenced code blocks are not highlighted the same as inside jupyterlab
Sep 13, 2020
Actually, nbconvert's lab template and jupyterlab really use the same CSS, but ... not the same HTML.
in the case of JupyterLab, code cells are rendered in the frontend with the CodeMirror JS library, and (most typically) with a custom JupyterLab theme which uses the CSS variables from JupyterLab.
in the case of nbconvert, the code cells are rendered using the Pygments Python library which produces static HTML with syntax highlighting, and a special theme which mimicks the default CodeMirror theme of JupyterLab: https://github.com/jupyterlab/jupyterlab_pygments.
Unfortunately, Pygments-generated HTML and CSS classes are not granular enough to reproduce all of the features of the codemirror highlighting, It is unlikely to produce exactly the same thing.
I noticed that some language tags for fenced code blocks are differentially highlighted in jupyterlab compared to the html output from nbconvert. Would it be possible to use the same stylesheet between jupyterlab and nbconvert to make this consistent (not sure which one is more correct, if any)?
For all the example diff output below, jupyterlab is on the left and nbconvert HTML on the right
diff
is not highlighted at allsh
differs in the highlighting of the command, flags, parentheses, + and -The text was updated successfully, but these errors were encountered: