-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 Statamic's Antlers template language #5860
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These samples are essentially all identical and don't appear to be real-world samples. Please replace them with real-world examples of the usage, ideally with different uses of the langauge as these files are used to train the classifier. You should really have added the samples your said you have in the OP 😉
You've also missed off adding the grammar license file which would have been downloaded when you ran script/add-grammar
. Please add this file.
I was basically copying from Blade https://github.com/github/linguist/blob/master/samples/Blade/hello.blade.php which was super simple.
I thought that was a bit redundant when I was filling out the PR, now I understand what the samples are for. Hah, sorry!
I committed whatever the command gave me. It didn't give me a license file at the time. I've now deleted it and re-run the command it looks like it added more stuff. Not sure why it didn't work right the first time. |
Thanks. One nit: shouldn't You're adding |
Yup! My bad. Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooof, I've just noticed where you've got your samples from. We can't accept these as the files are not covered by an open source licence… the repo even states it's all proprietary. Please replace all the samples with open source licensed files and update the OP to link to the spices and stated the relevant licenses.
Which repo are you looking at? https://github.com/studio1902/statamic-peak is MIT, and the other two don't have explicit LICENSE files. |
This file: And this license: https://github.com/statamic/cms/blob/master/CONTRIBUTING.md#statamic-isnt-foss I missed the two covered by MIT. They can stay. The one without can't either though. |
Statamic the CMS itself isn't open source, but I'm not sure why the projects that use the templating language need to be open source? |
They don't, however files we include in Linguist need to be. We have that section in the template to ensure we don't infringe upon anyone's rights and accidentally include files we have not right to use. IANAL but the fact that Statamic clearly state this:
... without any explicit indication of open source license usage for any of the files within their other repos says to me that we're potentially on risky legal ground—maybe not now, but potentially in the future—and I'm not prepared to accept that risk on behalf of GitHub, especially when you can easily replace this file with one that we know for sure is safe to include. |
Right on. I'm a maintainer of Statamic, so we'll just adjust the license (and/or at least that section of the CONTRIBUTING file). The |
Okay, we've removed the "and our other repos" part of the section you quoted from https://github.com/statamic/cms/blob/3.3/CONTRIBUTING.md#statamic-isnt-foss Does this give you the all clear enough to use the samples now? |
Not really as the source repo still has no license. If it were your personal repo we’d accept you stating in the template we’re free to use the file as we wish. There’s also the case of the other file without a license. I’m not sure what the problem is with finding alternate liberally licensed files. You can easily search GitHub for these files. |
I've replaced the statamic/statamic file with one from an MIT licensed repo. I've left a kitchensink.antlers.html sample, which doesn't exist in a repo, I created it just for this PR as a way to include all language features. Do you need me to remove it? I've removed the PHP extension and the sample, as I can't find any MIT licensed ones through GitHub search. |
No, this is fine, and you can do the same for the PHP file. In both cases we prefer real-world usage samples as this is used to train the classifier. |
Ok, done! |
Hey @lildude thanks for the release. Syntax highlighting is working great! Are we supposed to see For example on https://github.com/studio1902/statamic-peak we see: I know the majority in this repo are actually |
Someone pointed out to me that it updates when the default branch is pushed to. And confirmed. The languages update just fine. Thanks again! |
Hey @lildude, Syntax highlighting and repo stats work great, thanks for that! 🚀 I found one potential bug/misconfiguration though: Any idea why? Anything we can do? |
Yup. You're looking at Search which is completely independent of Linguist. It doesn't use Linguist. Instead it uses go-enry which pulls in the Linguist releases, however it tends to lag behind Linguist by a few weeks to months. It also requires our Search team to pull in the latest version as and when.
Nope. It's up to go-enry and our Search team now. |
Alright, wasn't aware of this. (Although I already thought it might be something like this) Thanks! |
Description
This PR adds support for Statamic's templating language named "Antlers".
As the language is a subset of HTML, we use prefixed extensions:
filename.antlers.html
filename.antlers.xml
filename.antlers.php
I'm not sure of the implications of this regarding the classifier. The contribution guide suggests I should ping @lildude, so, ping! 👋
I haven't contributed a language before, so I don't know if I've missed anything.
I can confirm the syntax itself does work (outside the context of linguist) as its been successfully used in VSCode using https://antlers.dev and in libraries such as Shiki using the same grammar file.
Let me know if you need anything else from me. Thanks!
Checklist:
.antlers.html
so here are some filename searches instead:kitchensink.antlers.html
andkitchensink.antlers.php
were written specifically for Linguist in this PR.