Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub syntax highlighting to *.janet files #433

Closed
elimisteve opened this issue Jun 27, 2020 · 11 comments · Fixed by #434
Closed

Add GitHub syntax highlighting to *.janet files #433

elimisteve opened this issue Jun 27, 2020 · 11 comments · Fixed by #434

Comments

@elimisteve
Copy link
Contributor

Looks like this may be the easiest way to do that: https://github.com/github/linguist#using-gitattributes

@bakpakin
Copy link
Member

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.

@janet-lang janet-lang locked and limited conversation to collaborators Jun 27, 2020
@janet-lang janet-lang unlocked this conversation Jun 27, 2020
@elimisteve
Copy link
Contributor Author

@bakpakin They closed that PR: github-linguist/linguist#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.

@sogaiu
Copy link
Contributor

sogaiu commented Jun 27, 2020

@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...)

@elimisteve
Copy link
Contributor Author

@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: #434

@andrewchambers
Copy link
Member

andrewchambers commented Jun 27, 2020

clojure syntax highlighting falls flat for many real janet examples, they syntax have differences, so I would rather have none or a correct one.

@elimisteve
Copy link
Contributor Author

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

@pyrmont
Copy link
Contributor

pyrmont commented Jun 27, 2020

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.

@sogaiu
Copy link
Contributor

sogaiu commented Jun 27, 2020

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.

https://github.com/rouge-ruby/rouge/blob/f31a5eeba00c2f7ed9ee9eb4cc3f06bf9161df53/lib/rouge/lexers/clojure.rb

@elimisteve
Copy link
Contributor Author

@pyrmont Indeed, hence my creation of #434 for the time being.

@sogaiu
Copy link
Contributor

sogaiu commented Jun 29, 2020

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

@sogaiu
Copy link
Contributor

sogaiu commented Jul 5, 2020

Thanks to @pyrmont's improvements and fixes, Rouge may gain support for Janet in its next release: rouge-ruby/rouge#1558 (comment)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants