toyboot 4e
toyboot 4e

Reputation: 33

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.

Upvotes: 3

Views: 85

Answers (1)

Bertrand Martel
Bertrand Martel

Reputation: 45402

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

Upvotes: 2

Related Questions