Code Highlight

AnkiWeb addon 1415523481

Adds non-invasive automatic syntax highlighting to code blocks in Anki's editor preview and reviewer, auto-detecting languages or accepting manual class specifications, with configurable font size and color scheme.
AI-generated summary; may contain mistakes.

formattingappearance

Open on AnkiWeb GitHub Find alternatives

AnkiWeb

Votes
18 (πŸ‘ 14 Β· πŸ‘Ž 4)
Updated
2024-02-20
Anki versions
23.12.1~
License
MIT (from the license file in the package)
Virus scan
No ClamAV match A match does not prove malware. No match does not prove that the code is safe.
Languages
JavaScript, CSS, Python, JSON, SCSS
Description language
en

Maintenance

abandoned

  • Last update or commit: 2024-02-20 (985 days before the snapshot).
  • Commits in the last year: 0.
  • Issues: 1 open, 2 closed.
  • Pull requests: 0 open, 0 merged.
  • Median first response: 10 hours (3 answered issues and pull requests).

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
23.12.1+2024-02-20
History across monthly snapshots

Loading…

Similar addons

Anki-Coder

Adds a CodeMirror code editor to Anki flashcards with syntax highlighting, themes, live preview, double-click editing, configurable languages and note types, and mobile and cloze-card support.

formattingappearancemobile-compatible

9 votes 45% approval πŸ‘ 7 Β· πŸ‘Ž 2 ⭐ 4 Anki 25.07.6~ Updated 2026-04-22
Better Markdown Anki

Renders Anki flashcards with enhanced markdown, LaTeX math, syntax highlighting, theme-aware styling, and interactive cloze toggles via React-based note types.

formattingappearancecard-templatescloze

25 votes 65% approval πŸ‘ 21 Β· πŸ‘Ž 4 ⭐ 31 Anki 2.1.66~ Updated 2026-10-15
Markdown support for code blocks and inline code

Converts backticks in the Anki editor into HTML code tags for inline code and code blocks, supporting language classes for syntax highlighting.

formatting

11 votes 62% approval πŸ‘ 10 Β· πŸ‘Ž 1 ⭐ 0 Anki 2.1.65~ Updated 2023-10-20
Simple Markdown

Converts Markdown notes to HTML automatically after editing, with an optional manual conversion button and configurable Markdown extensions such as fenced code blocks.

formatting

8 votes 41% approval πŸ‘ 6 Β· πŸ‘Ž 2 ⭐ 3 Anki 25.02.5~ Updated 2025-11-21

Description

anki-code-highlight

Code highlighting for Anki.

Getting Started

Prerequisites

  1. Go to Anki -> Tools (menubar) -> Add-ons -> Install from file
  2. Select file downloaded from releases page

Usage

In the note editor, click the <> button and enclose your code in <pre><code> ... </code></pre>. In the previewer and reviewer, code highlighting will be applied automatically.

By default, the programming language is auto-detected. You can manually specify the language editing the class attribute e.g. <code class="language-cpp">. Look in highlightjs/languages for the list of language codes you can choose from. Consider doing this if auto-detecting takes too long (makes the reviewer lag).

anki-code-highlight is non-invasive; it doesn't modify your original note to add the highlighting. If you disable or uninstall anki-code-highlight, your pre code blocks just return to being normal pre code blocks.

You can change the font size in the config file. Any valid CSS font-size property is valid in this field.

The color scheme can changed by setting the config file. Look in highlightjs/styles for the list of color schemes you can choose from.

License

Distributed under the MIT license. See LICENSE.txt for more information

Acknowledgements

Uses highlight.js, included under the BSD 3-Clause license. See highlightjs/LICENSE file for license details.

README

anki-code-highlight

Code highlighting for Anki.

Screenshot

Getting Started

Prerequisites

  1. Go to Anki -> Tools (menubar) -> Add-ons -> Install from file
  2. Select file downloaded from releases page

Usage

In the note editor, click the <> button and enclose your code in <pre><code> ... </code></pre>. In the previewer and reviewer, code highlighting will be applied automatically.

By default, the programming language is auto-detected. You can manually specify the language editing the class attribute e.g. <code class="language-cpp">. Look in highlightjs/languages for the list of language codes you can choose from. Consider doing this if auto-detecting takes too long (makes the reviewer lag).

anki-code-highlight is non-invasive; it doesn't modify your original note to add the highlighting. If you disable or uninstall anki-code-highlight, your pre code blocks just return to being normal pre code blocks.

You can change the font size in the config file. Any valid CSS font-size property is valid in this field.

The color scheme can changed by setting the config file. Look in highlightjs/styles for the list of color schemes you can choose from.

License

Distributed under the MIT license. See LICENSE.txt for more information

Acknowledgements

Uses highlight.js, included under the BSD 3-Clause license. See highlightjs/LICENSE file for license details.