Commit patch #1076

This commit is contained in:
Piotr Cychowski 2008-06-29 16:52:29 +00:00
parent b998f1b974
commit 748220eff8
4 changed files with 39 additions and 8 deletions

View file

@ -26,6 +26,8 @@ Version 1.5.1+svn:
* Fixed droiding not to make wesnoth think player is observer (bug: #9675)
* Fixed statitics not add turn data from previus scenarios (bug: #11719)
* Removed persistance from team configuration (bug: #10916)
* Made automaticaly generated macro reference easier to naviagate and link to
(patch: #1076)
Version 1.5.1:
* campaigns:

View file

@ -755,6 +755,10 @@
email = "paniemin_AT_cc.hut.fi"
comment = "Bug fixing; ussualy targetting MP or WML engine"
[/entry]
[entry]
name = "Paŭlo Ebermann (Pauxlo)"
wikiuser = "Paŭlo"
[/entry]
[entry]
name = "Petr Sobotka (Pietro)"
[/entry]

View file

@ -1,17 +1,19 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Utility macro reference</title>
<meta http-equiv="content-type" content="text/xhtml; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8" />
<link rel="shortcut icon" type="image/png" href="/mw/skins/glamdrol/ico.png" />
<style type="text/css">@import url('http://www.wesnoth.org/mw/skins/glamdrol/main.css');</style>
<style type="text/css">@import url('http://www.wesnoth.org/mw/skins/glamdrol/home.css');</style>
<style type="text/css">
/*<![CDATA[*/
.file_header: {font-style:normal; font-weight:bold;}
@import url('http://www.wesnoth.org/mw/skins/glamdrol/main.css');
@import url('http://www.wesnoth.org/mw/skins/glamdrol/home.css');
.toplink {float:right; font-size: small;}
.file_header {font-style:normal; font-weight:bold;}
.file_explanation {font-style:normal; font-weight:bold;}
.macro_name {font-style:normal; font-weight:bold;}
.macro_formals {font-style:italic; font-weight:normal;}
@ -29,12 +31,25 @@
<a href="home"><img alt="Wesnoth logo" src="http://www.wesnoth.org/mw/skins/glamdrol/wesnoth-logo.jpg" /></a>
</div>
</div>
<div id="nav">
<ul>
<li><a href="http://www.wesnoth.org/">Home</a></li>
<li><a href="http://www.wesnoth.org/wiki/Play">Play</a></li>
<li><a href="http://www.wesnoth.org/wiki/Create">Create</a></li>
<li><a href="http://www.wesnoth.org/forum/">Forums</a></li>
<li><a href="http://www.wesnoth.org/wiki/Support">Support</a></li>
<li><a href="http://www.wesnoth.org/wiki/Project">Project</a></li>
<li><a href="http://www.wesnoth.org/wiki/Credits">Credits</a></li>
</ul>
</div>
<div id="main">
<p>This page is an automatically-generated reference for all the
utility macros with documentation strings in the Wesnoth source
distribution.</p>
distribution. It can be generated with <code>make macro-reference.xhtml</code> in the data/tools-directory.</p>
<p>The organization of these macros may change in future releases,
and some may be moved out of the default load path. If in doubt,

View file

@ -239,6 +239,7 @@ class CrossRefLister(CrossRef):
doclist.sort(lambda x, y: cmp(self.xref[x][0], self.xref[y][0]))
outstr = ""
filename = None
filenamelist = []
counted = 0
for name in doclist:
entry = self.xref[name][0]
@ -251,7 +252,9 @@ class CrossRefLister(CrossRef):
displayname = filename[len(pref):]
else:
displayname = filename
outstr += "<h1 class='file_header'>From file: " + displayname + "</h1>\n"
outstr += "<p class='toplink'>(<a href='#global'>top</a>)</p>\n"
outstr += "<h1 id='file:" + displayname + "' class='file_header'>From file: " + displayname + "</h1>\n"
filenamelist.append(displayname)
hdr = []
dfp = open(filename)
for line in dfp:
@ -273,7 +276,7 @@ class CrossRefLister(CrossRef):
lines.pop()
if not lines: # Ignore definitions without a docstring
continue
outstr += "\n<dt>\n"
outstr += "\n<dt id='" + header[0] + "'>\n"
outstr += "<em class='macro_name'>" + header[0] + "</em>"
if header[1:]:
outstr += " <em class='macro_formals'>"+" ".join(header[1:])+"</em>"
@ -282,6 +285,13 @@ class CrossRefLister(CrossRef):
outstr += interpret(lines, "macro_explanation")
outstr += "</dd>\n"
outstr += "</dl>\n"
outstr += "<p class='toplink'>(<a href='#global'>top</a>)</p>\n"
linkheaderstr = "<p class='filelist'>Covered macro files:"
for filename in filenamelist:
linkheaderstr += " <a href='#file:" + filename + "'>"
linkheaderstr += filename + "</a>"
linkheaderstr += "</p>\n"
fp.write(linkheaderstr)
fp.write(outstr)
if __name__ == "__main__":