-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Language display in the Show Language plugin #671
Comments
Could we update it automatically through a gulp task? Say, we insert a placeholder in the plugin's code, for example:
and we just replace it with the actual mapping, computed from the |
I’m not very familiar with the workflow, but it sounds like a good idea. Will this apply only to the minified version? |
I think both the dev and minified version should have the mapping code injected so they're functionally the same. One concern with just injecting via a gulp task is it would mean all languages are included in this plugin, even if you've only configured Prism with a couple of languages. So perhaps this should be incorporated into Thoughts? |
Incorporating it only in the Download page would prevent users from using the source files directly (that is, prism-core + any plugins + any components)... Furthermore, it is a really specific edge case. I don't really like the idea of inserting specific code everywhere to handle it. :( |
Hrm that's a good point. Having a closer look, there are only 14 languages with titles different to their internal names (ignoring case, e.g. powershell doesn't need to be mapped to PowerShell), so that's not going to add much to the file size. Gulp task should work fine, ideally I'd like both the dev and minified versions to include the mapping though. Time to learn more about gulp 😃 |
I would argue powershell does need to be mapped to PowerShell though. Case is important, especially to most programmers. I think most languages with only the first letter capitalised can be omitted, i.e. |
Wow that's great! Thanks @Golmote, that would have taken me a long time to figure out 👍 |
No problem! 😉 |
Currently only C++ and C# are processed, while all other languages are displayed just as in the class name, e.g. Python is “python”, and F# is “fsharp”.
Ideally this should show the “real” language name, not the identifier used by Prism. The simple way is to update
Languages
, but that information is already incomponents.js
, and it would obvious be a maintenance pain in the future to keep it updated. Any idea how this can be done more easily?The text was updated successfully, but these errors were encountered: