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.
# 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 -----------------------------------------------------
