UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.9) Gecko/20050716 
Firefox/1.0.5 (Debian package 1.0.5-1)
IP: 64.81.113.168
URI: http://wesnoth.slack.it/?ConventionsWML
 - - - - -
Index: ConventionsWML
===================================================================
RCS file: /home/wesnoth/cvsroot/wikiroot/ConventionsWML,v
retrieving revision 1.3
diff -u -r1.3 ConventionsWML
--- ConventionsWML      4 Jul 2005 18:46:18 -0000       1.3
+++ ConventionsWML      29 Jul 2005 19:02:48 -0000
@@ -27,32 +27,71 @@
 
 ||Indentation||
 
-There are two types of indentation:
+In indentation, every subtag is indented 1 level outward of its parent tag.
+Toplevel tags are not indented;
+neither are the direct subtags of macros and files.
+For example, in unit files [unit] is not indented,
+and every macro should have at least 1 unindented tag or attribute.
+A macro references should be indented
+as though it were the contents of the macro it refers to.
+Some macros require the use of another macro later;
+in this case the macro should be considered as a tag,
+with its counterpart as the closing tag.
+
+Example:
+
+ [scenario]
+  [event]
+ #define START_STORE_UNIT
+ [store_unit]
+  [unit]
+ #enddef
+ #define END_STORE_UNIT
+  [/unit]
+ variable=temp
+ [/store_unit]
+ #enddef
+   {START_STORE_UNIT}
+   type=Elvish Fighter
+    [not]
+    x,y=$x1,$y1
+    [/not]
+   {END_STORE_UNIT}
+  [/event]
+ [/scenario]
+
+Although spaces can substitute for tabs (as done in this wiki),
+it is generally not advisable to use a series of spaces
+to substitute for a single tab - one is enough.
+
+Some writers don't indent subtags of [if]
+because of the way these tags are used recursively;
+indenting these tags fully could cause line wraps
+to make the code incomprehensible.
+
+There are two ways to indent keys:
 normal indentation, and savefile indentation.
 In normal indentation, a key is indented
 on the same level as the tag containing it,
 and in savefile indentation a key is indented
 1 level outward of that.
-In either types of indentation,
-a tag is 1 level outward of the tag containing it,
-and all top-level tags are not indented.
 
 Examples:
 
 Normal indentation:
  [scenario]
  turns=16
-         [side]
-         side=1
-         [/side]
+  [side]
+  side=1
+  [/side]
  [/scenario]
 
 Savefile indenatation:
  [scenario]
-         turns=16
-         [side]
-                 side=1
-         [/side]
+  turns=16
+  [side]
+   side=1
+  [/side]
  [/scenario]
 
 It doesn't matter what indentation format you use,




_______________________________________________
Wesnoth-wiki-changes mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/wesnoth-wiki-changes

Reply via email to