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

Please remove the confusable instruction about Marp #18

Closed yhatt closed 3 years ago

yhatt commented 3 years ago

Hi, I'm a maintainer of Marp that is mentioned in the current README.

Marp is supporting only the core languages in highlight.js and has never contained any support of extra languages provided by 3rd-party plugins. The current README looks as if Marp has a native support of code highlight for iecst but this is not true. I'm worried this instruction makes misleading and confusion to our users.

As same as said @joshgoebel in https://github.com/highlightjs/highlightjs-structured-text/issues/15#issuecomment-766397462, Marp team also have the same view: it's a users responsibility to install not core languages into our tool.

And I think how to use in a specific tool which is not familiar to the most of highlight.js users should describe in that tool, not in this plugin. Please not include the useless information for 99%+ users of highlight.js.

BTW, I've already described how to install this plugin into Marp in https://github.com/highlightjs/highlightjs-structured-text/issues/9#issuecomment-686326994.

joshgoebel commented 3 years ago

Perhaps your snippet should be added to the README if the wish is to use a Marp example? Though really it's just Markdown code... though mentioning it in the abstract isn't very useful since it just begs the question of "How do use this with Markdown?" of which the answer might be Marp?

So Marp doesn't use Highlight.js out of the box at all, correct? I was just looking at your package.json and didn't see it.

I wonder if your example isn't honestly more of a "How to use Marp with Highlight.js" rather than anything that has to do with this plugin specifically?

yhatt commented 3 years ago

Perhaps your snippet should be added to the README if the wish is to use a Marp example?

Right. But I think my snippet is for a tiny part of advanced users and the most of Marp users should not need it too (in my opinion).

So Marp doesn't use Highlight.js out of the box at all, correct? I was just looking at your package.json and didn't see it.

Actually, Marp is using Highlight.js bundled to our core (https://github.com/marp-team/marp-core/blob/43924f08a0fed9610741599a74f8a8a53580f8e4/package.json#L116). So most Marp users can use syntax highlight of Highlight.js core langs in Marp Markdown.

I wonder if your example isn't honestly more of a "How to use Marp with Highlight.js" rather than anything that has to do with this plugin specifically?

Partially yes: more precisely "How to use Marp with CUSTOMIZED Highlight.js". Either way, it's not limited to this plugin specifically.

This fact is also a reason why I thought should describe that example in the Marp community (such as discussions) rather than Highlight.js.

joshgoebel commented 3 years ago

If you exposed the HLJS instance it'd be easier for advanced users to extend HLJS without all that boilerplate from your first example.

const marp = new Marp()
const hljs = marp.hljsInstance()
const iecst = require('highlightjs-structured-text')
hljs.registerLanguage("ices", iecst)

Or perhaps Marp allowing passing in an instance?

const marp = new Marp({hljs: externalHLJS})