You may recall a while back I posted a topic about getting syntax highlighting support for Clarion?
A blog post came up on twitter today that side tracked me into preparing a pull request to bring Clarion syntax highlighting to GitHub (as well as the Atom editor I believe…)
GitHub used to use the Pygments syntax highlighter but recently that changed and now adding support is pretty simple once you have a functional ruby environment setup (don’t ask!). Just point a script at the SublimeClarion project, add an entry to language.yml and commit!
Before I issue the pull requests though it would b…
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:
github-linguist:master
← fushnisoft:master
opened 12:41PM - 26 Nov 14 UTC
Clarion is a Rapid Application Development tool (RAD) with a 4th Generation lang… uage. The language was create by Bruce Barrington back in the early 1980 and operated in DOS until Clarion for Windows came out in 1994.
Some examples of Clarion on GitHub:
https://github.com/devroadmaps/DevroadmapsClarionLibrary
https://github.com/fushnisoft/ClarionMetroWizard
https://github.com/CarlosGtrz/ClarionJson
https://github.com/MarkGoldberg/ClarionCommunity
https://github.com/MarkGoldberg/CwUnit
https://github.com/Rick-UpperPark/ClarionLiveDLLTutor
https://github.com/ClarionLive?tab=repositories
Which was then replaced with this Pull Request:
github-linguist:master
← github-linguist:clarion
opened 08:09PM - 10 Apr 15 UTC
Replaces https://github.com/github/linguist/pull/1770
Which caused this issue to be opened in order to resolve the handling of *.inc files:
github-linguist:master
← pchaigno:inc-extension
opened 12:39PM - 05 Jul 15 UTC
There is [more than 10 millions `.inc` files on GitHub](https://github.com/searc… h?q=extension%3Ainc+NOT+sfhdkfhdkhfdjfudhfkd&ref=reposearch&utf8=%E2%9C%93) and it's used by many languages. Thus, to add that extension, we need to identify all languages using it (with at least hundreds of examples).
I will update this post with the list of languages as we go. I might eventually turn this issue into a pull request to add support of the extension.
| Language | Number of files |
| --- | --- |
| PHP | [9,241,000](https://github.com/search?q=extension%3Ainc+php&ref=reposearch&utf8=%E2) |
| Pascal | [206,000](https://github.com/search?p=96&q=extension%3Ainc+end+begin&ref=searchresults&type=Code&utf8=%E2%9C%93) |
| Assembly | [at least 69,000](https://github.com/search?utf8=%E2%9C%93&q=extension%3Ainc+NOT+php+mov+OR+jmp+OR+lda+OR+globl) |
| MySQL | [49,000](https://github.com/search?p=1&q=extension%3Ainc+select+where+NOT+php&ref=searchresults&type=Code&utf8=%E2%9C%93) |
| C++ | [8,000](https://github.com/search?p=1&q=extension%3Ainc+class+void+include+NOT+php&ref=searchresults&type=Code&utf8=%E2%9C%93) |
| HTML | [5,000](https://github.com/search?p=100&q=extension%3Ainc+body+html+NOT+php&ref=searchresults&type=Code&utf8=%E2%9C%93)* |
| SourcePawn | [2,300](https://github.com/search?p=1&q=extension%3Ainc+native+forward+stock&ref=searchresults&type=Code&utf8=%E2%9C%93)* |
| Clarion | [at least 165](https://github.com/search?p=1&q=extension%3Ainc+destruct+OR+construct+procedure+NOT+begin+NOT+php&ref=searchresults&type=Code&utf8=%E2%9C%93)* |
`*` I checked these by downloading 1,000 samples from the search results and using [simple heuristics](https://gist.github.com/pchaigno/b50ec322afd3cdcdafdf) to triage them.
Then just a few days ago the Pull Requests was merged to master:
github-linguist:master
← github-linguist:cut-release-v4.5.5
opened 03:57PM - 15 May 15 UTC
Changes since `v4.5.4`: https://github.com/github/linguist/compare/78d4abe808ad2… 11584d9ecf6977bc4f1bd059a32...3878afa2e0f29b8e472dbaa40842e64c78a0a5ba
- Improving Vim modeline regex [#2394](https://github.com/github/linguist/pull/2394) ([arfon](https://github.com/arfon))
- Added fastlane configuration files [#2393](https://github.com/github/linguist/pull/2393) ([KrauseFx](https://github.com/KrauseFx))
- Add Unity3D Asset and Metadata files [#2388](https://github.com/github/linguist/pull/2388) ([mephaust](https://github.com/mephaust))
- Change PHP group to HTML for TWIG [#2387](https://github.com/github/linguist/pull/2387) ([aivus](https://github.com/aivus))
- Vim and Emacs modelines are two alternatives [#2386](https://github.com/github/linguist/pull/2386) ([larsbrinkhoff](https://github.com/larsbrinkhoff))
- Add HyPhy as language to Linguist [#2375](https://github.com/github/linguist/pull/2375) ([mbdoud](https://github.com/mbdoud))
- Handle SSH links to submodules in Travis [#2374](https://github.com/github/linguist/pull/2374) ([pchaigno](https://github.com/pchaigno))
- Remove unused grammars/submodules [#2373](https://github.com/github/linguist/pull/2373) ([pchaigno](https://github.com/pchaigno))
- Use original Ada grammar [#2372](https://github.com/github/linguist/pull/2372) ([pchaigno](https://github.com/pchaigno))
- Add languages.yml entry and sample files for OGC Geography Markup Language (#2366) [#2368](https://github.com/github/linguist/pull/2368) ([vog](https://github.com/vog))
- Add support for API Blueprint [#2363](https://github.com/github/linguist/pull/2363) ([danielgtaylor](https://github.com/danielgtaylor))
- Add support for SSH2 and OpenSSH public keys [#2346](https://github.com/github/linguist/pull/2346) ([larsbrinkhoff](https://github.com/larsbrinkhoff))
- Remove .script! hack [#2340](https://github.com/github/linguist/pull/2340) ([bkeepers](https://github.com/bkeepers))
- Improve NL/NewLisp disambiguation heuristic [#2339](https://github.com/github/linguist/pull/2339) ([vitaut](https://github.com/vitaut))
- Change Salt to programming per #2307 [#2335](https://github.com/github/linguist/pull/2335) ([DavidJFelix](https://github.com/DavidJFelix))
- Update submodule for Chapel grammar. [#2334](https://github.com/github/linguist/pull/2334) ([thomasvandoren](https://github.com/thomasvandoren))
- Add additional Puppet sample [#2333](https://github.com/github/linguist/pull/2333) ([3flex](https://github.com/3flex))
- Add 'Linker Script' language [#2330](https://github.com/github/linguist/pull/2330) ([larsbrinkhoff](https://github.com/larsbrinkhoff))
- Specflow [#2328](https://github.com/github/linguist/pull/2328) ([arfon](https://github.com/arfon))
- Add DCL and MMS [#2326](https://github.com/github/linguist/pull/2326) ([arfon](https://github.com/arfon))
- Adding support for Clarion [#2325](https://github.com/github/linguist/pull/2325) ([arfon](https://github.com/arfon))
- Remove Batch from Shell group [#2324](https://github.com/github/linguist/pull/2324) ([pchaigno](https://github.com/pchaigno))
- Add JFlex grammars (language & syntax highlighting) [#2323](https://github.com/github/linguist/pull/2323) ([lsf37](https://github.com/lsf37))
- Make Common Lisp heuristic case insensitive. [#2322](https://github.com/github/linguist/pull/2322) ([larsbrinkhoff](https://github.com/larsbrinkhoff))
- Tighten up OCaml heuristic [#2314](https://github.com/github/linguist/pull/2314) ([larsbrinkhoff](https://github.com/larsbrinkhoff))
- New sample for Formatted. [#2312](https://github.com/github/linguist/pull/2312) ([larsbrinkhoff](https://github.com/larsbrinkhoff))
- New samples for SaltStack [#2311](https://github.com/github/linguist/pull/2311) ([pchaigno](https://github.com/pchaigno))
- KiCad language with .sch extension [#2309](https://github.com/github/linguist/pull/2309) ([pchaigno](https://github.com/pchaigno))
- Update guideline on syntax highlighting fixes [#2308](https://github.com/github/linguist/pull/2308) ([pchaigno](https://github.com/pchaigno))
- add Limbo: language, samples [#2306](https://github.com/github/linguist/pull/2306) ([powerman](https://github.com/powerman))
- Explaining gitattributes behavior. [#2304](https://github.com/github/linguist/pull/2304) ([arfon](https://github.com/arfon))
- Add rebar-related files as erlang. [#2301](https://github.com/github/linguist/pull/2301) ([dpiddy](https://github.com/dpiddy))
- Adding in a Makefile.boot filename for .boot detection [#2300](https://github.com/github/linguist/pull/2300) ([arfon](https://github.com/arfon))
- Fixing up shebang detection to match new tokenizer behaviour [#2299](https://github.com/github/linguist/pull/2299) ([arfon](https://github.com/arfon))
- Add proximity test for colors [#2298](https://github.com/github/linguist/pull/2298) ([gjtorikian](https://github.com/gjtorikian))
- Add colors to semi-popular languages [#2296](https://github.com/github/linguist/pull/2296) ([phase](https://github.com/phase))
- Add .ruby to the list of ruby file extensions [#2266](https://github.com/github/linguist/pull/2266) ([Dorian](https://github.com/Dorian))
- Add support for the Clarion language [#1770](https://github.com/github/linguist/pull/1770) ([fushnisoft](https://github.com/fushnisoft))
- Comment styles; don't choke on `\#!/usr/bin/env foo=bar` [#1604](https://github.com/github/linguist/pull/1604) ([geoff-codes](https://github.com/geoff-codes))
- add DCL and MMS/MMK files commonly used in OpenVMS environments [#1573](https://github.com/github/linguist/pull/1573) ([ztmr](https://github.com/ztmr))
- Add support for SVG [#2391](https://github.com/github/linguist/pull/2391) ([stanhu](https://github.com/stanhu))
- Add .test extention as xml filetype [#2380](https://github.com/github/linguist/pull/2380) ([wkentaro](https://github.com/wkentaro))
- Add EusLisp [#2379](https://github.com/github/linguist/pull/2379) ([wkentaro](https://github.com/wkentaro))
- An example comparison for docs [#2371](https://github.com/github/linguist/pull/2371) ([stl-sanjay](https://github.com/stl-sanjay))
- Remove executable flag from all sample code files [#2369](https://github.com/github/linguist/pull/2369) ([vog](https://github.com/vog))
- Deadfish language [#2358](https://github.com/github/linguist/pull/2358) ([phase](https://github.com/phase))
- Marking XCode .pbxproj as generated [#2351](https://github.com/github/linguist/pull/2351) ([arfon](https://github.com/arfon))
- Extensions for the Bazel build system are written in a Python dialect [#2348](https://github.com/github/linguist/pull/2348) ([hanwen](https://github.com/hanwen))
- Analyse an individual file using repository information. [#2342](https://github.com/github/linguist/pull/2342) ([larsbrinkhoff](https://github.com/larsbrinkhoff))
- More Language Colors [#2337](https://github.com/github/linguist/pull/2337) ([phase](https://github.com/phase))
- An example comparison for docs [#2327](https://github.com/github/linguist/pull/2327) ([Rahat-3858](https://github.com/Rahat-3858))
- Fixing incorrect detection of the NewLisp language [#2319](https://github.com/github/linguist/pull/2319) ([Ignotus](https://github.com/Ignotus))
- Add Libraries & Libs to vendor.yml [#2302](https://github.com/github/linguist/pull/2302) ([phase](https://github.com/phase))
- Call out fact that language updates are post-push [#2093](https://github.com/github/linguist/pull/2093) ([arfon](https://github.com/arfon))
- Add ColdC, the language from ColdMUD. [#2091](https://github.com/github/linguist/pull/2091) ([waywardmonkeys](https://github.com/waywardmonkeys))
- Add Clojure support for .boot files [#1894](https://github.com/github/linguist/pull/1894) ([alandipert](https://github.com/alandipert))
- Add .xml.fr and .html.fr [#1830](https://github.com/github/linguist/pull/1830) ([larsbrinkhoff](https://github.com/larsbrinkhoff))
- Remove .script! hack [#1786](https://github.com/github/linguist/pull/1786) ([bkeepers](https://github.com/bkeepers))
- use syntax hilighting for uncompilable codeblocks [#1713](https://github.com/github/linguist/pull/1713) ([oli-obk](https://github.com/oli-obk))
- Add more extensions to Logos language [#1562](https://github.com/github/linguist/pull/1562) ([Tyilo](https://github.com/Tyilo))
- Add support for Drupal's inc, module and install extensions [#1343](https://github.com/github/linguist/pull/1343) ([jacobbednarz](https://github.com/jacobbednarz))
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…
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 .
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. GitHub - github-linguist/linguist: Language Savant. If your repository's language is being reported incorrectly, send us a pull request!
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:
https://github.com/search?utf8=✓&q=clarion+language%3AClarion&type=Repositories&ref=advsearch&l=Clarion
Please note that your repo will only show up in Clarion language specific search results if you have added the .gitattributes
linguist-language
override!