Skip to content

Commit

Permalink
fix: use the correct branch name, and only for branched books
Browse files Browse the repository at this point in the history
  • Loading branch information
Ned Batchelder authored and nedbat committed Jan 13, 2022
1 parent e36e219 commit 3392db1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions shared/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
release_line = "maple"

# The slug that is used by ReadTheDocs for this version of the projects.
project_version = "latest" if (release_line == "master") else f"open-release-master.{release_line}"
project_version = "latest" if (release_line == "master") else f"open-release-{release_line}.master"

# on_rtd is whether we are on readthedocs.io, this line of code grabbed from docs.readthedocs.io
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
Expand Down Expand Up @@ -159,8 +159,15 @@ def feedback_form_url(project, page):
# We often use the same directory to build two books (edX vs Open edX). In
# those cases, only use ism_location for one book, not both, or we'll be
# looking for A's references in an index built for B.
#
# openedx_rtd_url is for books that are branched and built for specific Open
# edX releases. edx_rtd_url is for books that are not.

def edx_rtd_url(slug):
"""Use this with the readthedoc project slug to create the full URL."""
return f"https://edx.readthedocs.io/projects/{slug}/en/latest/"

def openedx_rtd_url(slug):
"""Use this with the readthedoc project slug to create the full URL."""
return f"https://edx.readthedocs.io/projects/{slug}/en/{project_version}/"

Expand All @@ -177,16 +184,16 @@ def ism_location(dir_name):
return None

intersphinx_mapping = {
"opencoursestaff" : (edx_rtd_url("open-edx-building-and-running-a-course"), None),
"opencoursestaff" : (openedx_rtd_url("open-edx-building-and-running-a-course"), None),
"data" : (edx_rtd_url("devdata"), ism_location("data")),
"partnercoursestaff": (edx_rtd_url("edx-partner-course-staff"), ism_location("course_authors")),
"insights" : (edx_rtd_url("edx-insights"), None),
"xblockapi" : (edx_rtd_url("xblock"), None),
"xblocktutorial" : (edx_rtd_url("xblock-tutorial"), ism_location("xblock-tutorial")),
"installation" : (edx_rtd_url("edx-installing-configuring-and-running"), ism_location("install_operations")),
"installation" : (openedx_rtd_url("edx-installing-configuring-and-running"), ism_location("install_operations")),
"olx" : (edx_rtd_url("edx-open-learning-xml"), ism_location("olx")),
"learners" : (edx_rtd_url("edx-guide-for-students"), None),
"openlearners" : (edx_rtd_url("open-edx-learner-guide"), None),
"openlearners" : (openedx_rtd_url("open-edx-learner-guide"), None),
"opendevelopers" : (edx_rtd_url("edx-developer-guide"), None),
"opendataapi" : (edx_rtd_url("edx-data-analytics-api"), None),
"openreleasenotes" : (edx_rtd_url("open-edx-release-notes"), None),
Expand Down

0 comments on commit 3392db1

Please sign in to comment.