syntax-highlighting icon indicating copy to clipboard operation
syntax-highlighting copied to clipboard

syntax-highlighting ng (new fork)

Open cav71 opened this issue 1 year ago • 2 comments

Checklist

Please replace the space inside the brackets with an x if the following items apply:

  • [x] I've verified that I use the latest version of the add-on by redownloading it from AnkiWeb
  • [x] I've verified that I use the latest version of Anki by checking at https://apps.ankiweb.net#download
  • [x] I've checked if anyone else suggested this feature before by looking through the issue reports.

Problem case

So far it looks there are quite few issues in the backburner, due to a combination of lack of manpower (likely), old code support (eg. mixed py2/py3) etc.

Solution

I decided to fork it and try to address them into a new fork called syntax-highlighting-ng.

The main goals here are:

  • support fully python 3.x (no backward compatibility)
  • use only anki21 (no backward compatibility)
  • start to refactor the code base so it is locally testable without using the main application (pytest)
  • support for mypy/ruff/black out of the box on commit (pre-commit)

The source is located here and the new addon is here.

cav71 avatar Dec 19 '23 11:12 cav71

Too bad you didn't actually "fork" the repo, but re-uploaded the code. Otherwise we would have a nice way of comparing your changes with the original code and assess if your changes are safe to use.

Barabazs avatar Apr 16 '24 12:04 Barabazs

I wouldn't re-uploaded the code if the changes were smaller, the new version introduces:

  • a newer pygments under libs using a whl file (easier to manage/update)
  • drops support for older anki20 (that means less code to maintain)
  • typing!
  • support for pre-commit (eg. it helps to keep the code clean)
  • adds tests!
  • support github workflows on the commit

As well cleaning up the code and cover it with a set of tests (that should make easier to maintain)

You can check out latest version of both and see the differences side by side, the code retain the original structure, to make the comparison easier (that was a deliberate choice).

cav71 avatar Apr 17 '24 11:04 cav71