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.
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 »

Permanently as long as the session history isn't flushed out.

Sorry, I don't know what else to do. I have posted everything I did locally to set it up; checked any errata on your particular Kate version?
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
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 »

I can not see 1 because when doing 2 I can't see 3. 4 I had already done it for the indent.
I copied the file where I had the other xml files.
/usr/share/kde4/apps/katepart/syntax

As this was not working I created katepart and syntax directories for both my standard user and root, in the exact location given in this forum, which is more or less the same, just that changing the begining of the path, and with .kde instead of kde.

Buaaaaa!!!!! I want to develop properly!!!!!!
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 »

I almost forgot to tell you that this procedure was for KDE3. I don't have KDE4 installed at the moment, but I intend to build and try it some day.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
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 »

Well, I guess that would be the issue.

gracias por todo
That's ridiculous, dragons have no windows...
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 »

I downloaded another version of Kate, and now it works... so goooood....
The only problem is that this new Kate version is treacherous, doesn't always keep the changes, don't know way. I have to make sure before I close.
Well, this is it, thank you guys very much.
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 »

Geos wrote:I downloaded another version of Kate, and now it works... so goooood....
The only problem is that this new Kate version is treacherous, doesn't always keep the changes, don't know way. I have to make sure before I close.
Well, this is it, thank you guys very much.
Mine asks me to save or deliberately discard my text files before closing. :hmm: It must be a Preferences setting.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
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.37)

Post by Iris »

0.37 is out. The most significant changes (therefore, the only ones I remember) are collapsable/expandable WML nodes and preprocessor #define / #ifdef / #ifndef blocks and correct highlighting of the following syntax:

Code: Select all

attribute = "something"
Have fun.
Attachments
wml-0.37-kate.xml.gz
(1.93 KiB) Downloaded 698 times
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
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.37)

Post by Iris »

Interestingly, I didn't have any issues installing the syntax highlight XML for Kate (KDE 4.0.3) on openSUSE 10.3 x86_64 using the typical method... Are you sure any of you are doing the correct steps? :annoyed:
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
dale77
Posts: 11
Joined: August 30th, 2005, 11:12 am
Location: New Zealand

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

Post by dale77 »

Well, just installed the 0.37 xml into KDE 4.4

Seems to work fine as wml.xml under /usr/share/apps/katepart/syntax for me.

Nice work.
No elf left behind
Jovycos
Posts: 59
Joined: October 12th, 2007, 4:15 pm
Location: Germany

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

Post by Jovycos »

Version 0.40, modifications:
  • Code between << >> will be highlighted as Lua-code
  • Code between double-quotes will be highlighted as Pango
  • Extended code-folding
  • Changed some colors, tags will look like in XML
In this screenshot you can see that highlighting and folding work with WML, Pango and Lua:
Screenshot of the Kate-Highlighter for WML
Screenshot of the Kate-Highlighter for WML
This is the syntax-file:
wml.xml.bz2
WML-Highlighter for Kate/KWrite (v.0.40)
(2.29 KiB) Downloaded 548 times
I have added the Pango-highlighter to Kate today, it is available in Git-master, you can also download it here, but in future you should prefer the version shipped with Kate:
pango.xml.bz2
Pango-Highlighter for Kate/KWrite
(1.57 KiB) Downloaded 579 times
Comments are welcome!

Jovycos
Full of Nerdiness...
Jovycos
Posts: 59
Joined: October 12th, 2007, 4:15 pm
Location: Germany

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

Post by Jovycos »

I have pushed wml.xml to Kate-master.
So it will be enabled by default in future Kate versions.
http://gitorious.org/kate/kate/blobs/ma ... ta/wml.xml
You can create merge-requests there.

I need some feedback:
Is the heuristic that everything between << and >> is Lua and everything between " and " is Pango okay?

Jovycos
Full of Nerdiness...
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

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

Post by Crendgrim »

This is really great. If it worked as it should do.

I managed to install the wml.xml without - this means: only with a few ( ;) ) - problems, so that Kate found it. After installing the pango.xml the annoying message "error in highlight file" disappeared and I was able to select "Markup / Wesnoth Markup Language" from the Menu.
My problem is that I'm not able to teach Kate to open all .cfg files as WMLs. Whatever I try, he uses "Quake Script" for the .cfg files. All the workarounds described in this thread didn't work for me (maybe due to the recently changed UI of Kate...).

I'm using Kate 3.4.4 under KDE 4.4.4. Does anyone have got experience with this version?
It's annoying to select "Wesnoth Markup Language" every time I open a file ...


Crend

EDIT:
Nevermind.
When I open a document I never opened since then, the right formatting is used.
It seems that Kate has got a cache where it stores what markup is used for what files... ok, than this shouldn't be a problem any more :)
Last edited by Crendgrim on October 20th, 2010, 10:38 am, edited 1 time in total.
UMC Story Images — Story images for your campaign!
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.37)

Post by Iris »

Jovycos wrote:I have pushed wml.xml to Kate-master.
Awesome! :D
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
User avatar
beetlenaut
Developer
Posts: 2814
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

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

Post by beetlenaut »

I upgraded to KWrite/KDE 4.7.2, and it automatically highlights WML. Thanks Jovycos!
(Note that you may have to remove your old copy of wml.xml for it to work correctly. It should be in: /usr/share/kde4/apps/katepart/syntax.)
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
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.37)

Post by Iris »

By the way, I’m more or less maintaining this again (since version 0.41 of the schema, which is in Kate from KDE SC 4.7.x IIRC). The copy in Wesnoth-UMC-Dev’s wml-tools/katepart-syntax branch currently includes a few minor changes (a.k.a. version 0.42) that haven’t been merged upstream yet.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
Post Reply