Inline code syntax highlighting in Jupyter markdown?

It is possible to syntax highlight inline code in Jupyter? Maybe similar as asked here.

Currently, the following markdown

   Inline code `np.array`.
   vs.
   Code block:
   ```python
   np.array
   ```

yields

enter image description here

Upvotes: 4

Views: 2500

Answers (1)

Reblochon Masque
Reblochon Masque

Reputation: 36732

I don't think it is possible; the jupyter markdown defines the triple quote followed by a language name as the "syntax highlighting markup".

It is not exactly what you want, but there are two ways to color text in a md cell:

Using LaTeX:

${\text{inline code :}}\color{red}{\text{ np.array}}{\text{ but no cigar}}$

Using HTML:

inline code: <span style="color:red">np.array</span> but no cigar.

which respectively render like this:

enter image description here

Upvotes: 1

Related Questions