diff options
Diffstat (limited to 'man/docgen')
-rwxr-xr-x | man/docgen | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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() |