markdown-preprocess: add generic include mechanism

This is what was supposed to be an easy two-or-three-line
change to enable a more general-purpose include mechanism
than '@@option'; one that could include an arbitrary file.

This is commit 2 of 2, the "easy" part. Unfortunately, it's
not looking good. The source .md file has UTF8 checkmarks,
and nroff is not happy with those: the generated man pages
are gross.

Another problem: the source .md might need tweaking, because
we don't want a level 1 header in the man page. Obvious solution
is to make kubernetes_support.md a .md.in file as well, and
move the tables to a separate file (or files). Deferred for later.

Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
Ed Santiago
2022-10-13 15:35:29 -06:00
parent 9cdea7fb37
commit bd4ee2d578
2 changed files with 5 additions and 1 deletions

View File

@ -43,6 +43,10 @@ class Preprocessor():
_, optionname = line.strip().split(" ")
optionfile = os.path.join("options", optionname + '.md')
self.insert_file(fh_out, optionfile)
# '@@include relative-path/must-exist.md'
elif line.startswith('@@include '):
_, path = line.strip().split(" ")
self.insert_file(fh_out, path)
else:
fh_out.write(line)