diff options
-rw-r--r-- | docs/source/conf.py | 13 | ||||
-rwxr-xr-x | hack/markdown-preprocess | 5 |
2 files changed, 17 insertions, 1 deletions
diff --git a/docs/source/conf.py b/docs/source/conf.py index 505bcbec7..b58bb3f46 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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 ----------------------------------------------------- diff --git a/hack/markdown-preprocess b/hack/markdown-preprocess index 578615845..6d2675cc4 100755 --- a/hack/markdown-preprocess +++ b/hack/markdown-preprocess @@ -8,8 +8,11 @@ import os import sys def main(): + script_dir = os.path.abspath(os.path.dirname(__file__)) + man_dir = os.path.join(script_dir,"../docs/source/markdown") + try: - os.chdir("docs/source/markdown") + os.chdir(man_dir) except FileNotFoundError: raise Exception("Please invoke me from the base repo dir") |