Syntax / Best practices guides
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.
Syntax / Best practices guides
Is there a best practices or syntax guides. Is there some other ref besides the wiki ref? Not all things are in the side bar. And some of them are not completely correct. For example clicking on recall takes you to statsticsWML. When I wanted something about recall in the [side] tag. Somethings have to be found by alot of digging. A list of = fields (name=, side=, gold=, etc...) would be nice too. When I played with CampGEN a ton of fields showed up that I had never seen before after setting up a scenario.
I know there is no kind of lint (c) or tidy (html) to check your syntax outside of trying to run the scenario or campaign. But it would be nice to see some consistency. There seems to be some looseness to where some things can be. Makes it a little harder to debug when examples show things in different ways.
I know there is no kind of lint (c) or tidy (html) to check your syntax outside of trying to run the scenario or campaign. But it would be nice to see some consistency. There seems to be some looseness to where some things can be. Makes it a little harder to debug when examples show things in different ways.
Actually, there is a wmllint tool and a wmlindent tool; both are stored in SVN and distributed with the development version in the tools directory
However, the ReferenceWML on the wiki is the guide, but it relies on developers and users to continuously update it. I think there is a lot of information there, so that is why you have to do a lot of digging, there's just no way around that, although maybe it could be structured better. To use your example, maybe clicking on 'recall' should take you to a disambiguation page. (The sidebar can be edited if you click 'edit' at the top of it.)
However, the ReferenceWML on the wiki is the guide, but it relies on developers and users to continuously update it. I think there is a lot of information there, so that is why you have to do a lot of digging, there's just no way around that, although maybe it could be structured better. To use your example, maybe clicking on 'recall' should take you to a disambiguation page. (The sidebar can be edited if you click 'edit' at the top of it.)
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Re: thanks
wmllint can be used to "up-convert WML and maps between versions",tashi wrote:Does those two tools only work on the 1.3.x series
but might have problems on 1.2.x maps with custom terrains.
wmlindent just reformats wml-code without looking at the syntax.
WML has basically not changed, so it should work with any version.
-HaJo
I can still see a need for checker for a particular version that determines if everything is typed in correctly and points out issues such as keys that don't do anything in particular in tag blocks.
I think the WMLlint is not a lint in the vein of the C lint which is more of a syntax checker.
It should be trival to implent a tag open/tag close checker. Matter of fact, a little add on could turn that into XML. Then plus a xls file you can get a nice little formated source file.
Sounds a reason for me to brush off some rusty skills.
I think the WMLlint is not a lint in the vein of the C lint which is more of a syntax checker.
It should be trival to implent a tag open/tag close checker. Matter of fact, a little add on could turn that into XML. Then plus a xls file you can get a nice little formated source file.
Sounds a reason for me to brush off some rusty skills.
- esr
- Retired Developer
- Posts: 228
- Joined: November 26th, 2006, 6:40 pm
- Location: Pennsylvania, USA
- Contact:
wmllint already does tag balance checking
wmlindent already does tag balance checking. There's also a tool called wmlscope that can detect unresolved references.
I wrote wmllint, wmlindent, and wmlscope. I am continuing to improve them. If you have a well-defined idea for a kind of sanity-checking they don't do, file it as a feature request for my attention.
I wrote wmllint, wmlindent, and wmlscope. I am continuing to improve them. If you have a well-defined idea for a kind of sanity-checking they don't do, file it as a feature request for my attention.
wmlindent is missing from the /tools directory...
I've looked up and down the source tree on sourceforge.net and the other site as well, and to no avail.
I just can NOT locate wmlindent, and could really use it...
Can you post wmlindent and wmllint somewhere so we can get to it?
Thanks,
Spammicus_Rex
I just can NOT locate wmlindent, and could really use it...
Can you post wmlindent and wmllint somewhere so we can get to it?
Thanks,
Spammicus_Rex
Found 'em!
./data/tools, not /tools.....
Spammicus_Rex
Spammicus_Rex
- irrevenant
- Moderator Emeritus
- Posts: 3692
- Joined: August 15th, 2005, 7:57 am
- Location: I'm all around you.
Re: Syntax / Best practices guides
It's a wiki. If you find a problem, please feel free to fix it.tashi wrote:Is there a best practices or syntax guides. Is there some other ref besides the wiki ref? Not all things are in the side bar. And some of them are not completely correct.
"Unit" provides an example of how to update the sidebar to handle a WML tag that is on a couple of different pages.
Want to post a Wesnoth idea? Great! Read these:
Frequently Posted Ideas Thread
Giving your idea the best chance of acceptance
Frequently Posted Ideas Thread
Giving your idea the best chance of acceptance
Re: Syntax / Best practices guides
The issue is that if the wiki is known to not correspond with what the user knows about WML, it's unlikely to be particularly useful when trying to figure out what's going on in WML the user doesn't understand... it doesn't do a helluvalot of good to say "if you find a problem, feel free to fix it" when the whole point is that he wouldn't even know when there WAS a problem.irrevenant wrote:It's a wiki. If you find a problem, please feel free to fix it.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
And I hate stupid people.
The World of Orbivm