glutanimate / review-heatmap

Anki add-on to help you keep track of your review activity
https://ankiweb.net/shared/info/1771074083
Other
1.2k stars 90 forks source link

Why do you host the CSS online instead of having the user download it along with the add-on? #57

Closed nickdvlpr closed 4 years ago

nickdvlpr commented 4 years ago

I'm just wondering about your reasoning because I'm considering doing the same for my add-ons. Is it so that you can "update" the appearance of the add-on without requiring the user to download an update on AnkiWeb?

Specifically referring to this file: review-heatmap/resources/web/review-heatmap.css

Thanks!

glutanimate commented 4 years ago

Hey! Sorry, busy week. The files under /resources are actually loaded into Qt's resource and then accessed from there instead of reading from the disk directly. This was mostly a concession to trouble with unicode paths in Anki 2.0, and security policies against local filesystem access in early Anki 2.1 releases. Nowadays it's simple enough to load CSS & JS in directly, and in the next major release that's the approach Review Heatmap will also likely be taking. Hope that explains things!

glutanimate commented 4 years ago

Closing this for now, but if you have any follow-up questions feel free to shoot away.

nickdvlpr commented 4 years ago

Thanks for the info! Would there be a good way to change the colors of Review Heatmap for my own personal use? Specifically the grays used for the background of the boxes.

glutanimate commented 4 years ago

There is no API or anything, but you can just inject your own CSS in the respective views and overrule the add-on's default CSS: https://github.com/glutanimate/review-heatmap/blob/master/resources/web/review-heatmap.css#L222

Injecting your own CSS should be fairly easy if you use the new webhooks in Anki 2.1.21 and up.