AnkiWeb
- Rating
- 71 (👍 58 · 👎 13)
- Updated
- 2026-06-17
- Anki versions
- 25.09~
- Description language
- en
AnkiWeb addon 112228974
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.
Open on AnkiWeb GitHub Ask about alternatives
active
| Min Anki | Max Anki | Updated |
|---|---|---|
| 2.1.49 | 2.1.66 | 2023-10-14 |
| 23.10 | 23.12.1 | 2024-03-17 |
| 24.04.1 | 25.02.5 | 2025-05-29 |
| 25.07.1 | 25.07.4 | 2025-08-15 |
| 25.07.5 | 25.09+ | 2026-06-17 |
Loading…
Creates highlighted code blocks and inline code from selected text or clipboard, working in day and night modes on Anki desktop and AnkiDroid.
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.
Inserts syntax-highlighted code snippets into Anki notes, with language selection, configurable line numbers, centering, CSS classes, and per-deck language memory.
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.
Renders flashcards with advanced markdown, LaTeX math, syntax highlighting, theme-aware styling, tag badges, and interactive cloze toggles via React components.
Adds Basic and Cloze note types supporting Markdown and KaTeX, live desktop preview, code highlighting, chemistry formulas, and ==text== highlighting across internet-connected devices.
An Anki plugin that adds syntax highlighting to code snippets.
<!-- markdownlint-disable-next-line --> <p align="center"><img src="screenshots/v2/animation.gif"/></p>
The recommended way to install this plugin is directly from AnkiWeb using Anki’s add-on management.
Alternatively, you can install this plugin from source.
dev/bin/package.codehighlighter.ankiaddon in Anki.You can either highlight code from your clipboard or highlight a snippet of code already present in a card field.
⌃+o (on macOS, ⌘+o) or click this add-on’s button in the
editor’s button bar.⌃+o (on macOS, ⌘+o) or click this add-on’s button in the
editor’s button bar.The plugin works on untagged code blocks.
Do not add your own HTML tags like <code> or <pre><code> to the snippet you
want to highlight.
If you have run into issues with preannotated code snippets, see
this comment for how to fix this.
This add-on uses Pygments. It creates highlighting tags when you run this plugin. This is useful for creating cloze cards. It supports both inline code and code blocks.
The plugin accepts the following configuration options:
block-style (default:
"display:flex; justify-content:center;") — The CSS style applied to the outer
most container of a block code snippet.
The default centers the block.auto-detect-display-style (default:
true) — Whether the add-on should auto-detect if the code snippet should be
formatted as a block or inline.shortcut (e.g. ctrl+o) — this sets the shortcut that triggers this plugin.auto-update-media (default:
true) — Whether the plugin updates the CSS stylesheet.dev-mode (default:
false) — Enables developer mode, which exposes the assets management options
(Refresh/Delete assets) under the Tools menu.You can use other styles than the provided Solarized style. This section explains how.
[!WARNING] Customized styling option is supported as-is. I do not provide special support for creating the stylesheet file nor guarantee forward compatibility.
auto-update-media to false._gch-pygments-solarized.css with your stylesheet.[!TIP] Check out
tools/generatepygmentscss.pyfor how I generate the stylesheet for Solarized. You can reuse it for your own stylesheet.
If you see “The selection splits an HTML node, which prevents the highlighting plugin from proceeding,” you are partially selecting an HTML element.
This plugin can not highlight a selection that partially selects an HTML element. To work around this, see these instructions.
This add-on installs its own CSS files into Anki’s media folder. You need to run some manual steps if you want to fully delete the add-on.
[!WARNING] Removing the CSS stylesheet file will remove highlighting from all notes that use that stylesheet. If you want to delete the add-on but keep already highlighted cards, then skip the file removal steps (1, 2, and 3).
"dev-mode" to true.Extras/Tools > Delete Greg’s Code Highlighter Assets.This manual step is necessary until Anki adds add-on lifecycle hooks.