webc icon indicating copy to clipboard operation
webc copied to clipboard

Add webc syntax highlighting to GitHub by default

Open caseywatts opened this issue 4 months ago • 1 comments

Hello!

On a project I'm working on, I want syntax highlighting for .webc components on GitHub, and so I'm using the .gitattributes workaround to get GitHub highlight appropriately.

.gitattributes

*.webc linguist-language=HTML

This works well enough, but it's something we could make work by default!

If we wanted to add this, it looks like we could open a PR to the linguist repo to add .webc as a recognized-by-default extension. We could map .webc to HTML, like the .gitattributes workaround does now. https://github.com/github-linguist/linguist/blob/main/CONTRIBUTING.md#adding-an-extension-to-a-language

Open questions

  • Can we prove that at least 200 unique :user/:repo repositories? That's one of their requirements (I think so!)
  • What are some good code examples of .webc? They ask for some real-world examples.
  • Do we have a "TextMate-compatible grammar" for webc already? If not, I wonder how hard that would be to make? That would help with highlighting in the situations where webc and html don't match perfectly (as opposed to just using HTML directly).
  • In the meantime, can/should we add the .gitattributes workaround to the documentation site? What would be a good page to add that to?

caseywatts avatar Oct 15 '25 20:10 caseywatts

here's my VSCode extension to help with authoring TextMate grammars https://marketplace.visualstudio.com/items?itemName=RedCMD.tmlanguage-syntax-highlighter

RedCMD avatar Oct 16 '25 06:10 RedCMD