GitHub adds support for Clarion!

You may recall a while back I posted a topic about getting syntax highlighting support for Clarion?

Well, since then I managed to get enough samples going and create a pull request which included Clarion support in GitHub Linguist.

I invite you to read the history. The way the Linguist maintainers handled the PR and subsequent complications was fantastic:

Initial Pull Request:

Which was then replaced with this Pull Request:

Which caused this issue to be opened in order to resolve the handling of *.inc files:

Then just a few days ago the Pull Requests was merged to master:

:tada:

So how do I use it?!

Long story short, any *.clw file in GitHub should now be automatically highlighted using the rules in Clarion.tmLanguage from the SublimeClarion package!

For example see my CStringClass.clw

There are a couple of tricks needed to get extended/full support for Clarion though…

  1. To get syntax highlighting in Clarion *.inc files you need to tell the GitHub highlighter specifically which renderer to use. You do this by adding an Emacs or Vim modeline.

For example, see where I have added ! vim: set filetype=clarion: to the CStringClass.inc.

  1. In order to get the language statistics right for a repo you will also need to add a linguist-language override to the .gitattributes file. https://github.com/github/linguist#overrides

For example, see where I have added *.inc linguist-language=Clarion to .gitattributes in my ClarionClasses repo.

In the case of my ClarionClasses repo this causes GitHub to identify it as 100% Clarion!

I think this starts to get interesting when you have a larger project with a mix of different files such as in my ClarionMetroWizard repo:

Oh, and finally, with the addition of Clarion support to GitHub Linguist we can now see Clarion recognized as a language in other interesting ways such as in GitHub advanced search:

Please note that your repo will only show up in Clarion language specific search results if you have added the .gitattributes linguist-language override!

1 Like