highlightjs / highlightjs-terraform

terraform language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maintainers

gusbemacbe opened this issue · comments

Hello @joshgoebel

Maybe @4ops, @antonbabenko, @radeksimko, and @jpogran may be interested in maintaining and upgrading this repository because I saw them having built syntax highlighting for Terraform.

Hi @gusbemacbe,
You are right that we recently published https://github.com/hashicorp/syntax with both HCL and Terraform TextMate grammars (which currently powers https://github.com/hashicorp/vscode-terraform). We have not discussed HighlightJS within our team and there are currently other priorities on our roadmap.

However, last time I was looking at what other grammars & highlighting engines we could possibly support as part of https://github.com/hashicorp/syntax HighlightJS did not come up.

For the ones which did come up, aside from the ones focused primarily on IDEs (e.g. TreeSitter), PrismJS was pretty much on the top because it powers highlighting of all code samples on HashiCorp's websites (e.g. https://www.terraform.io or https://www.packer.io).

Just so we can assess the end-user impact and consider the potential maintenance costs - can you mention any particular websites which actively use it or name some benefits compared to PrismJS?

Thanks.

@radeksimko

I am not expert about it, but @joshgoebel can help in this case.

Just so we can assess the end-user impact and consider the potential maintenance costs - can you mention any particular websites which actively use it or name some benefits compared to PrismJS?

Although I am not expert, I can tell Stack Overflow use it for their sites and VSCode use it for Markdown (see https://github.com/microsoft/vscode/search?q=hljs)

Yes, Stackoverflow is a big example. If I cared more about marketing I'd certainly have more to share - but by number of downloads we're quite close to Prism IIRC. We do support rudimentary auto-detection, I dunno if Prism does that. I think other than that it possibly comes down to preference, languages supported, etc...

I do think it's good there are TWO engines to choose from vs just one - a little friendly competition.

For the VS Code use case - I'm not sure I fully understand the impact there - I see it's used in the context of Markdown rendering - but I am not sure when/where would I (as a VS Code user) encounter that. The VS Code highlighting engine on its own is still AFAIK driven by TextMate.

However, that StackOverflow example is useful - thank you for that!

I will put HighlightJS on the list, so we can consider it and discuss it alongside other grammars, when we next get to plan some more work on highlighting, but at this point I cannot really promise anything. To keep it honest, it is very likely that PrismJS will be given a priority for the reasons I mentioned.