digego / extempore

A cyber-physical programming environment
1.4k stars 127 forks source link

GitHub support for xtlang #69

Open benswift opened 11 years ago

benswift commented 11 years ago

Currently, GitHub doesn’t recognise xtlang, and so syntax highlighting doesn’t work for .xtm files or gists.

Adding xtlang support to GitHub would involve writing a linguist parser for xtlang (inheriting from the existing Scheme parser would probably be a good place to start).

mrmagooey commented 8 years ago

As per the Linguist Contributing Guide we are still several hundred github repositories away from being able to contribute to Linguist and have xtlang recognised within Github with syntax highlighting. A search for extempore and xtlang within github only comes up with < 40 repositories currently.

Given that this is not an issue that can be addressed from within the extempore project, I suggest the issue is closed.

jasonlevine commented 8 years ago

But we can still make and share the extension with Extempore users in the meantime, right?

On Mon, Dec 7, 2015 at 2:51 PM, mrmagooey notifications@github.com wrote:

As per the Linguist Contributing Guide https://github.com/github/linguist/blob/master/CONTRIBUTING.md we are still several hundred github repositories away from being able to contribute to Linguist and have xtlang recognised within Github with syntax highlighting. A search for extempore and xtlang within github only comes up with < 40 repositories currently.

Given that this is not an issue that can be addressed from within the extempore project, I suggest the issue is closed.

— Reply to this email directly or view it on GitHub https://github.com/digego/extempore/issues/69#issuecomment-162429086.

Jason Levine new media performer + creative coder https://www.behance.net/jasonlevine https://www.behance.net/jasonlevine

mrmagooey commented 8 years ago

Is there a method of selectively distributing Linguist extensions? I got the impression we needed to contribute to the core Linguist library if we want syntax highlighting in Github.

ghost commented 5 years ago

I found a workaround to get syntax highlighting for .xtm files on github without any upstream changes to linguist. Linquist already knows about scheme, and it supports language overrides with emacs file variables. So, adding this to the top of a .xtm file will cause linguist to use scheme syntax highlighting:

;; -*- mode: scheme -*-

It works for gists and regular files in github: fmsynth-xtm-with-modeline

According to the linguist manual override documentation It might be possible to get the same effect for all .xtm files in a repository by creating a .gitattributes file like this:

*.xtm linguist-language=Scheme

But, when I tested that approach in my fork, it didn't seem to work. The comments in linguist issue 1792 suggest that it ought to work but that caching on the github end can be an issue. Perhaps I didn't wait long enough. Maybe it only works for commits in the master branch. [edit: I didn't wait long enough. I just went back to check one more time, and it seems like all the .xtm files in my fork are using scheme highlighting now]

benswift commented 5 years ago

Yep, that's a good catch - thanks @snowquiet . I'll check that it doesn't break anything else and make the change.