AnkiWeb
- Rating
- 4 (π 4 Β· π 0)
- Updated
- 2023-10-08
- Anki versions
- 2.1.66~
- Description language
- en
AnkiWeb addon 1339779080
Adds dynamic syntax highlighting for code during Anki review via custom template filter using Pygments, without modifying notes, with language guessing and triple-backtick snippets.
Open on AnkiWeb GitHub Ask about alternatives
abandoned
| Min Anki | Max Anki | Updated |
|---|---|---|
| 2.1.45 | 2.1.66+ | 2023-10-08 |
Loadingβ¦
Creates syntax-highlighted inline and block code in Anki using Pygments, with day/night colors, desktop and AnkiDroid support, and configurable shortcuts/styles; deprecated in favor of v2.
Renders Markdown flashcards with Shiki syntax highlighting, 300+ languages, 60+ themes, code annotations, math, and an AI agent skill via AnkiConnect.
Renders flashcards with advanced markdown, LaTeX math, syntax highlighting, theme-aware styling, tag badges, and interactive cloze toggles via React components.
Provides CSS-only night-mode syntax highlighting for code in Anki, requiring template import setup and manual CSS Injector modification for Anki 2.1.50β2.1.54.
Inserts syntax-highlighted code snippets into Anki notes, with language selection, configurable line numbers, centering, CSS classes, and per-deck language memory.
Adds real-time CSS/HTML color previews, click-to-pick color picker, syntax highlighting, and live card preview updates to Anki's Card Template Editor.
An Anki add-on that mainly adds syntax highlighting for code via a custom filter which you put in your card templates.
This uses the Pygments library like glutanimate's Syntax Highlighting for Code add-on. The main difference is that this add-on highlights code dynamically when it's shown in the reviewing screen, and doesn't modify the notes themselves. This has the disadvantage that syntax highlighting will not work without the add-on (i.e. it won't work on mobile platforms), but might make it easier to dynamically modify some highlighting parameters.
Put the add-on's filter in your card template like this:
{{highlight lang=python:Front}}
The lang option specifies the programming language. See Pygments documentation for a list of all supported languages.
You can alternatively omit the option to make the add-on try to guess the language from the field text using Pygments' guess_lexer function.
You can also dynamically specify the language for each note by prefixing the value of the lang option with #:
{{highlight lang=#lang_field:Front}}
Here the value of the option (lang_field) is interpreted as a field name where the language identifier is stored in your notes.
You can also use the following filter to list all supported languages:
{{highlight-list-lexers:}}
There is also a more flexible option for highlighting code snippets in fields without having to modify your templates. Enclose code snippets in the triple backticks like this:
<pre>
print('hello world!')
</pre>
You can also omit the language here.
You can download the add-on from AnkiWeb: 1339779080
See CHANGELOG.md for a list of changes.
Please post any questions, bug reports, or feature requests in the support page or the issue tracker.
If you want priority support for your feature/help request, I'm available for hire. You can get in touch from the aforementioned pages, via email or on Fiverr.
Consider supporting me if you like my work:
<a href="https://github.com/sponsors/abdnh"><img height='36' src="https://i.imgur.com/dAgtzcC.png"></a> <a href="https://www.patreon.com/abdnh"><img height='36' src="https://i.imgur.com/mZBGpZ1.png"></a> <a href="https://www.buymeacoffee.com/abdnh" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-blue.png" alt="Buy Me A Coffee" style="height: 36px" ></a>
I'm also available for freelance add-on development on Fiverr:
<a href="https://www.fiverr.com/abd_nh/develop-an-anki-addon"><img height='36' src="https://i.imgur.com/0meG4dk.png"></a>