FHighlight - Dynamic Code Highlighting

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.
AI-generated summary; may contain mistakes.

formattingcard-templates

Open on AnkiWeb GitHub Ask about alternatives

AnkiWeb

Rating
4 (πŸ‘ 4 Β· πŸ‘Ž 0)
Updated
2023-10-08
Anki versions
2.1.66~
Description language
en

Maintenance

abandoned

  • Last update or commit was 1064 days before the snapshot (2023-11-02).
  • The repository has 1 test files.
  • The repository has 2 GitHub Actions workflows.

GitHub

Repository
abdnh/anki-fhighlight Β· more by abdnh
Stars
⭐ 0 · forks 0 · open issues 1
Last commit
2023-10-08
License
AGPL-3.0
Languages
Python, HTML, Makefile
Tests
1

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
2.1.452.1.66+2023-10-08
History across monthly snapshots

Loading…

Similar addons

Better Markdown Anki

Renders flashcards with advanced markdown, LaTeX math, syntax highlighting, theme-aware styling, tag badges, and interactive cloze toggles via React components.

formattingappearancecard-templatescloze

Rating 24 πŸ‘ 20 Β· πŸ‘Ž 4 ⭐ 31 Anki 2.1.66~ Updated 2026-08-02

README

FHighlight - Dynamic Code Highlighting for Anki

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.

How to use

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.

Download

You can download the add-on from AnkiWeb: 1339779080

Changelog

See CHANGELOG.md for a list of changes.

Support & feature requests

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.

Support me

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>