Skip to content

Add GitHub Linguist config for Jsonnet #43

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

Closed
davidzchen opened this issue Apr 1, 2015 · 17 comments
Closed

Add GitHub Linguist config for Jsonnet #43

davidzchen opened this issue Apr 1, 2015 · 17 comments

Comments

@davidzchen
Copy link
Member

We should add an entry to github/linguist for Jsonnet so that GitHub can 1) add proper syntax highlighting for displaying .jsonnet files and 2) include them in the language stats for repositories.

@sparkprime
Copy link
Collaborator

I'd love that. How hard is it? Is it just a case of identifying some keywords and regular expressions?

@sparkprime
Copy link
Collaborator

I just added a syntax file that works for atom. I understand that is the first step on this process.

@davidzchen
Copy link
Member Author

FYI apparently GitHub's policy is that there needs to be a few hundred samples before they would be willing to accept a patch to Linguist. Bazel's pull request was unfortunately rejected for the time being for this reason.

@davidzchen
Copy link
Member Author

Here is the latest Jsonnet usage in GitHub: https://github.com/search?utf8=✓&q=extension%3Ajsonnet+NOT+nothack&type=Code&ref=searchresults

With over 300 files, we should now be meeting GitHub's criteria for adding Jsonnet to Linguist.

I have created a patch to Linguist that I will run through the proper channels before sending the PR. In the meantime, according to the Linguist CONTRIBUTING.md, the grammar must be in its own repository since it will be included by Linguist as a Git submodule.

We will need to move the language-jsonnet Atom syntax package you added into its own repository before we can submit the PR to Linguist.

@sparkprime
Copy link
Collaborator

It says in there that it needs to be hundreds of repos, not hundreds of files. I think we only have 10 repos or so so maybe we can't do this yet.

@davidzchen
Copy link
Member Author

Though from github-linguist/linguist#2348:

We normally require hundreds of samples before adding support for an extension

I'd be fine with waiting until we have some more usage before sending a PR.

In comparison, there are 546 .capnp files, though these files are spread out over more repos, and capnp was added along with a bunch of other languages in bulk in github-linguist/linguist#1714.

@sparkprime
Copy link
Collaborator

Ok in that case perhaps we should try. It would definitely be useful.

@sparkprime
Copy link
Collaborator

Any idea how we would maintain the syntax highlighting after the fact?

@davidzchen
Copy link
Member Author

Are you referring to the language-jsonnet repo that contains the Atom syntax files?

@sparkprime
Copy link
Collaborator

Yeah if we pushed changes to that would it all just work, or would we have to open a ticket to get it brought in.

@davidzchen
Copy link
Member Author

Yes, we just need to move the contents of language-jsonnet into the repo. Then, in my PR for Linguist, I just add the repo to .gitmodules: davidzchen/linguist@51f6542

@davidzchen
Copy link
Member Author

By the way, do you have a preference for the color to use for Jsonnet in GitHub repository language stats?

@sparkprime
Copy link
Collaborator

Not really. Is there any kind of system you know of that other languages
use?

On Thu, Sep 17, 2015 at 1:56 AM, David Z. Chen [email protected]
wrote:

By the way, do you have a preference for the color to use for Jsonnet in
GitHub repository language stats?


Reply to this email directly or view it on GitHub
#43 (comment).

@davidzchen
Copy link
Member Author

Not in particular. It's usually pretty arbitrary, though some languages pick colors that match their logo color. Here's a sample of some of the colors used by different languages: https://github.com/ozh/github-colors

I'm currently using #00BCD4 (cyan) in my patch.

@sparkprime
Copy link
Collaborator

The website is #402010 maybe we should use that.

On Thu, Sep 17, 2015 at 5:05 AM, David Z. Chen [email protected]
wrote:

Not in particular. It's usually pretty arbitrary, though some languages
pick colors that match their logo color. Here's a sample of some of the
colors used by different languages: https://github.com/ozh/github-colors

I'm currently using #00BCD4 (cyan) in my patch.


Reply to this email directly or view it on GitHub
#43 (comment).

@davidzchen
Copy link
Member Author

Sounds good to me.

@sbarzowski
Copy link
Collaborator

Syntax highlighting for Jsonnet has been working in Github for a while now. Closing.

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

No branches or pull requests

3 participants