From c9c683a58764d9466eb44862c4948a76cf265d96 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Thu, 13 Oct 2022 15:35:29 -0600 Subject: [PATCH] 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 --- docs/source/markdown/podman-kube-play.1.md.in | 2 +- hack/markdown-preprocess | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/source/markdown/podman-kube-play.1.md.in b/docs/source/markdown/podman-kube-play.1.md.in index 8ff7bc5310d3..a8f1b8610641 100644 --- a/docs/source/markdown/podman-kube-play.1.md.in +++ b/docs/source/markdown/podman-kube-play.1.md.in @@ -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)** diff --git a/hack/markdown-preprocess b/hack/markdown-preprocess index 0768196124d9..d298f27dfd13 100755 --- a/hack/markdown-preprocess +++ b/hack/markdown-preprocess @@ -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)