2

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.

toyboot 4e
  • 23
  • 1
  • 3

1 Answers1

2

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

Bertrand Martel
  • 42,756
  • 16
  • 135
  • 159
  • OMG I didn't expect such a complete answer! Much appreciated, thank you soooo much!! – toyboot 4e Jun 07 '20 at 01:00
  • 1
    Modelines and `linguist-language` should have the same effect on rendering AFAIK, so there's probably some issue with the `linguist-language` command here. – pchaigno Jun 07 '20 at 13:31