Bỏ qua đến nội dung

Syntax Highlighting (NG)

Chờ xử lý #anki #addon #syntax #highlighting
https://github.com/cav71/syntax-highlighting-ng
19/7/2024

Cách tải addon Syntax Highlighting (NG)

Bạn có thể tải addon bằng một trong hai cách sau:

Click nút Copy bên dưới để copy code vào clipboard

566351439

Sau đó mở Anki → Tools → Add-ons → Get Add-ons → Dán code → OK

Mở trang addon trên AnkiWeb và tìm mã code ở cuối trang

Mở trên AnkiWeb

Cuộn xuống cuối trang AnkiWeb, tìm dòng có mã code 566351439 và copy

40
3

Mô tả chi tiết

This is a new fork from the original “Syntax Highlighting for Code” (see References below).

Allows you to insert syntax-highlighted code snippets into the spaced-repetition flashcard app Anki.

The main reasons to create it is:

fix these issues: PR46 PR47 clean port to python 3 adds unittests always target the latest Anki version (eg. 2.1) References Syntax Highlighting for Code release syntax highlighting FORK (css only, night-mode) release


Screenshots

Source code

License - GNU AGPLv3

linting - Ruff

types - Mypy


Liên kết hỗ trợ


Reviews (30)

👍 2026-02-20

Honestly… I feel bad rating this badly, because I was very grateful for the fork while it was alive. I wanted to do it myself but just didn’t have time to jump down the rabbit hole.

Anyway, I wanted to leave this comment for any future viewers/Anki-lovers that want to spice up their cards with some syntax highlighting: someone else made their own version that, after ~1 year (I think?), has worked great for me! If I am being completely honest, I did like these original extensions more due to a

👍 2025-12-30

Don’t work

👍 2025-08-03

Thanks for taking the time to revive this project! Unfortunately, it seems to have a few bugs…

  1. Language selection does not work. It always uses Python.
  2. Styling seems to be broken. It no longer applies background coloring, code lines are not properly styled, etc.
  3. Language selection in preferences is broken. E.g. try to specify “C#”. The language selection dropdown will list “Python, C, #”. If you specify “CSharp” instead, the dropdown will offer “Python, C, S, h, a, r, p”.

👍 2025-07-16

It works!

👍 2025-07-12

Hi I’m add-ons developer Shigeඞ! I fixed and customized this add-on for Anki25.04+ and uploaded it to AnkiWeb. ⚡️Syntax Highlighter - Quick highlight Code for Editor https://ankiweb.net/shared/info/272582198

👍 2025-06-24

Works, old one doesn’t

👍 2025-04-18

Works like a charm!

👍 2025-03-30

Works!

👍 2025-03-09

This works, including with cloze deletion (at least in regular mode, unfortunately illegible in night mode), and offers support for lots of languages.

👍 2025-02-27

Thank you for your work this add-on is perfect and very necessary! Wondering if there’s a way to format the text to wrap to fit a phone screen so we don’t have to scroll to see the whole code snippet! Works perfect on laptop/pc though.

👍 2025-02-21

thank you

👍 2025-02-05

Thank you for fixing this!

👍 2024-12-29

For anyone having problems with dark mode, just change the style of the addOn in config to to dark themes in https://pygments.org/styles/

👍 2024-12-16

Works as expected. Thank you. It would be nice if it was easier to change lang list. I tried “c++” and “go”, but it was a mistake, one has to put “C++” and “Go”, first letter uppercase; that’s not intuitive; Also at least on Android, when dark system theme is enabled some identifiers are hardly readable against background

👍 2024-11-03

This addon is recommended for who wants learn programming language / coding

👍 2024-10-28

This is a fix version to https://ankiweb.net/shared/info/1463041493

👍 2024-08-12

Awesome!!

👍 2024-07-20

Great stuff

👍 2024-07-17

Thanks!

👍 2024-07-08

works like a charm

👍 2024-06-11

Life Saver! Thanks!

👍 2024-06-11

Thank you!

👍 2024-05-30

You sir are the man!

Thank you for bringing back my favourite Addon! Words simply cannot express my gratitude!

👍 2024-05-28

Nice! In response to hereunder question “is there a way to turn off the line numbering?”: Go to Tools > Syntax highlighting options > uncheck “Line numbers”.

👍 2024-05-25

Thank you so much for updating this plugin 🙏

👍 2024-05-22

Finally 🎇 the long wait is over! Happy to use my old .css files “@import url(“_styles_for_syntax_highlighting.css”); ” You are my savior 😊 Thanks a lot. i appreciate the work a lot!

👍 2024-04-17

Thank you so much!

👍 2024-04-12

very useful. thank you.

👍 2024-04-05

Works again!

👍 2024-03-23

Thanks for making this plugin work for the latest version of Anki!