Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add global_substitutions to fix github links #85

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"sphinx_rtd_theme",
"sphinx_multiversion",
"sphinx_copybutton",
"sphinxcontrib.globalsubs"
]

# If true, `todo` and `todoList` produce output, else they produce nothing.
Expand Down Expand Up @@ -309,9 +310,18 @@ def smv_rewrite_configs(app, config):
app.config.html_baseurl = app.config.html_baseurl + "/" + distro + "/"
app.config.project = "ROS2_Control: " + distro.title()
app.config.html_logo = "images/logo_ros-controls.png"

# see https://github.com/missinglinkelectronics/sphinxcontrib-globalsubs
app.config.global_substitutions = {
'github_branch': branch,
}
else:
# If we are not building a multiversion build, default to the rolling logo
app.config.html_logo = "images/logo_ros-controls.png"
# see https://github.com/missinglinkelectronics/sphinxcontrib-globalsubs
app.config.global_substitutions = {
'github_branch': 'master',
}


def github_link_rewrite_branch(app, pagename, templatename, context, doctree):
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ sphinx
sphinx-copybutton
sphinx-multiversion
sphinx_rtd_theme
sphinxcontrib-globalsubs