Skip to content

Commit d4fd3ad

Browse files
authored
Merge pull request #12689 from jsquyres/pr/v5.0.x/rtd-updates
v5.0.x: Read The Docs updates
2 parents a1d722d + b829550 commit d4fd3ad

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

docs/Makefile.am

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,14 @@ ALL_MAN_BUILT = \
881881
# built HTML and man docs into a separate location that is included in
882882
# the tarball. This gives users a fully copy of the docs included in
883883
# distribution tarballs.
884-
html: $(ALL_MAN_BUILT)
884+
#
885+
# Note: we name this "html-local" because otherwise Automake issues a
886+
# warning about us overriding its default "html" target. In our
887+
# particular use case, the rules generated if we name this target
888+
# "html-local" instead of "html" are effectively equivalent to when we
889+
# name this target "html", so we might as well avoid the Automake
890+
# warning.
891+
html-local: $(ALL_MAN_BUILT)
885892
$(OMPI_V_COPYALL) rm -rf html; cp -rp $(OUTDIR)/html .
886893

887894
man: $(ALL_MAN_BUILT)

docs/conf.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ def read_version_file(path):
3737
if not os.path.exists(path):
3838
print(f"ERROR: Unable to find file {path}")
3939
exit(1)
40-
40+
4141
with open(path) as fp:
4242
version_lines = fp.readlines()
43-
43+
4444
data = dict()
4545
for line in version_lines:
4646
if '#' in line:
@@ -129,6 +129,15 @@ def get_tarball_version(path, expr):
129129
if key in os.environ and os.environ[key] == 'True':
130130
print("OMPI: found ReadTheDocs build environment")
131131

132+
# Tell Jinja2 templates the build is running on Read the Docs
133+
if "html_context" not in globals():
134+
html_context = {}
135+
html_context["READTHEDOCS"] = True
136+
137+
# Define the canonical URL if you are using a custom domain on
138+
# Read the Docs
139+
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
140+
132141
rtd_v = os.environ['READTHEDOCS_VERSION']
133142
if os.environ['READTHEDOCS_VERSION_TYPE'] == 'external':
134143
# Make "release" be shorter than the full "ompi_ver" value.

0 commit comments

Comments
 (0)