Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub overriding markup language?

I'm using a markup language called AsciiDoc (*.adoc). I'd like to name my *.adoc files as *.txt [^1]. However, then GitHub (of course) doesn't draw .txt files as .adoc files.

So I tried to override the file types using .gitattributes as this:

*.txt linguist-language=AsciiDoc

But it didn't work. Any help? Thanks.


[^1]: Since Dropbox doesn't support editing .adoc files, I'm using .txt for AsciiDoc files.

like image 645
toyboot 4e Avatar asked Jun 10 '26 22:06

toyboot 4e


1 Answers

It seems that linguist-language correctly syntax highlight the file but fail to render markup. I've found that emacs and vim modelines actually works for rendering markup though.

So a workaround would be to add the following in each txt files :

////
vim:ft=asciidoc
////

or if you prefer emacs :

////
-*- mode: asciidoc;-*-
////

Checkout this gist

like image 173
Bertrand Martel Avatar answered Jun 12 '26 13:06

Bertrand Martel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!