Discuss: XML vs HTML - discoverability and one vs two grammars
See original GitHub issueopened issue as requested from @joshgoebel in our conversation from
Could you please consider this input for eventually upcoming new major-branches:
- put the language description file into the right folder (and maybe rename it with an “_” underscore at the beginning to be listed at the beginning) - so that when someone tries to find the correct language description files one has at least a chance to find help without asking someone:
https://github.com/highlightjs/highlight.js/blob/master/SUPPORTED_LANGUAGES.md https://github.com/highlightjs/highlight.js/tree/master/src/languages
- rename the XML description file into
HTML-XML
or at leastXML-HTML
- so that when one is used to the term HTML the proper HTML language description file is showing up
and finally, 3) just as proposal:
to think about the option of having three basic subsets, one that is optimised for xml-html-css-js
usage, one that is bundled for some-broad-but-special-programming-languages-used
and one that is the full metal jacket
release - which should only be used in rare cases of course - it would be so much more convenient … and for sure help a lot of beginners to find their proper way of using highlight.js from startup.
And for those geeks
and nerds
who really love to look into each file and tweak the shit out of everything there still is the option to bundle the language-files individually, which in turn will for sure find the _SUPPORTED_LANGUAGES.md
file in the correct folder.
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (8 by maintainers)
Oh I have a long memory for this kind of thing, particularly if it comes up over and over. I will close this for now and we’ll see if it comes up again in the future. People have been building languages using the download website for a long time as well where it’s listed as “HTML, XML” (and having no difficulties finding it).
In our SUPPORTED_LANGUAGES we already have it listed as “HTML, XML”… (so its alphabetical by H)… to me if someone was literally looking thru the file list in an editor and can’t find html the first thing i’d do is a text search for “html” and then it’d quickly be clear that
xml.js
is the name you wanted.So perhaps with v11,
html_xml.js
makes sense… but if it never comes up again, then it never comes up again. 😃Yes, I understand the distinction, but that effectively duplicates the code the way our build system is currently implemented (grammar modules are stand-alone, all dependencies are resolved at build time).
I suppose you could argue “HTML is more popular” or something… if we list both it seems one has to come first… so we either make it harder to find HTML or XML… I’m not convinced this is a big problem for many people since if you just throw “html” or “xml” at the library itself it “does the right thing” automatically.
It’s only an issue if you go looking for the file and don’t find an “html” file… then hopefully you’d go to the docs and find than XML/HTML are the same thing… so far you’re the only person to bring this to our attention as an issue.
I think it’s possible a simple fix here may be to just alter the official list to include “HTML” in alphabetical order and then refer someone to XML.