summaryrefslogtreecommitdiff
path: root/man/docgen
diff options
context:
space:
mode:
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()