diff options
Diffstat (limited to 'docs/source/conf.py')
-rw-r--r-- | docs/source/conf.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/docs/source/conf.py b/docs/source/conf.py index 505bcbec7..345e289e1 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 ----------------------------------------------------- @@ -73,12 +86,12 @@ def convert_markdown_title(app, docname, source): if docpath.endswith(".md"): # Convert pandoc title line into eval_rst block for myst_parser # - # Remove the ending "(1)" to avoid it from being displayed + # Remove the ending " 1" (section) to avoid it from being displayed # in the web tab. Often such a text indicates that # a web page got an update. For instance GitHub issues # shows the number of new comments that have been written # after the user's last visit. - source[0] = re.sub(r"^% (.*)(\(\d\))", r"```{title} \g<1>\n```", source[0]) + source[0] = re.sub(r"^% (.*)\s(\d)", r"```{title} \g<1>\n```", source[0]) def setup(app): app.connect("source-read", convert_markdown_title) |