gregorias / anki-code-highlighter

Anki plugin for code syntax highlighting.
GNU Affero General Public License v3.0
55 stars 3 forks source link

Improve adding/removing import statement on note types #21

Closed 3ter closed 1 year ago

3ter commented 1 year ago

To not clutter note types I'd like to have them sectioned with a static comment (with which the section can be deleted as well instead by the regexp) https://github.com/gregorias/anki-code-highlighter/blob/d755c52266d26b48bda160791a1b7d845f0f6c16/codehighlighter/assets.py#L150 e.g.

[...]

<!-- Anki Code Highlighter (Addon 112228974) BEGIN -->
<link rel="stylesheet" href="_ch-pygments-solarized.css" class="anki-code-highlighter">
<link rel="stylesheet" href="_ch-hljs-solarized.css" class="anki-code-highlighter">
<script src="_ch-my-highlight.js" class="anki-code-highlighter"></script>
<!-- Anki Code Highlighter (Addon 112228974) END -->

instead of adding it directly after the card definition

[...]
<link rel="stylesheet" href="_ch-pygments-solarized.css" class="anki-code-highlighter">
<link rel="stylesheet" href="_ch-hljs-solarized.css" class="anki-code-highlighter">
<script src="_ch-my-highlight.js" class="anki-code-highlighter"></script>
gregorias commented 1 year ago

Thank you for reporting. Sounds initially like a good idea. I'll get to it when I have some time.

gregorias commented 1 year ago

@3ter, you'll need to refresh your assets after fetching the update (Tools > Refresh Code Highlighter Assets on macOS).