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 635381 - Syntax highlighting for MediaWiki
Syntax highlighting for MediaWiki
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
unspecified
Other All
: Normal enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2010-11-20 20:43 UTC by Moo
Modified: 2013-05-28 21:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch adding support for mediawiki syntax highlighting (10.82 KB, patch)
2012-10-08 21:16 UTC, Waldir Pimenta
none Details | Review
Patch adding support for mediawiki syntax highlighting (23.18 KB, patch)
2012-10-08 21:52 UTC, Waldir Pimenta
none Details | Review
Patch adding support for mediawiki syntax highlighting (11.64 KB, patch)
2012-10-08 21:59 UTC, Waldir Pimenta
needs-work Details | Review
Patch adding support for mediawiki syntax highlighting (12.49 KB, patch)
2012-10-12 06:17 UTC, Waldir Pimenta
accepted-commit_after_freeze Details | Review
Patch adding support for mediawiki syntax highlighting (12.48 KB, patch)
2012-10-12 06:55 UTC, Waldir Pimenta
committed Details | Review

Description Moo 2010-11-20 20:43:48 UTC
Add syntax highlighting for Wiki such as MediaWiki.

'''Bold''' text, ''italic'' text, '''''bold and italic''''' text
And [[internally linked]] text.
And [http://www.gnome.org/ GNOME] external links.
== Header ==
* Bulleted list entry 1
* Bulleted list entry 2
* Bulleted list entry 3
== Subheader ==
# Numbered list entry 1
# Numbered list entry 2
# Numbered list entry 3
Comment 1 Moo 2010-11-20 20:47:07 UTC
== Header ==
=== Subheader ===
==== Subheader ====
===== Subheader =====
====== Subheader ======
{{template}}
Comment 2 Moo 2010-11-20 20:51:00 UTC
Oh, just saw that this exists.
But I don't have it on my computer running gedit 2.30.3.

http://www.jpfleury.net/logiciels/gedit-mediawiki.php
Comment 3 Ignacio Casal Quinteiro (nacho) 2011-04-14 09:00:09 UTC
Dunno, is this generic enough to be included? Is there some standard for wiki pages?
Comment 4 Moo 2011-04-18 12:32:39 UTC
Creole is an attempt at a standard for writing wiki pages.
http://en.wikipedia.org/wiki/Creole_%28markup%29
Comment 5 Chris Cunningham 2011-09-13 12:28:49 UTC
There's already an existing gtksourceview plugin which works great:

http://www.jpfleury.net/logiciels/gedit-mediawiki.php

I'd certainly like for it to be integrated.

Chris
Comment 6 Carnë Draug 2011-09-13 12:51:57 UTC
(In reply to comment #5)
> There's already an existing gtksourceview plugin which works great:
> 
> http://www.jpfleury.net/logiciels/gedit-mediawiki.php
> 
> I'd certainly like for it to be integrated.
> 
> Chris

Hi Chris,

that lang file uses the GPL licence. Currently the project can only use code under LGPL (see bug #159134). Could you contact the author of the file to know if he's willing to do it?

Carnë
Comment 7 Chris Cunningham 2011-09-13 15:17:28 UTC
I've mailed Jean-Philippe Fleury (the author of the code in question) with a link to this bug and an inquiry as to whether he'd be prepared to re-licence.

Chris
Comment 8 Jean-Philippe Fleury 2011-09-13 16:38:43 UTC
I'm the author of this lang file. I've changed license from GPL to LGPL. New files are on my website.
Comment 9 nodiscc 2012-01-28 18:48:42 UTC
There's another plugin which supports Dokuwiki syntax https://github.com/zealot128/Gedit-Dokuwiki-Syntax. Wish it could be included.
Comment 10 nodiscc 2012-01-28 18:50:48 UTC
Another lang file for Moinmoin markup: http://moinmo.in/GeditHighlighting, it works pretty well, suitable for editing Google Code wiki pages.
Comment 11 Waldir Pimenta 2012-10-08 21:16:37 UTC
Created attachment 226078 [details] [review]
Patch adding support for mediawiki syntax highlighting
Comment 12 Waldir Pimenta 2012-10-08 21:17:08 UTC
After looking in a lot of places (the documentation is really scattered!) I managed to figure out how to prepare a patch. For future reference, here are the relevant links:

- http://git.gnome.org/browse/gtksourceview/ (.lang files at tree/data/language-specs)
- https://live.gnome.org/GnomeLove/SubmittingPatches
- http://git.gnome.org/browse/gtksourceview/tree/HACKING

I just attached the patch to this bug. I'll see if I can get someone at IRC (http://client02.chat.mibbit.com/?server=irc.gnome.org&channel=%23gedit) to take a look :)
Comment 13 Waldir Pimenta 2012-10-08 21:52:16 UTC
Created attachment 226082 [details] [review]
 Patch adding support for mediawiki syntax highlighting

Fix indentation to use 2 spaces rather than tabs, and add the file to data/language-specs/Makefile.am and po/POTFILES.in. Thanks pbor @IRC for the hints.
Comment 14 Waldir Pimenta 2012-10-08 21:59:31 UTC
Created attachment 226083 [details] [review]
Patch adding support for mediawiki syntax highlighting

Oops! I had accidentally added the patch file itself into the patch! Should be ok now.
Comment 15 Waldir Pimenta 2012-10-08 22:14:12 UTC
Sorry all for the spam: I'm just adding a couple more links to complement the ones at comment #12, in case anyone in the future use this thread as a starting point to create and/or propose the addition of other language files:

- http://developer.gnome.org/gtksourceview/stable/lang-reference.html (Language Definition v2.0 Reference)
- http://developer.gnome.org/gtksourceview/stable/lang-tutorial.html (Language Definition v2.0 Tutorial)
- https://live.gnome.org/GtkSourceView/LanguageDefinitions (list of plugins for other languages)
Comment 16 Ignacio Casal Quinteiro (nacho) 2012-10-09 06:07:27 UTC
Review of attachment 226083 [details] [review]:

The patch looks good although see the comments inline.

::: data/language-specs/mediawiki.lang
@@ +4,3 @@
+Copyright © Jean-Philippe Fleury, 2009, 2011-2012.
+
+Ce programme est un logiciel libre; vous pouvez le redistribuer ou

Hey, please put the copyright in english

@@ +20,3 @@
+-->
+<language id="mediawiki" _name="MediaWiki" version="2.0" _section="Others">
+	<metadata>

2 spaces indentation is a must.

@@ +26,3 @@
+	
+	<styles>
+		<style id="emphase-forte" _name="Emphase forte" map-to="def:statement"/>

organize this a bit by putting the name in one column and the mapping in another
Comment 17 Ignacio Casal Quinteiro (nacho) 2012-10-09 06:07:30 UTC
Review of attachment 226083 [details] [review]:

The patch looks good although see the comments inline.

::: data/language-specs/mediawiki.lang
@@ +4,3 @@
+Copyright © Jean-Philippe Fleury, 2009, 2011-2012.
+
+Ce programme est un logiciel libre; vous pouvez le redistribuer ou

Hey, please put the copyright in english

@@ +20,3 @@
+-->
+<language id="mediawiki" _name="MediaWiki" version="2.0" _section="Others">
+	<metadata>

2 spaces indentation is a must.

@@ +26,3 @@
+	
+	<styles>
+		<style id="emphase-forte" _name="Emphase forte" map-to="def:statement"/>

organize this a bit by putting the name in one column and the mapping in another
Comment 18 Waldir Pimenta 2012-10-12 06:17:42 UTC
Created attachment 226311 [details] [review]
Patch adding support for mediawiki syntax highlighting

For some reason my previous conversion from tabs to spaces didn't take effect (I might have forgotten to add the file before amending the commit). Double-checked this time, should be ok. Remaining suggestions implemented: Copyright info now in English, as well as the element IDs and so on; style names and mappings now aligned in columns for easier inspection. Also, changed language section from "Others" to "Markup".
Comment 19 Ignacio Casal Quinteiro (nacho) 2012-10-12 06:24:10 UTC
Review of attachment 226311 [details] [review]:

patch looks good to me. Let's commit after branching.
Comment 20 Waldir Pimenta 2012-10-12 06:44:22 UTC
Hm.... I can't find anything wrong with the .lang file, but copying it to /usr/share/gtksourceview-3.0/language-specs/ makes it show up on the list of languages to pick, but nothing happens when it's selected. The original file from http://www.jpfleury.net/en/software/gedit-mediawiki.php does work, though... What am I overlooking?
Comment 21 Waldir Pimenta 2012-10-12 06:46:12 UTC
Here's a diff: http://diffchecker.com/pOA0C589
Comment 22 Ignacio Casal Quinteiro (nacho) 2012-10-12 06:51:54 UTC
Everything is fine with it. We just can't commit it right now. We have to wait until we branch gtksourceview which will be probably this week.
Comment 23 Waldir Pimenta 2012-10-12 06:55:29 UTC
Created attachment 226312 [details] [review]
Patch adding support for mediawiki syntax highlighting

Ugh. Translation of identifiers wasn't complete in previous version, which broke the file. This time I verified that it works on my gedit installation before submitting. Sorry for the noise. It's late/early, I should go to bed.
Comment 24 Carnë Draug 2013-05-23 16:56:36 UTC
Can this be merged now?
Comment 25 Carnë Draug 2013-05-28 21:08:53 UTC
Review of attachment 226312 [details] [review]:

pushed
Comment 26 Carnë Draug 2013-05-28 21:09:52 UTC
Pushed after solving merging issues. See:

https://git.gnome.org/browse/gtksourceview/commit/?id=db965e3ac704c574d04023606d4b7afc4ec133ad

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.