rhai icon indicating copy to clipboard operation
rhai copied to clipboard

Consider adding to github/linguist

Open Purpzie opened this issue 2 years ago • 6 comments

I noticed that .rhai files don't have any highlighting on github, and that no issues exist about this yet. Github's highlighting is powered by github/linguist, and they allow people to submit new languages if they're popular enough (used in >200 repos). Unfortunately github's search is pretty broken atm so I'm not sure how many repositories rhai is in.

Until github supports it, throwing this in a repo's .gitattributes will highlight it by pretending it's rust:

*.rhai linguist-language=Rust

Purpzie avatar Mar 14 '22 01:03 Purpzie

Rhai is a scripting language, so I'm not sure if it is actually used in any repo as a main development language.

However, I'll try the .gitattributes trick.

It might be better to use js in order to get support for interpolated strings...

schungx avatar Mar 14 '22 01:03 schungx

True, but other scripting languages are already highlighted, such as lua.

Also oops yeah almost forgot about interpolated strings. I chose rust because I figured js would freak out without () in if statements.

Purpzie avatar Mar 14 '22 01:03 Purpzie

Also oops yeah almost forgot about interpolated strings. I chose rust because I figured js would freak out without () in if statements.

It actually does OK with if... I tried JavaScript on my own repo and it seems to work fine!

Rust seems to mainly trip on interpolated strings, switch statements, import and export statements etc.

schungx avatar Mar 14 '22 03:03 schungx

https://github.com/search?l=&q=a+extension%3Arhai&type=code

dunno if this is what youre looking for but here you go @Purpzie search for repos using rhai

Sable-20 avatar Mar 22 '22 13:03 Sable-20

Now that GitHub support cargo dependencies, there is quite a few codebases that support rhai scripts! https://github.com/rhaiscript/rhai/network/dependents

emesare avatar Sep 05 '22 23:09 emesare

I tried to submit to github/linguist quite a while ago but for some reason which I cannot remember I couldn't.

Maybe somebody can help do that?

schungx avatar Sep 06 '22 01:09 schungx