Skip to content

Commit

Permalink
Merge pull request #12687 from jsquyres/pr/rtd-updates
Browse files Browse the repository at this point in the history
Read The Docs updates
  • Loading branch information
jsquyres authored Jul 18, 2024
2 parents 1c47c87 + db7ff49 commit 1a60234
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
9 changes: 8 additions & 1 deletion docs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,14 @@ ALL_MAN_BUILT = \
# built HTML and man docs into a separate location that is included in
# the tarball. This gives users a fully copy of the docs included in
# distribution tarballs.
html: $(ALL_MAN_BUILT)
#
# Note: we name this "html-local" because otherwise Automake issues a
# warning about us overriding its default "html" target. In our
# particular use case, the rules generated if we name this target
# "html-local" instead of "html" are effectively equivalent to when we
# name this target "html", so we might as well avoid the Automake
# warning.
html-local: $(ALL_MAN_BUILT)
$(OMPI_V_COPYALL) rm -rf html; cp -rp $(OUTDIR)/html .

man: $(ALL_MAN_BUILT)
Expand Down
13 changes: 11 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ def read_version_file(path):
if not os.path.exists(path):
print(f"ERROR: Unable to find file {path}")
exit(1)

with open(path) as fp:
version_lines = fp.readlines()

data = dict()
for line in version_lines:
if '#' in line:
Expand Down Expand Up @@ -129,6 +129,15 @@ def get_tarball_version(path, expr):
if key in os.environ and os.environ[key] == 'True':
print("OMPI: found ReadTheDocs build environment")

# Tell Jinja2 templates the build is running on Read the Docs
if "html_context" not in globals():
html_context = {}
html_context["READTHEDOCS"] = True

# Define the canonical URL if you are using a custom domain on
# Read the Docs
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")

rtd_v = os.environ['READTHEDOCS_VERSION']
if os.environ['READTHEDOCS_VERSION_TYPE'] == 'external':
# Make "release" be shorter than the full "ompi_ver" value.
Expand Down

0 comments on commit 1a60234

Please sign in to comment.