highlightjs / highlightjs-structured-text

Highlightjs Structured Text language support IEC 61131-3
BSD 3-Clause "New" or "Revised" License
20 stars 6 forks source link

This is very frustrating #22

Closed Serhioromano closed 1 year ago

Serhioromano commented 1 year ago

@joshgoebel I was first who implemented your new model for files, and I never got into the list of languages. Even to this day anyone who install new version of HLJS, do not have this language there. On a demo site it is also not there.

It is so hard to promote highlights for not as much popular languages and I first added my language into main HLJS library to list of all other languages, but you asked me to create separate repo, and I do not have any advantages because of that. It looks like I am punished for doing what you want.

And I have already raised this subject.

What can we do that when people install or update HLJS my ST language is there?

joshgoebel commented 1 year ago

Why we do not do this has been addressed: the core team does not have time to maintain and support an ever growing number of languages in the core library. It's very easy to author and publish a 3rd party grammar... It's very easy for those who wish to use them to do so (usually with just a one/two line include). I personally don't think demo is a huge problem to only include a subset - thought perhaps we might say "and many more" with a link back to SUPPORTED_LANGUAGES just to tell people the list isn't exhaustive...

What can we do that when people install or update HLJS my ST language is there?

Nothing. But anyone could publish (and promote) a library that bundles ALL the 3rd party grammars into one big library, or even one big monolithic download (though that's huge and a bad idea IMHO - even with just core grammars). No one is stopping you from doing this (or anyone else in the community).

joshgoebel commented 1 year ago

or update HLJS

If someone has installed (or vendored) your grammar upgrading HLJS wouldn't remove it... so updating really isn't a concern...

Serhioromano commented 1 year ago

@joshgoebel Why we do not do this has been addressed: the core team does not have time to maintain and support an ever growing number of languages in the core library.

Nevertheless in the home page I see this.

2022-11-23 Version 11.7.0

New Grammars:

added 3rd party LookML grammar to SUPPORTED_LANGUAGES [Josh Temple](https://github.com/joshtemple)
added 3rd party FunC grammar to SUPPORTED_LANGUAGES [Nikita Sobolev][]
Added 3rd party Flix grammar to SUPPORTED_LANGUAGES [The Flix Organisation](https://github.com/flix)
Added 3rd party RVT grammar to SUPPORTED_LANGUAGES [Sopitive](https://github.com/Sopitive)

Just few days ago new grammars are added. And on /download page there is not my language in a selection list. Would it be fair if all languages are not there then? Why all those languages are there and mine is not? Why other languages are added 5 days ago and mine is not for years?

Maybe I do not understand something, but I feel like be in jail.

It's very easy for those who wish to use them to do so (usually with just a one/two line include)

It is actually not. I recently was asking to add my language in to stepik platform and they have all the languages instead of mine, because all those languages are backed with bundle. They cannot add new lines of code. They just install HLJS package and use all languages it has that is it. May be it is easy to connect new package but make it done is not. I created this package in a hope that with time ad HLJS is updated on different sites this highlight will appear there, but it come not to be true.

I understand that include everything might be too much but allow user to select all 3dp libraries on download page would be fair. Do you really believe I can successfully promote alternative HLJS package? What if someone need my language but do not need half of others? SO I have to create something like your download page where user can select language and only difference there is that there is my language. Not mine it is international standard of course used by industrial complex. But would that be easier just to add my language to the list of possible options on your download page?

joshgoebel commented 1 year ago

Why other languages are added 5 days ago and mine is not for years?

This is a misunderstanding. These are all 3rd party grammars (like yours), none of them are inside core, none of them are listed on Download - they are mentioned in the changelog for visibility - we starting doing that at some point. Structured Text is already mentioned in SUPPORTED_LANGUAGES (I checked).

May be it is easy to connect new package...

To be clear, I was referring to direct dependency users. If "stepik platform" uses Highlight.js as a direct dependency it is indeed easy (technically) for them to add new languages. They may choose not to do this, but that does not mean it's difficult. If they refuse to add 3rd party languages, that's their choice and something you should discuss with them.

They just install HLJS package and use all languages it has that is it.

Another misunderstanding. While this is possible, it's not usually true.. We only auto-bundle around 30-40 languages in our "common" build, and this is very restrictive on purpose (size). Most consuming services do NOT actually ship all 1st party grammars - nor do we even recommend this.. Even if we decided tomorrow to merge all 3rd party grammars that does not mean everyone using Highlight.js would suddenly gain access to them "for free" - each and every implementer would still need to decide which languages to bundle and which to not - exactly the same as is done today in many cases.

SO I have to create something like your download page

No. Anyone can just download your JS file and use it directly (with a second script tag), append it to the main download file, bundle it with their bundler of choice, etc. It takes 10 seconds.

I understand that include everything might be too much but allow user to select all 3dp libraries on download page would be fair.

This is a middle ground. But has issues. Often the core library drops or changes features as we move forward (major versions). Having all languages in our download page slows development, after every new release we'd have to figure out which languages still work, which ones don't, etc... it's already a considerable amount of work to do this with the core languages sometimes. Maintenance of existing grammars is a real cost. Also there are security considerations around the use of regular expressions. We try hard to police the core library for such matters.

The Highlight.js Team implicitly vouches for the stability and security of our built-in grammars, those we include in the "official" download tool. At this time it's simply not practical for us to review and vouch for all 3rd party grammars, so we don't provide them directly - we point to individual repositories and let the users decide.

Serhioromano commented 1 year ago

Understood.