Closed elimisteve closed 4 years ago
There are already syntax highlighting files and an unmerged linguist PR, I’m closing this for now. The git attributes file was previously removed as I don’t think it is that important.
@bakpakin They closed that PR: https://github.com/github/linguist/pull/4674
Syntax highlighting helps those of us new to Janet read the code examples and makes Janet feel more "legit", but obviously it's up to you.
@elimisteve I believe others (including me!) would also like appropriate highlighting.
As you saw in that issue though, for whatever reason(s) the last attempt was not met favorably.
There was some discussion on the gitter channel about this topic and I believe one of the opinions that had some traction was to keep growing the various numbers until a subsequent attempt is made (or something like that).
FWIW, I think @katafrakt made this: https://isjanetthereyet.herokuapp.com/ (Not sure what went into it exactly.)
(Note that one of the entities that is influencing how "legit" something "feels" is none other than our hosts...)
@sogaiu That sounds like a good longer-term solution, but we can add syntax highlighting to the examples in this very repository by merging my one-line PR from earlier today: https://github.com/janet-lang/janet/pull/434
clojure syntax highlighting falls flat for many real janet examples, they syntax have differences, so I would rather have none or a correct one.
I tried Scheme too and it didn't help much at all, but using Clojure's syntax highlighting looks pretty fantastic to me: https://github.com/elimisteve/janet/blob/master/examples/life.janet
This isn't in our power to make. GitHub has to accept the Linguist PR and they won't do that until there are more repos.
On a side note, it seems possible that if Janet support were added to Rouge, syntax highlighting might get working sooner at gitlab:
https://docs.gitlab.com/ee/user/project/highlighting.html https://rubygems.org/gems/rouge
...and there's already a lexer for Clojure.
@pyrmont Indeed, hence my creation of https://github.com/janet-lang/janet/pull/434 for the time being.
FYI, after consulting with pyrmont, I've started a rouge lexer for Janet based on the Clojure one: https://github.com/sogaiu/rouge/tree/janet
Thanks to @pyrmont's improvements and fixes, Rouge may gain support for Janet in its next release: https://github.com/rouge-ruby/rouge/pull/1558#issuecomment-653834852
We release new versions of Rouge on a monthly cadence. The next version will be v3.21.0 and is scheduled for Tuesday 14 July. Depending on how you're using it (e.g. GitHub Pages, GitLab), it can take a bit of time before those projects start using the latest gem.
Looks like this may be the easiest way to do that: https://github.com/github/linguist#using-gitattributes