Home Download Buy Blog Forum Support

ReST support

ReST support

Postby skyhigh on Thu Oct 15, 2009 7:04 am

I would like some support for reStructuredText markup language. I tried installing TextMate bundle for .rst files (http://svn.textmate.org/trunk/Bundles/reStructuredText.tmbundle/), but encountered following problems:

Getting it running
It only worked after renaming all .plist files to .tmLanguage, and I had to delete info.plist in package root. I hope there's nothing important in that file.

Snippets
The snippets found in bundle are very basic ones - image, link and headings. There's no support for tables, footnotes and other elements. The existing snippets work nicely.

Syntax highlighting
I couldn't get it working. I have no time to research the problem, but it seems that Color Schemes need to be expanded with definitions for elements such as header, table, paragraph and similar. Best I could get is to color underlining of headings in different color.

Anybody got a better package?
skyhigh
 
Posts: 2
Joined: Wed Oct 14, 2009 7:07 am

Re: ReST support

Postby vim on Thu Oct 15, 2009 8:48 am

as for syntax highlighting, sublime uses different syntax to describe it. so you must convert it - maybe jon has a script or something...
vim
 
Posts: 298
Joined: Tue May 27, 2008 6:51 pm

Re: ReST support

Postby EJ12N on Thu Oct 15, 2009 3:34 pm

the problem with most new syntaxes is the theme most of the time.
U need to add the scopes to the theme so it knows what to color...
if the scopes are working (tmLanguage doesn't crash sublime) then all you need to do is add the info to the theme your using.
example, autohotkey syntax...
Code: Select all
<dict>
                <key>name</key>
                <string>Keyword command</string>
                <key>scope</key>
                <string>keyword.command.ahk</string>
                <key>settings</key>
                <dict>
                    <key>foreground</key>
                    <string>#ddffff</string>
                </dict>
            </dict>


in your case would be something like:
Code: Select all
<dict>
                <key>name</key>
                <string>Markup heading</string>
                <key>scope</key>
                <string>markup.heading.restructuredtext</string>
                <key>settings</key>
                <dict>
                    <key>foreground</key>
                    <string>#ffff00</string>
                </dict>
            </dict>

it'll color "markup.heading.restructuredtext" in yellow... you do that to all the things you want colored.

Reason you don't do this with common languages is because most color schemes already come with it >.<
EJ12N
 
Posts: 281
Joined: Tue Apr 21, 2009 5:23 pm

Re: ReST support

Postby skyhigh on Fri Oct 16, 2009 7:25 am

Yes, I already tried this modification to Color Scheme file. As I said, it only colored heading underline, not the actual heading text. Perhaps parser didn't mark the text correctly.
skyhigh
 
Posts: 2
Joined: Wed Oct 14, 2009 7:07 am

Re: ReST support

Postby jps on Fri Oct 16, 2009 8:06 am

You can use the key binding Ctrl+Alt+P to see what scope name is assigned to the text under the cursor, it's helpful for looking into these sorts of issues.
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: ReST support

Postby Bobsch on Sun Mar 14, 2010 5:57 pm

Is there a package for ReST already, or does this still need to be done? (A ReST-Package and I'm sold on Sublime, this is like the last thing I need ... ;) )
Bobsch
 
Posts: 2
Joined: Sun Mar 14, 2010 4:50 pm


Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 11 guests