-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: Move emoji short code to separate plugin #2431
Comments
👍 |
Nice solution. 👍 And I think we should mention that this plugin recommend to use the |
If it is published with Docsify, not a separate package, users will need to use the Docsify version. It will be easier to manage it that way instead of a separate package. F.e. it would be in here: https://unpkg.com/browse/[email protected]/lib/plugins/ Thoughts? |
I think It can not published with Docsify since they have different releases purpose.
When user use the |
That may be true unless at some point we change the plugin system in a breaking way. hmmm |
Yes...The compatibility between the plugin and docsify is a qustion. |
I think we are best served by advising users to include consistent version locks in all of their CDN URLs specifically for the reason @trusktr mentioned:
For sites using Docsify v5, all Docsify CDN URLs should contain at least a major If site admins want to mix-and-match bundles from different Docsify versions, there is nothing stopping them from doing so. For example, a v5 site could load the v6 emoji plugin using This approach is easy for us to explain, easy for users to understand, and it prevents sites from breaking when new versions are released. It's also how everyone's phone and computer emoji updates work: new emoji require an update; If you don't update, you don't get new emoji; and when a new major version of a platform is released (iOS 17 => 18, macOS 14 => 15, or Docsify 5 => 6) older versions typically stop receiving updates for things like new emoji so you probably want to upgrade if having the latest emoji is important. |
Hi @jhildenbiddle . I suppose we should do the emoji-plugin release in the
|
Yes. Until we have a reason to do otherwise, I think we should keep doing what we've been doing in v4: releasing plugin updates as part of each new Docsify release. I believe this is the simplest method of maintaining and publishing plugins for Docsify. The downside is that any time we want to publish a change to a plugin, we're forced to publish a new Docsify version. This sounds bad in theory, but in practice it hasn't been an issue at any point during Docsify v4 (that I am aware of). An important benefit of bundling plugins with Docsify release is that all Docsify resource (library, plugins, and themes) are guaranteed to work together so long as a user's version locks are consistent (e.g.,
For Docsify, this feels more like a theoretical problem than a real-world one. It's far more likely that the driver of breaking changes and new major releases will be Docsify itself, not our plugins. Worst case scenario: breaking plugin changes just have to wait until the next major Docsify release. If this ever becomes an issue, we can re-evaluate our approach then. |
Adding another option to consider if/when this issue is worked on... An emoji font (e.g. Noto Emoji) would be an interesting alternative to image-based emoji for consistent emoji across operating systems. In addition to making this option available as part of our emoji plugin, we could also provide instructions for installing one of these fonts in our Quick Start guide for those who want consistent emoji but prefer not to use our emoji plugin for shortcode support to to optimize site performance. |
👉 Note: This is a post-v5 feature request (see Milestone)
Feature request
:+1:
= 👍)Proposal
Significantly reduce the file size of the core Docsify library by removing emoji short code support and instead offering it as an official plugin.
Removing short code support (
/src/core/render/emoji-data.js
) provides a 53% reduction in the minified Docsify.js bundle size.An official Docsify emoji plugin would provide both short code support (e.g.,
:+1:
= 👍) and the ability to render GitHub-style emoji images instead of OS-native emoji characters for those who want consistent emoji across all platforms (as Docsify v4 does today by default).IMPORTANT: Removing short code support does not mean Docsify will be unable to render emoji without the plugin. This change only requires markdown authors to use their OS-native emoji picker to add emoji to their markdown documents instead of short codes. Those emoji will work as expected in Docsify, GitHub, and in other markdown applications, which arguably makes their markdown more portable since not all markdown environments support GitHub short codes.
For context...
Docsify's emoji short code support has been included in Docsify since v4 was released in 2017. This was a convenient way for those familiar with GitHub short codes to render emoji in their Docsify sites. More importantly, it was also the only way for Windows and Ubuntu users to easily add emoji to their Docsify and GitHub-flavored markdown because those operating systems lacked a native emoji picker:
Thankfully, all major operating systems now support native emoji pickers which are easily accessible via a keyboard shortcut:
These native emoji pickers reduce--but do not eliminate--the need for emoji short codes because users can now easily add native emoji characters to their markdown documents.
The text was updated successfully, but these errors were encountered: