2010/5/24 Nicholas Michalowski <nmichalo(a)gmail.com>
Hello,
I am an editor over at wikibooks and I was have found myself
wishing for a better way to number things in wikimarkup. Mainly my
activity has been focused on mathematics texts, and I wished for a way
to automatically generate numbers for theorems & exercises. Similar
to what is done in LaTeX. Basically so I could have a template that
would increment say a theorem number from something like 2.1.1 to
2.1.2. (I could imagine 2 and 1 being inputs to the template That
something like {{Theorem|2|1}} display 2.1.1, 2.1.2, ... etc.)
I'll solve this issue with a pywikipedia script, simply writing into the
text 2.1.x, 2.1.x, 2.1.x.... then replacing one by one 2.1.x strings with
2.1.1, 2.1.2, 2.1.3.... :
.....
n=1
while "2.1.x" in text:
text=text.replace("2.1.x","2.1."+str(n),1)
n+=1
....
but this would be my way, since I currently use interactive python scripts
to work on wiki pages.
Alex