Syntax Highlighting (NG)

AnkiWeb addon 566351439

Inserts syntax-highlighted code snippets into Anki flashcards, with a Python 3 port, unit tests, and support for the latest Anki versions.
AI-generated summary; may contain mistakes.

formattingfork-or-reupload

Open on AnkiWeb GitHub Ask about alternatives

AnkiWeb

Rating
44 (πŸ‘ 41 Β· πŸ‘Ž 3)
Updated
2024-07-19
Anki versions
23.10.1~
Description language
en

Maintenance

abandoned

  • Last update or commit was 804 days before the snapshot (2024-07-19).
  • The repository has 3 test files.
  • The repository has 3 GitHub Actions workflows.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
2.1.4923.10.1+2024-07-19
History across monthly snapshots

Loading…

Similar addons

FHighlight - Dynamic Code Highlighting

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.

formattingcard-templates

Rating 4 πŸ‘ 4 Β· πŸ‘Ž 0 ⭐ 0 Anki 2.1.66~ Updated 2023-10-08
Mini Format Pack

Provides Anki text formatting buttons for highlight, inline code, code blocks, horizontal lines, lists, indentation, and alignment, configurable through Anki's config manager.

formattingshortcutsfork-or-reupload

Rating 224 πŸ‘ 216 Β· πŸ‘Ž 8 ⭐ 54 Anki 23.10~ Updated 2023-11-02
Markdown support for code blocks and inline code

Converts single and triple backticks in Anki's editor into HTML code tags, supporting language classes for blocks and syntax-highlighter integration.

formatting

Rating 11 πŸ‘ 10 Β· πŸ‘Ž 1 ⭐ 0 Anki 2.1.65~ Updated 2023-10-20

README

syntax-highlighting (NG)

Release License - GNU AGPLv3 linting - Ruff types - Mypy

This is a new fork from the original "Syntax Highlighting for Code" (see License and Credits below).

This add-on allows you to insert syntax-highlighted code snippets into the spaced-repetition flashcard app Anki.

The main reasons are:

  • to fix these issues: PR46, PR47
  • clean port to python 3
  • support for mypy/ruff linters
  • adds unittests
  • always target the latest Anki version (eg. 2.1) and the latest Anki python version (at the moment 3.9)

<p align="center"><img src="screenshots/screenshot_python.png"></p>

Table of Contents <!-- omit in toc -->

<!-- MarkdownTOC levels="1,2,3" -->

<!-- /MarkdownTOC -->

Installation

AnkiWeb <!-- omit in toc -->

The easiest way to install Syntax Highlighting is through AnkiWeb code 566351439.

Manual installation <!-- omit in toc -->

Please click on the entry corresponding to your Anki version:

<details>

<summary><i>Anki 2.1</i></summary>

  1. Make sure you have the latest version of Anki 2.1 installed. Earlier releases (e.g. found in various Linux distros) do not support .ankiaddon packages.
  2. Download the latest .ankiaddon package from the releases tab (you might need to click on Assets below the description to reveal the download links)
  3. From Anki's main window, head to Tools β†’ Add-ons
  4. Drag-and-drop the .ankiaddon package onto the add-ons list
  5. Restart Anki

</details>

<details>

<summary><i>Anki 2.0</i></summary> No support for 2.0 </details>

Documentation

For further information on the use of this add-on please check out the description text for AnkiWeb.

Building

With Anki add-on builder installed:

git clone https://github.com/glutanimate/syntax-highlighting.git
cd syntax-highlighting
aab build

For more information on the build process please refer to aab's documentation.

Contributing

Contributions are welcome! Please review the contribution guidelines on how to:

  • Report issues
  • File pull requests
  • Support the project as a non-developer

License and Credits

Syntax Highlighting (NG) is

Copyright Β© 2023- Antonio Cavallo

Syntax Highlighting is

Copyright Β© 2018-2019 Aristotelis P. (Glutanimate)

Copyright Β© 2015 Tim Rae

Copyright Β© 2012-2015 Tiago Barroso

Syntax Highlighting is based on Syntax Highlighting for Code by Tiago Barroso. All credit for the original add-on goes to him. A major thanks is also due for Tim Rae, who extended the original add-on with CSS support.

The present fork and update to Anki 2.1 was made possible through the generous support of a fellow Anki user who would like to remain anonymous.

Syntax Highlighting ships with the following third-party open-source software:

  • Pygments v2.17.2. Copyright (c) 2006-2023 by the Pygments Team. Licensed under the BSD license.

Syntax Highlighting is free and open-source software. The add-on code that runs within Anki is released under the GNU AGPLv3 license, extended by a number of additional terms. For more information please see the LICENSE file that accompanied this program.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.


<b> <div align="center">The continued development of this add-on is made possible <br>thanks to my <a href="https://www.patreon.com/glutanimate">Patreon</a> and <a href="https://ko-fi.com/X8X0L4YV">Ko-Fi</a> supporters. <br>You guys rock ❀️ !</div> </b>