typora-issues icon indicating copy to clipboard operation
typora-issues copied to clipboard

[Feature] Auto-update/notification system for third-party themes

Open jhildenbiddle opened this issue 1 year ago • 0 comments

I am the author of Typora Themeable, and I would love to see Typora offer some form of update/notification system for third party themes.

Nobody wants to manually check websites and GitHub repos for software updates. This is why Typora includes an update/notification system to keep itself (the app) up to date. Unfortunately, manual check are exactly what Typora uses are expected to do today if they want to keep their preferred theme(s) up to date. Considering that even small, simple changes made to Typora can necessitate a theme update, some form of update/notification mechanism that keeps both app and third-party themes up to date feels like a critical feature.

A few quick thoughts...

  • Meta data used for the update/notifcation system could be stored in each theme using a structured CSS comment syntax. Alternatively, the theme file name could be used as a link back to YAML meta data associated with each theme available on themes.typora.io.
  • Ideally, the update/notification system would allow for 1) notification with automated updates on approval (default), 2) full automatic updates, and 3) the ability to disable the update/notification system.
  • The update system should only write "safe" files to disk on updates (css, jpg, png, webp, etc).

Another option is to embrace the @import rule and remote URLs for loading themes. CDNs like jsDelivr.net make public GitHub content available automatically, so theme authors can have their changes released to the public simply by committing their changes and (optionally) adding tags to specify versions:

/* Latest */
@import "https://cdn.jsdelivr.net/gh/jhildenbiddle/typora-themeable/dist/themeable.css"

/* Latest v1.x.x */
@import "https://cdn.jsdelivr.net/gh/jhildenbiddle/typora-themeable@1/dist/themeable.css"

/* Latest v1.0.0 */
@import "https://cdn.jsdelivr.net/gh/jhildenbiddle/[email protected]/dist/themeable.css"

Loading themes via remote URLs using @import works today with one major caveat: themes fail to load properly when off-line. Typora would need to handle this scenario, presumably by cacheing local copies of remote themes.

Happy to discuss further and work out the details. Thx!

jhildenbiddle avatar Sep 09 '22 04:09 jhildenbiddle