Skip to content

Commit

Permalink
markdown-preprocess: add generic include mechanism
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
edsantiago authored and mheon committed Oct 18, 2022
1 parent 42a2218 commit c9c683a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/markdown/podman-kube-play.1.md.in
Expand Up @@ -233,7 +233,7 @@ Pods removed:
`podman kube play --down` will not work with a URL if the YAML file the URL points to
has been changed or altered.

@@option tls-verify
@@include ../../kubernetes_support.md

## SEE ALSO
**[podman(1)](podman.1.md)**, **[podman-kube(1)](podman-kube.1.md)**, **[podman-kube-down(1)](podman-kube-down.1.md)**, **[podman-network-create(1)](podman-network-create.1.md)**, **[podman-kube-generate(1)](podman-kube-generate.1.md)**, **[containers-certs.d(5)](https://github.com/containers/image/blob/main/docs/containers-certs.d.5.md)**
4 changes: 4 additions & 0 deletions hack/markdown-preprocess
Expand Up @@ -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)

Expand Down

0 comments on commit c9c683a

Please sign in to comment.