eeue56 / derw

An Elm-inspired language that transpiles to TypeScript
BSD 3-Clause "New" or "Revised" License
375 stars 9 forks source link

Syntax highlighting on GitHub & GitLab #4

Closed toastal closed 2 years ago

toastal commented 2 years ago

https://github.com/github/linguist/blob/master/docs/overrides.md https://docs.gitlab.com/ee/user/project/highlighting.html

Users on GitHub and GitLab platforms should be able to see .derw files with syntax highlighting using the elm syntax highlighter. This addresses the latest blog's beef with GitHub and also is an example for users on how to get their own syntax highlighting in the meantime until highlighting got merged upstream to Linguist and Rouge as well as finally trickling down to into GitHub and GitLab's dependencies respectively.

eeue56 commented 2 years ago

Currently not thinking about support for Derw on Gitlab (mostly due to my own inexperience with Gitlab). But should this be added as part of derw init rather than the root of this repo? So that new derw projects get the syntax highlighting?

toastal commented 2 years ago

Why not both? More it's if someone wants to fork this repository over to GitLab they would/could have support.

I empathize with your feelings about people wanting to see syntax highlighting while browsing over source code and examples. PureScript while small, has enough projects to get highlighting on some platforms but not others and it feels weird seeing my *.{dhall,purs} files in plain black and white. It makes it feel like they are insignificant and unsupported languages.

toastal commented 2 years ago

@eeue56 Linguist for GitHub can also be overridden. See example in my patch repo: https://github.com/toastal/derw/blob/patch-1/examples/complex_union.derw

This said, maybe PureScript or Haskell is a better lexer option for Linguist (PureScript unsupported by GitLab+Rouge). Open to suggestions.

eeue56 commented 2 years ago

Great tip! I've added this to derw init now, and added it to my already existing derw packages

toastal commented 2 years ago

Looks good in the repo!