Lukasa / language-restructuredtext

A ReStructuredText syntax package for Atom
MIT License
27 stars 15 forks source link

No `firstLineMatch` pattern and modeline-detection support #62

Closed rpuntaie closed 6 years ago

rpuntaie commented 6 years ago

If in the first line of the current buffer there is ...* rst the text should be colored according rst, even if the extension is .txt.

Alhadis commented 6 years ago

What are you talking about?

rpuntaie commented 6 years ago

I've noticed that .txt files do not get rst colored. In vim I have a .. vim: syntax=rst in the first line of the file. This makes vim color properly. Maybe the same thing could be done with this package.

Since apart from .rst at least another extension (.rest) is considered restructuredText, I'm actually good. I will rename all my .txt files to .rest files. I need another extension for the included files in order for Sphinx to ignore them.

Alhadis commented 6 years ago

I have a .. vim: syntax=rst in the first line of the file. This makes vim color properly

Yes, that's a Vim modeline which tells Vim what language a file is written in. It therefore impacts the file's classification and syntax highlighting on GitHub. You can read more on that subject here.

Maybe the same thing could be done with this package.

I thought I did. :confused: Turns out I hadn't, which catches me by surprise. Will fix this.

(BTW, any particular reasons you're using txt for these files? txt is really meant for plain-old text.

rpuntaie commented 6 years ago

You are right, .txt should be just plain text. I have moved to .rest and .rst.