WML Syntax Highlighting for Kate/KWrite

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.
tvynr
Posts: 49
Joined: March 21st, 2006, 6:11 pm

WML Syntax Highlighting for Kate/KWrite

Post by tvynr »

Note: the WML syntax highlighting schema is currently included with the upstream version of Kate under Markup/Wesnoth Markup Language, so you shouldn’t need to download anything unless you are using a very old version of the editor. If you do, grab lua.xml, pango.xml and wml.xml from the directory in the Kate git repository.

-- shadowmaster


The original first post for this topic follows:
Spoiler:
Last edited by tvynr on November 15th, 2006, 1:29 am, edited 1 time in total.
tvynr
Posts: 49
Joined: March 21st, 2006, 6:11 pm

Setting up default indenter for file types in KWrite

Post by tvynr »

I found this little article which may be helpful to people who want KWrite to automatically use indentation on WML files as I do. Here's a summary of the steps involved.

1. Choose Settings -> Configure Editor
2. Click "Filetypes" on the left-hand menu
3. Press the "new" button in the upper right
4. Set the following in the visible fields:
Name: WML
Section: Markup
Variables: kate: indent-mode normal;
File extensions: *.cfg
5. Press OK. You're finished. :)

After completing these steps, KWrite will be set to "normal" indentation mode for WML files.
User avatar
Iris
Site Administrator
Posts: 6797
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: WML Syntax Highlighting for KWrite (v0.30)

Post by Iris »

This seemed to be a kind of abandoned project, and I needed to boost up the WML syntax highlighting features for my text editor, Kate.

Thus I decided to publish a new release under my own terms :P which are identical to the old ones. I just added some new features and bumped the version number. They are:
  • wmlindent, wmllint and wmlscope control tags are recognized and marked just as the TODO, HACK, FIXME, etc. alerts are.
  • .pbl files are automatically recognized as WML sources.
  • It is now possible to comment/uncomment blocks with CTRL-D/CTRL-SHIFT-D just like with other syntax highlighters.
  • #textdomain and #ifndef are highlighted as preprocessor directives.
Enjoy! I have already enjoyed for quite a long time with it. I just forgot to publish it. :oops:
Attachments
wml-0.36-kate.xml.gz
0.36 version of Kate WML syntax highlighting info (unofficial release by shadowmaster)
(1.59 KiB) Downloaded 819 times
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
Jovycos
Posts: 59
Joined: October 12th, 2007, 4:15 pm
Location: Germany

Re: WML Syntax Highlighting for KWrite (v0.36)

Post by Jovycos »

NICE!

Thank you.
I use Kate, too.
Yesterday I installed the old version, and now...

Jovycos
Full of Nerdiness...
User avatar
Geos
Posts: 115
Joined: March 20th, 2008, 1:58 pm
Location: Italy

Re: WML Syntax Highlighting for Kate/KWrite (v0.36)

Post by Geos »

Sorry, but i couldn't make it work.
I copied the file, open a .cfg file and nothing happened. I touched around tools --> highlight, but I wouldn't find WML among the list.
That's ridiculous, dragons have no windows...
caslav.ilic
Translator
Posts: 61
Joined: February 5th, 2007, 4:17 pm
Location: Brunswick, Germany

Re: WML Syntax Highlighting for Kate/KWrite (v0.36)

Post by caslav.ilic »

Are you sure you copied it to ~/.kde/share/apps/katepart/syntax/ path, as stated? E.g. the first time I toyed with highlighters, I've made an error with .../kate/... instead of .../katepart/... in the path.

Then, did you restart Kate after copying the highlighter? Gotta do that.
Chusslove Illich (Часлав Илић)
User avatar
Geos
Posts: 115
Joined: March 20th, 2008, 1:58 pm
Location: Italy

Re: WML Syntax Highlighting for Kate/KWrite (v0.36)

Post by Geos »

Nope way....
I found out that I was copying not in my user folder, but in the system's, at /katepart. I went to .kde/share/apps/ but there I found no /katepart, only /kate. I created /katepart and copied the fil, but still. Maybe is an issue of the version or something. I'm using Kate 2.5.7 at KDE 3.5.7
That's ridiculous, dragons have no windows...
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: WML Syntax Highlighting for Kate/KWrite (v0.36)

Post by AI »

doesn't work for me either, in either place

places being
/usr/share/apps/katepart/syntax/wml.xml
.kde/share/apps/kate/wml.xml
User avatar
Iris
Site Administrator
Posts: 6797
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: WML Syntax Highlighting for Kate/KWrite (v0.36)

Post by Iris »

AI wrote:doesn't work for me either, in either place

places being
/usr/share/apps/katepart/syntax/wml.xml
.kde/share/apps/kate/wml.xml
I install it at $HOME/.kde/share/apps/katepart/syntax/wml.xml, and my local user-wide KDE directory installation would be at /opt/kde3/share/apps/katepart/syntax/wml.xml, if I did it.

You might want to search for the location where all the other syntax highlighting definition files are stored in your system (c.xml, xml.xml...).

I'm at the moment working on making collapsable WML blocks, and I have already implemented it for [nodes][/nodes], but I plan to make it possible too for #define #enddef and #if*def #endif blocks.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: WML Syntax Highlighting for Kate/KWrite (v0.36)

Post by AI »

Still not working.

It does recognize the script (it's in the list), but all WML files are seen as "Scripts/Quake Script".
Actually, syntax colouring just worked for a second before everything went black again....
User avatar
Iris
Site Administrator
Posts: 6797
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: WML Syntax Highlighting for Kate/KWrite (v0.36)

Post by Iris »

AI wrote:Still not working.

It does recognize the script (it's in the list), but all WML files are seen as "Scripts/Quake Script".
Actually, syntax colouring just worked for a second before everything went black again....
Ah yes, that problem.

Remove the .cfg file extension from the Quake Script highlighting settings in Kate. That should make WML take over all .cfg files.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: WML Syntax Highlighting for Kate/KWrite (v0.36)

Post by AI »

No effect.
User avatar
Geos
Posts: 115
Joined: March 20th, 2008, 1:58 pm
Location: Italy

Re: WML Syntax Highlighting for Kate/KWrite (v0.36)

Post by Geos »

Still nothing. I found the place where all syntax files are, in usr/share/apps/katepart/syntax, but, after copying the file there, I can't see any significant change. In the submenu "File Type" I can select WML, but there is no WML entry in highlighting lists. May there be something lacking on the file, like some definitions on the header or something?
That's ridiculous, dragons have no windows...
User avatar
Iris
Site Administrator
Posts: 6797
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: WML Syntax Highlighting for Kate/KWrite (v0.36)

Post by Iris »

Please tell me if you can see this:

http://i144.photobucket.com/albums/r176 ... tings3.png

And whether you did this:
http://i144.photobucket.com/albums/r176 ... tings2.png

And this:
http://i144.photobucket.com/albums/r176 ... tings1.png (the MIME type setting being optional).

This later step is nice but optional too:
http://i144.photobucket.com/albums/r176 ... tings4.png
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: WML Syntax Highlighting for Kate/KWrite (v0.36)

Post by AI »

The first fixes things for the file I'm editing (permantently, it seems), but only for that file. The rest has no effect.
Post Reply