summaryrefslogtreecommitdiff
path: root/man/docgen
diff options
context:
space:
mode:
authorSimon Howard2013-08-10 23:32:29 +0000
committerSimon Howard2013-08-10 23:32:29 +0000
commitb1d51276a264849ded93ce943eb0283c1f4f1aba (patch)
treee274c46741a10f4636bc89e485afcd0b1b59f144 /man/docgen
parente33e44276d9fc605d0c5096d4ec85e423e8eec8a (diff)
downloadchocolate-doom-b1d51276a264849ded93ce943eb0283c1f4f1aba.tar.gz
chocolate-doom-b1d51276a264849ded93ce943eb0283c1f4f1aba.tar.bz2
chocolate-doom-b1d51276a264849ded93ce943eb0283c1f4f1aba.zip
Split manpage.template into separate files for different games.
Subversion-branch: /branches/v2-branch Subversion-revision: 2614
Diffstat (limited to 'man/docgen')
-rwxr-xr-xman/docgen11
1 files changed, 9 insertions, 2 deletions
diff --git a/man/docgen b/man/docgen
index 219895a2..d9535be8 100755
--- a/man/docgen
+++ b/man/docgen
@@ -34,6 +34,8 @@ import re
import glob
import getopt
+INCLUDE_STATEMENT_RE = re.compile("@include\s+(\S+)")
+
# Find the maximum width of a list of parameters (for plain text output)
def parameter_list_width(params):
@@ -405,8 +407,13 @@ def print_template(template_file, content):
try:
for line in f:
- line = line.replace("@content", content)
- print(line.rstrip())
+ match = INCLUDE_STATEMENT_RE.search(line)
+ if match:
+ filename = match.group(1)
+ print_template(filename, content)
+ else:
+ line = line.replace("@content", content)
+ print(line.rstrip())
finally:
f.close()