Anki Forums

In-line syntax highlighting and extra pseudocode language

Continuing the discussion from Syntax Highlighting (Enhanced FORK) [Official thread]:

Is there anyway to apply the syntax highlighting but in-line with other text rather than on its own line to the left / centered? Also, how can I add an extra language pseudocode (applying the syntax highlighting as grey for all text). This would be useful for my A-Level studies where a standard pseudocode syntax is used for code rather than any specific programming language.

in my syntax highlighting fork in the settings there’s an option "show unformatted (pre, code) so that your code is surrounded by pre or code tags. Then you can customize the css.

Or maybe have a look at an add-on like Custom Styles (font color, background colour, classes) which allows to apply a class to selected text and then you can define some css for this class.

1 Like

Is there a quick way to make all of the syntax highlighting plain? I want it to be like the highlighting in code blocks in the Mini Format Pack add-on ([https://ankiweb.net/shared/info/295889520]).

you mean retroactively change already highlighted code? If you have used the css option of my add-on you could redefine all classes or maybe it’s enough to redefine the highlight class? I have never looked into this. If you only have like 100 notes to change I would just manually do it.

Never mind. Your suggestion about using the option “show unformatted (pre, code)” was sufficient in the end.