
For quick syntax highlighting of code in Anki's Editor. Select the code and press the ⚡️electric button to auto add highlighting. (or paste from the clipboard)

Credit
This add-on is a fixed and Custmized version for Anki25+ of the addon "Syntax Highlighting (NG)" and "Syntax Highlighting for Code", originally created by Tiago Barroso, Tim Rae, Aristotelis P. Glutanimate, C A. Cavallo, and credit goes to them (AGPL). Syntax highlighting is executed by bundling pygments (BSD).
How to use
This customized version includes support for the latest Anki 25.04+, user interface enhancements, code updates and optimizations. Added functions to auto add CSS, select line numbers, etc.
Select the code or paste from the clipboard.

Option

Line number
- Show line numbers
- Show numbers at the beginning of each line of code.
- Always input start line number
- If this option is enabled, you can input the start line number in the dialog that pops up when you run the syntax.
- Default line number
- Sets the default line start number.

Center code fragments
- Change whether code is left-aligned or centered.
default to last language used per deck
- Auto save and use the last used programming language for each deck.
Font Size
- Change the font size of the code. You can also change it by editing the HTML directly.
Hotkey
- Sets a shortcut key to run a highlight.
Enable CSS classes
Enable this option to highlight using CSS instead of inline highlighting.

- CSS mode can be easily changed with the theme option, and can be auto change in night mode and light mode. Inline mode is not possible.
- CSS is auto added to the notetype style when syntax is added.
- CSS mode does not show highlight colors in the editor, but in the reviewer or previewer. Default inline highlighting can show color in the editor.
- Default inline highlighting has colors embedded in HTML, so you cannot change the theme like in CSS mode.
- The auto-generated CSS files are auto saved in the media folder.
Language

- You can select which languages to display in the drop box in the editor, and rearrange them by dragging and dropping.
StyleSample

- You can view a sample of syntax highlighting and change the default theme.
- Inline mode is the default highlighting. The highlight is embedded and cannot be changed later.
- If CSS mode is enabled, you can set light mode and night mode themes respectively. All highlighting will be changed when the theme is changed.
Enable CSS Note Type
CSS mode automatically adds CSS to the card. This option allows you to batch remove or add CSS added to the note type style. If you are not using the CSS mode option this option does nothing.

- All-ON, All OFF button
- Batch select or deselect note types.
- Batch Update Notetypes button
- Press this button to batch add or remove CSS.
- Note that the optional Save button does not save NoteType changes.
- Note type changes cannot be canceled with the optional Cancel button, but can be undone in a batch with Anki's Undo.
- This option edits all note types at once, so if you are concerned I recommend making backups of your decks before running this option.
- CSS can be added or removed manually, only this one line is needed. ->
@import url("_shigeSyntax.css");
🚨Report
If you have any problems or requests feel free to send them to me.
- 👍️Rate Comment : You can contact me anonymously, and AnkiWeb will send you an email when I reply, a high rating increases priority of development.
- 👩🚀Reddit : You can request me to repair broken Add-ons.
- 🌟AnkiForums : You can request me to repair broken Add-ons, and it is ideal for open discussions.
- 🐙Github : Makes it easier to track problems.
- 💖Patreon DM : Response will be prioritized.
Hi thank you for using this add-on I'm Shigeඞ!
- [ 🛠️Fix add-ons ] So far I fixed and customized 80+ broken add-ons for free and developed over 30 add-ons as a hobby (all add-ons). If you have requests to fix broken add-ons feel free to contact me. Fix broken addons (Free)
- [ 💖Donation ] I'm looking for supporters for my add-ons development because I like Anki!👍️ If you support my volunteer development you will get 14 add-ons for patrons only and 15 game themes included in AnkiArcade ($5/month).

Get Patrons only addons | Patrons Q and A | Contact
[ Special Thanks ]
So far I received donations from 702 patrons and without their support I never could develop this, thank you very much!🙏
Patrons:
Arthur Bookstein
Haruka
Luis Alberto, Letona Quispe
07951350313540
Tim
NamelessGO
Kyle Mondlak
Daniel Kohl-Fink
ElAnki
Lily
Abhi S
findus161
K
Juan Salgado
Peasant of Anki
Matthew Hartford
Jesse Asiedu
David C
Yaeerrrrrr
Christopher Lam
Xiuxuan Wang
Steven Banner
Heidi
Aydin Herik
gus forester
Hoang Hung
Take Root
Iggi
Jonathan Contreras
Carly Burdorf
Austin Regal
Terence Bartenbach
Vivian Cao
Pansanity
Anh-Tai Nguyen
Elisabeth Barber
Zarina Balde
Devon Williams
Leonora Lomoki Akporyoe
Ernest Chan
Kmyungc
Will S.
Meeyah Davis
Eric Allen
Andrew Yick
Robert Remedios
GP O'Byrne
Joseph Howell
Orlando Frey
KM
Ujwal Chadha
Kolorophyll
Jake Stucki
Kaitlyn Bowler
Isabel Guan
Mia
Kyle Anthony
ellie
Tobias Klös
mootcourt
Marlee Davis
Seth Stidham
Miguel Dittrich
Ali Abid
iuventius
Patrick ellis
Katherine Geromini
Nabeel Elhaj
tarek
Efrain Garcia Fonseca
qiting zeng
Muneeb Khan
Looptime IsAble
Hussain Almoumen
lionheart3003
Sameer Al
Matheus Chagas
Niiick
Bryn Price
pie_is_good
Svel1989
Jack
ivy tian
Zuhair
alpha male, shredded af
Brandon Anamah
Keeler Kime
Yashar Hadi
Kurt Grabow
Justin Magda
Subhash Gutti
alex han
Celeste Achatz
Gabriel Farrugia
R Rebecca
Audreylyn Shannon
Pneumaniac 1
Lis Y.
Jolene Galbreath
Fahim Shaik
Augusto Stein ...full list
📥 How do I install this add-on?
- This add-on works with Anki for desktop (it does not work on mobile). Download Anki from the official website if you haven't already.
- Copy and paste the add-on code (
272582198 ) into Anki and you can install it. ( Menu -> Tools -> Add-ons -> Get Add-ons -> Code [ add-on code ] )
- When I develop bug fixes, create new features, or compatibility for New Anki, I will notify you and you can install it.
- Add-ons will be broken when the official Anki gets a major update, so if you like this add-on please support my volunteer development by rating, sharing, and donating. Thank you!
Click here and please Rate this add-on, Thank you! :-)
