From b1d51276a264849ded93ce943eb0283c1f4f1aba Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 10 Aug 2013 23:32:29 +0000 Subject: Split manpage.template into separate files for different games. Subversion-branch: /branches/v2-branch Subversion-revision: 2614 --- man/docgen | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'man/docgen') 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() -- cgit v1.2.3