WML syntax hiliting for TextWrangler

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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
User avatar
Celtic_Minstrel
Developer
Posts: 1659
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

WML syntax hiliting for TextWrangler

Post by Celtic_Minstrel »

For Mac users, I made a TextWrangler/BBCode syntax highlighter (with limited support for the function menu as well). The plist file in the download is generated by a simple Python script so that it hilites full tags rather than just the tag-name (thus preventing tag-names from being hilited in other contexts); the source for that script is also available, which could be useful if someone else wanted to update it for newer tags. It's probable that I've missed a tag or two, and there may be one or two tags in the list that don't exist. Preprocessor commands are also considered identifiers and hilited as such, while still supporting comment hiliting.

Download
Source

I didn't include a license file in the download, but it can be considered to be available under a Simplified BSD license.

If I had the time (and motivation) I would do it properly and write a C++ module to interface with TextWrangler for the syntax hiliting; there's an API provided for that, and it would make a lot of things nicer (eg, ability to hilite inline Lua). Maybe someday I'll do that.
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.

User avatar
Celtic_Minstrel
Developer
Posts: 1659
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: WML syntax hiliting for TextWrangler

Post by Celtic_Minstrel »

Updated this with a bunch of missing tags, and also added a FAI.plist as a hiliter for FormulaAI (automatically applies to files with a .fai extension). I don't use much FormulaAI, so I'm not sure how good this is.

This version considers #wmllint to be a preprocessor directive. Unfortunately this won't work if there's a space, ie "# wmllint".

The new version overwrites the old, so use the same links in the first post.
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.

User avatar
Crow_T
Posts: 851
Joined: February 24th, 2011, 4:20 am

Re: WML syntax hiliting for TextWrangler

Post by Crow_T »

Thanks for coding this up- I'm new to Textwrangler and can't seem to figure how to make this work- can you do a quick write up? Most text editors I've use in the past have a simple pulldown to select the highlight mode.

User avatar
Celtic_Minstrel
Developer
Posts: 1659
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: WML syntax hiliting for TextWrangler

Post by Celtic_Minstrel »

There are three pull-downs at the bottom of the window, which from left to right are language, encoding, newline style. You need to put the WML.plist where TextWrangler can find it (which is "~/Application Support/TextWrangler/Language Modules" if I recall correctly), and if it's running you need to restart it.
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.

Post Reply