summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorSimon Howard2007-12-13 23:04:58 +0000
committerSimon Howard2007-12-13 23:04:58 +0000
commit0054a2e16cc0376cd55c13314ce72a7c06fc8123 (patch)
tree730c6078967e8c729d3781099922fc68c828a706 /man
parent75e34879866ad4381b040daf096c8c3eb2283fde (diff)
downloadchocolate-doom-0054a2e16cc0376cd55c13314ce72a7c06fc8123.tar.gz
chocolate-doom-0054a2e16cc0376cd55c13314ce72a7c06fc8123.tar.bz2
chocolate-doom-0054a2e16cc0376cd55c13314ce72a7c06fc8123.zip
Add a list of wiki pages to link to and automatically insert links.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 987
Diffstat (limited to 'man')
-rwxr-xr-xman/docgen31
-rw-r--r--man/wikipages8
2 files changed, 38 insertions, 1 deletions
diff --git a/man/docgen b/man/docgen
index fe68299d..0319bbc7 100755
--- a/man/docgen
+++ b/man/docgen
@@ -100,6 +100,8 @@ categories = {
"compat": Category("Compatibility"),
}
+wikipages = []
+
# Show options that are in Vanilla Doom? Or only new options?
show_vanilla_options = True
@@ -175,7 +177,7 @@ class Parameter:
result += ": "
- result += self.text
+ result += add_wiki_links(self.text)
if self.platform:
result += "'''(%s only)'''" % self.platform
@@ -221,6 +223,32 @@ class Parameter:
return result
+# Read list of wiki pages
+
+def read_wikipages():
+ f = open("wikipages")
+
+ try:
+ for line in f:
+ line = line.rstrip()
+
+ line = re.sub('\#.*$', '', line)
+
+ if not re.match('^\s*$', line):
+ wikipages.append(line)
+ finally:
+ f.close()
+
+# Add wiki page links
+
+def add_wiki_links(text):
+ for pagename in wikipages:
+ page_re = re.compile('(%s)' % pagename, re.IGNORECASE)
+ # text = page_re.sub("SHOES", text)
+ text = page_re.sub('[[\\1]]', text)
+
+ return text
+
def process_file(file):
f = open(file)
@@ -301,6 +329,7 @@ def manpage_output(dir):
print_file_contents("footer")
def wiki_output(dir):
+ read_wikipages()
process_files(dir)
print categories[None].wiki_output()
diff --git a/man/wikipages b/man/wikipages
new file mode 100644
index 00000000..5b5ce6ba
--- /dev/null
+++ b/man/wikipages
@@ -0,0 +1,8 @@
+# This is a list of wiki pages to automatically link to when generating
+# wikitext output.
+Dehacked
+Doom 1.91
+Configuration
+Merging
+Multiplayer
+Three screen mode