readthedocs(sphinx): run the markdown preprocessor

When docs.podman.io is build on readthedocs we have to make sure to
generate the markdown pages first.

It works locally with sphinx but I have no idea if this works on the
readthedocs infra.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2022-08-04 11:44:22 +02:00
parent 65fb90165a
commit 79b10a7c6a

View File

@ -15,6 +15,19 @@
# sys.path.insert(0, os.path.abspath('.'))
import re
import os
import subprocess
# We have to run the preprocessor to create the actual markdown files from .in files.
# Do it here so the it can work on readthedocs as well.
path = os.path.join(os.path.abspath(os.path.dirname(
__file__)), "../../hack/markdown-preprocess")
p = subprocess.Popen(path,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
if p.returncode != 0:
raise Exception("failed to run markdown-preprocess", out, err)
# -- Project information -----------------------------------------------------