arturo-lang / grafito

Portable, Serverless & Lightweight SQLite-based Graph Database in Arturo
MIT License
143 stars 7 forks source link

Add .gitattributes for GitHub file highlighting #23

Closed jpaquim closed 2 years ago

jpaquim commented 2 years ago

Render files on GitHub using the same Red linguist grammar as used in Markdown files

jpaquim commented 2 years ago

I don't see why not, I can make that change. But it doesn't seem to be showing up as Red anyway under the language statistics in my repo https://github.com/jpaquim/grafito not sure how their algorithm works.

On that note, it seems that the .res files in the Arturo repo are being detected as ReScript files 😅

drkameleon commented 2 years ago

But it doesn't seem to be showing up as Red anyway under the language statistics in my repo https://github.com/jpaquim/grafito not sure how their algorithm works.

I'm a bit confused too. This is what I'm seeing in your repo:

Screenshot 2022-07-06 at 16 16 53

On that note, it seems that the .res files in the Arturo repo are being detected as ReScript files 😅

Yep, that's another messy detail! haha

jpaquim commented 2 years ago

Ok, now it was showing up as Red for me as well 🤔 probably some caching issue. Anyway, I made the change to the branch now, let's see if it works

drkameleon commented 2 years ago

Ok, now it was showing up as Red for me as well 🤔 probably some caching issue. Anyway, I made the change to the branch now, let's see if it works

That's exactly what I was wondering, whether it's something to do with GH's cache. Basically, I'm hard-reloading the page, and it shows or not-shows Red randomly...

I'll experiment with sth a bit and will let you know... 😉

drkameleon commented 2 years ago

I'm experimenting with:

*.art linguist-language=Red
*.art linguist-vendored

According to this:

With the following attribute, Linguist detects files in the special-vendored-path directory (notice the mandatory trailing *) as vendored and excludes them from statistics.

special-vendored-path/* linguist-vendored

So, I guess that should be it: we do recognize the file as having the Red syntax, but without actually counting it in as such.

(I'm reloading some 85 times (lol) the page: https://github.com/drkameleon/grafito, and I'll let you know in case "Red" suddenly pops up again)

drkameleon commented 2 years ago

Well, it seems to be working fine... I mean the addition of *.art linguist-vendored (vs *.art linguist-detectable=false): the file is being highlighted + "Red" does not appear. (I've tested it multiple times, on different browsers + hard-reloading and it appears to be so...)

If you can confirm it on your end, then I guess the PR - after this tiny fix - would be good to go. :)

P.S. Don't worry about the supposed CI error - it's just me not having updated Arturo's installation script, that's why it seems to be failing.

jpaquim commented 2 years ago

Ok, updated it 👌 thanks for testing out as well

drkameleon commented 2 years ago

Ok, updated it 👌 thanks for testing out as well

Thank you!

It was just a pity, after all this work, having a different language show up (this whole thing made me even more determined to make it so that - at some point - Arturo will finally have its official Linguist syntax)

Feel free to edit any other project! 😉