-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Add Glimmer to SUPPORTED_LANGUAGES #3123
Conversation
Now I'm trying to figure out what to do (if anything) about the fact that you take the same aliases we ship... so installing your plugin REPLACES our built-in functionality... I think that's a first. Not sure if we need to disallow that (probably too drastic) or merely call it out, or what... I assume you think that is a feature not a bug? :) |
I'm thinking since Handlebars still exists outside of Glimmer/Ember ecosystem that the aliases (by default) might not be correct. That someone should have to manually link them up if that's the behavior they desire. |
yes, a feature :D The issue primarily comes from Glimmer files reusing the hbs extension.... but... 🤷 However,
My plugin doesn't actually register itself, you need to do that manually via: import hljs from 'highlight.js';
import { glimmer } from 'highlightjs-glimmer';
hljs.registerLanguage('glimmer', glimmer);
hljs.highlightAll(); which, idk.. I could do in the plugin, but that's a side-effect, and side-effects are generally less flexible in broader ES modules (even though probably totally fine for how highlightjs is used) |
You should also ship a CDN distributable in Aliases always self-register though whenever the language is registered with
Which means that Trying to avoid surprising behavior. |
workin on that now 👍
I get that -- and I understand that this may be surprising behavior to someone, but Glimmer is kind of a superset of handlebars, buuuuut, more importantly, I have a feeling the number of people in the world that would want both syntaxes is < 10 |
kind of indeed. 😄 And then the question is why not go all the way and also clobber I think at a minimum your README should perhaps mention (as a "caveat") that it clobbers those aliases and someone would need to re-register them to point to @allejo Any thoughts on this? |
yeah, moreso this. The term handlebars is rarely used in the Glimmer/Ember world, except when talking about the file extension itself.
I did add this (very recently):
|
But that's wholly inaccurate (or at the very least imprecise) no? One can easily do:
So long as you're leaving |
👍 I'll update the verbiage: NullVoxPopuli/highlightjs-glimmer@4a239f2 |
@allejo Any objections? I'm "ok" after this README change I think. |
Add to changes.md too please? |
added! |
@NullVoxPopuli Thanks! |
Adds Glimmer highlighting plugin to list of supported languages