After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 649445 - Add reStructuredText syntax file
Add reStructuredText syntax file
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
: 711529 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-05-05 10:02 UTC by Guillaume Chereau
Modified: 2013-11-15 07:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
reStructuredText syntax file (1.35 KB, text/plain)
2011-05-05 10:02 UTC, Guillaume Chereau
  Details
New version of rst.lang (4.28 KB, application/octet-stream)
2011-05-14 10:20 UTC, Guillaume Chereau
  Details
0001-Add-reStructuredText-syntax-file-by-Guillaume-Cherea.patch (5.37 KB, patch)
2012-06-04 19:22 UTC, Andrew Starr-Bochicchio
none Details | Review
Updated lang file (4.48 KB, text/plain)
2013-11-12 03:58 UTC, Guillaume Chereau
  Details
Patch to master (6.09 KB, patch)
2013-11-15 06:32 UTC, Guillaume Chereau
committed Details | Review

Description Guillaume Chereau 2011-05-05 10:02:34 UTC
Created attachment 187266 [details]
reStructuredText syntax file

reStructuredText [1] is a markup language which is notably used for the python documentation.

I think the syntax file should be provided by default in gtksourceview because this is a common markup language in the opensource community, and there is no debian / ubuntu package to install it.

[1] http://docutils.sourceforge.net/rst.html
Comment 1 Ignacio Casal Quinteiro (nacho) 2011-05-05 13:59:03 UTC
Hey,

this language is in the old format, if you want it in you will have to port it to the last format. See:
http://developer.gnome.org/gtksourceview/3.0/lang-tutorial.html
http://developer.gnome.org/gtksourceview/3.0/lang-reference.html

See also that as there is no copyright, you will have to contact the author and ask for permission to license it as lgpl.
Comment 2 Guillaume Chereau 2011-05-14 10:20:21 UTC
Created attachment 187806 [details]
New version of rst.lang

In the new format of the lang files
Comment 3 Guillaume Chereau 2011-05-14 10:22:52 UTC
OK I finally took some time to write the new rst.lang file.

I did it from scratch without referring to the original one so there is no licence issue.  It also add some improvements, like proper comment blocks support.

It is licensed under lgpl.
Comment 4 Andrew Starr-Bochicchio 2012-06-04 19:22:55 UTC
Created attachment 215582 [details] [review]
0001-Add-reStructuredText-syntax-file-by-Guillaume-Cherea.patch

Any update on whether this will be included? Perhaps adding a patch against git master will put this back on a review radar?

Thanks!
Comment 5 Frederik 'Freso' S. Olesen 2013-02-24 21:10:42 UTC
And half a year still nothing has happened. Is anything blocking this? If so, could someone please enlighten us what needs to be done to move this forward?
Comment 6 Ignacio Casal Quinteiro (nacho) 2013-02-25 07:15:53 UTC
Sorry for the late response, I guess we just missed it... Some comments:

1) Is the mimetype correct? i.e is that mime type reported by gvfs-info? If not please remove the mimetype
2) The properties for the comments are missing please add them.
3) The classes are also missing. See other lang files for the tipical ones, usually: string, spell etc.

If next time we forget to review just jump in #gedit at irc gimpnet and ping us to review it again.
Comment 7 Sébastien Wilmet 2013-11-06 19:30:55 UTC
*** Bug 711529 has been marked as a duplicate of this bug. ***
Comment 8 cavallini 2013-11-07 15:20:55 UTC
A very long time has gone, and the patch is still not applied. I understand it is not perfect, but to me the missing items are either easily fixed or not essential. Even a 90% support is far better than the current status.
I'd be grateful if you could apply it, and ready to test and give feedback.
Thanks.
Comment 9 Paolo Borelli 2013-11-10 16:00:19 UTC
The review of comment #6 is still valid. If an updated patch is provided I am ok with pushing it to master
Comment 10 Guillaume Chereau 2013-11-12 03:58:57 UTC
Created attachment 259632 [details]
Updated lang file

Here is a new version of the lang file with some minor changes addressing the issues raised by Nacho:

> 1) Is the mimetype correct? i.e is that mime type reported by gvfs-info?
> If not please remove the mimetype

Yes the mimetype is correct.

> 2) The properties for the comments are missing please add them.

Because of the syntax of rst it is not really possible to parse comments using properties.  Instead I use a definition.  Someone more familiar with the language definition syntax could maybe have a look at this.

> 3) The classes are also missing. See other lang files for the tipical
> ones, usually: string, spell etc.

I added a few ones. All in all I tried to change the style to make it more similar to markdown.lang.
Comment 11 Paolo Borelli 2013-11-14 22:13:49 UTC
> > 2) The properties for the comments are missing please add them.
> 
> Because of the syntax of rst it is not really possible to parse comments using
> properties.  Instead I use a definition.  Someone more familiar with the
> language definition syntax could maybe have a look at this.
>

What Nacho was referring to, was properties in the metadata section. These are not used for highlighting, but for instance gedit use them to comment out a line when you press a key combination. I would expect something like

    <property name="line-comment-start">..</property>


Apart from that the file looks good to me. I guess the "url" context could be more generic instead of hardcoding http and file (e.g. https, ftp, etc).


It would be really cool if you could sumbit the file as a git format-patch so that we give you proper credit. Also make sure to add the file to Makefile.am and POTFILES.in
Comment 12 Guillaume Chereau 2013-11-15 06:32:35 UTC
Created attachment 259856 [details] [review]
Patch to master

Here is a patch that can be applied to the master branch.

I added the line-comment-start property as suggested.
Comment 13 Paolo Borelli 2013-11-15 07:42:00 UTC
Review of attachment 259856 [details] [review]:

thank you. Applied