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
Github does not highlight Nix anymore #5109
Comments
Oh, that's unlucky! |
Sorry about that! Do you know of any TextMate/Sublime Text/Atom grammars for Nix? It doesn't look like it would be too hard to translate the Pygments lexer if not. I'm happy to help if you go that route. |
Unfortunately not. @aroben we'd love to get Nix support back into github. Are there any docs how to write grammar for TextMate/Sublime/Atom? |
I took a first stab at Sublime yesterday, and below is the YAML I have so Terrible Sublime docs are here: Better Textmate docs: Work in progress, but it already works a bit. Would like a BNF to syntax [PackageDev] target_format: plist, ext: tmLanguagename: Nix patterns: - match: "\b[a-zA-Z_][a-zA-Z0-9_'-]*"name: "id.nix"
On Tue Nov 25 2014 at 2:26:43 PM Domen Kožar notifications@github.com
|
Yep, those are the right docs. Your grammar looks like a good start! |
Ok here's a decent grammar: https://gist.github.com/wmertens/9f0f1db0e91bc5e3e430 (in the SublimeText YAML-tmLanguage format, I can make it CSON or whatever). @aroben how would I go about getting that into the github highlighting? |
Nice! Hopefuly @aroben can help us get back on track |
TextMate format is at https://gist.github.com/wmertens/ee3da82fd179549875ac Tested it with the .nix files in the tests for Nix and with a bunch of nixpkgs files. It absorbs everything and marks illegal things as illegal. (unfortunately it's not 100% a parser because regex highlighting is not a proper state machine). |
Nice! It might be good to do some quick tests with GitHub's highlighter too at https://lightshow.githubapp.com. It doesn't accept YAML grammars currently; I'll look into adding that. Once you're satisfied with your grammar, stick it in a GitHub repo with an appropriate license and follow step 2 of https://github.com/github/linguist/blob/master/CONTRIBUTING.md#i-want-to-add-support-for-the-x-programming-language and open a PR. Or ping me and I'll be happy to add it for you. |
YAML grammars can now be used directly with Lightshow. |
Impressive turnaround time @aroben 🍻! I opened github-linguist/linguist#1802. |
Alright, the grammar got accepted into the github highlighter, it should take no more than 2 weeks for the change to become visible. Here's an example of what to expect. @iElectric ok to close or should we keep it open as a reminder? |
Thanks! 🍻 Let's wait until the changes are in place. |
Highlighting should be working now. |
Yes, I can see it in the web-editor. However, I see no highlighting in regular file view, e.g. https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/all-packages.nix (but I do so e.g. for xml). |
@vcunat it works 😁 https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/make-tarball.nix all-packages is just too gigantic... it also gets cut off in search results. We should split it up in a bunch of files. |
@vcunat @aroben then again, https://github.com/NixOS/nixpkgs/blob/master/default.nix doesn't get highlighted and that's tiny... |
Yeah, I did try https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/lua-packages.nix before. |
@aroben another question, the online editor seems to be using the old highlighter, any way to update that? It has problems with complex embedded strings. |
Looks like we forgot to invalidate some caches. That should be fixed now.
We're looking into making the editor use the same grammars as the rest of the site. Thanks for pointing it out. |
Thank you all, this is fixed :) |
Nice :)
|
Sigh. I spent time on pygments to get Nix support, waited few months and now finally.. It's gone.
Apparently Github uses TextMate now.
cc @aroben
The text was updated successfully, but these errors were encountered: