WML Syntax Highlighting for Gedit

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
Posts: 49
Joined: March 21st, 2006, 6:11 pm

WML Syntax Highlighting for Gedit

Post by tvynr »

Attached is a syntax highlighting definition for Gedit (and any other app which uses GtkSourceView for syntax highlighting). The contents of the tarball should be placed in the ~/.gnome2/gtksourceview-1.0/language-specs/ directory to function properly.

Sadly, this syntax highlighting definition lacks the more complex features presented in the KWrite syntax highlighting definition. This is due in large part to the fact that I could not find any documentation on how to write GtkSourceView .lang files and had to create this one based almost entirely upon examining the ones which already exist on my system; as a result, I don't have any information on how to handle things like nested macro calls (such as "{FOO ({BAR})}") and the like. If anyone can provide me with a good howto or spec on the GtkSourceView .lang format, I will happily revisit the task. Otherwise, I'm not sure how much more I can improve this highlighting, but I suppose it's better than nothing.

Note also that I was unable to find any information on how to associate a given .lang file with a specific file extension (only MIME types, which I'm pretty sure Wesnoth Markup Language does not have). So to activate highlighting on a specific file, select View :: Highlight Mode :: Markup :: Wesnoth Markup Language.

WML syntax highlighting definition for Gedit v1.0.
(865 Bytes) Downloaded 669 times
User avatar
Chris NS
Posts: 540
Joined: May 6th, 2006, 3:22 pm
Location: Where the Queen lives

Post by Chris NS »

That is a funky and groovy feature.
Posts: 719
Joined: December 9th, 2003, 9:31 pm

Post by Woodwizzle »

Any chance we can get this included in gedit or gedit-extras by default?
Signature dropped due to use of img tag
Posts: 126
Joined: April 19th, 2008, 7:12 pm

Re: WML Syntax Highlighting for Gedit

Post by uzytkownik »

Is there any chance of rewriting it for gtksourceview 2?
Post Reply