Improved documentation.

This commit is contained in:
Eric S. Raymond 2009-03-30 09:14:06 +00:00
parent a777b64fac
commit 36db78198c
3 changed files with 29 additions and 6 deletions

View file

@ -19,11 +19,24 @@ Wesnoth story screens.
Command-line client for uploading WML content to and downloading from
the add-on server.
=== wmlflip ===
Experimental tool that can hack a .cfg referring to a mapfile so that
all macros with X,Y coordinate pair arguments get their calls transformed
in a specified way. Now supports only flipping the map around the Y
axis, but provides a framework that should make other transformations
easy.
=== wmllint ===
This tool lifts WML from older dialects to current and performs sanity checks.
See the header comment of wmllint for a description and invocation options.
=== wmllint_gui ===
A simple GUI interface for wmllint, to aid WML developers frightened of
the command line.
=== wmlscope ===
A WML cross-reference checker. Normally you'll use this to list
@ -53,6 +66,12 @@ unit_tree).
Extract and format a list of keystroke bindings from a theme file.
Presently this generates a table suitable for wiki inclusion.
=== terrain2wiki.rb ===
A script to create the "Terrain Table" on the TerrainLettersWML wiki page.
Run this and splice the outtput into the wiki whenever you add a new
terrain type to mainline.
== Python API ==
=== wmltools.py ===

View file

@ -1,5 +1,7 @@
#!/usr/bin/ruby
# A script to create the "Terrain Table" on the TerrainLettersWML wiki page.
# Run this and splice the outtput into the wiki whenever you add a new
# terrain type to mainline.
#create an array of hashes, each hash representing a [terrain] tag
@ -47,8 +49,7 @@ end
def create_table_line(string,name,stats_from)
return "<tr>
<td>#{string}</td>#{"
<td>#{old_letter}</td>" if nil}
<td>#{string}</td>
<td>#{name}</td>
<td>#{stats_from}</td>
</tr>"
@ -75,8 +76,7 @@ def create_wiki(terrains)
return "
<table border=\"1\"><tr>
<th>String</th>#{"
<th>Old letter</th>" if nil}
<th>String</th>
<th>Name</th>
<th>Stats from</th>
</tr>
@ -95,7 +95,6 @@ end
$terrain_file=ARGV[1]
$output_file=ARGV[0]
while !$terrain_file
print "Path of terrain.cfg: "
$terrain_file=gets.chomp("\n")

View file

@ -7,6 +7,9 @@ mirror-reversed a map and need to change coordinate-using macros.
Takes a cross-reference of all known macros and looks for formals that
are either X, Y, *_X, or _Y, so it's guaranteed to catch everything.
Note: will not transform coorinates given as bare attribute values in, say,
UnitWML. This should be fixed.
Options:
-m Argument of this switch should name the map file.
Required, because the coordinate transform needs to know the
@ -189,7 +192,9 @@ def transformables(filename, relevant, verbose):
(have_x, have_y) = relevant[name]
pairs.append((arglocs[have_x], arglocs[have_y]))
# Transform these back to fronrt so laterchanges won't screw up earlier ones
# FIXME: extract spans associated with x,y attributes, too.
# Transform these back to front so later changes won't screw up earlier ones
pairs.reverse()
# Return the file content as a string and the transformable extents in it.