Skip to content

Commit 8ef71a2

Browse files
committed
doc: nrf: enable gh_utils extension
This extension exposes a Jinja filter to obtain the GitHub URL for any document. Together with sphinx_ncs_theme 1.0.21, pages will now show a "Open on GitHub" button. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 9397a22 commit 8ef71a2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

doc/nrf/conf.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"zephyr.link-roles",
4949
"zephyr.dtcompatible-role",
5050
"zephyr.domain",
51+
"zephyr.gh_utils",
5152
"sphinx_tabs.tabs",
5253
"software_maturity_table",
5354
"sphinx_togglebutton",
@@ -214,6 +215,19 @@
214215
"latest" if version.endswith("99") else version
215216
)
216217

218+
# -- Options for zephyr.gh_utils -----------------------------------------------
219+
220+
gh_link_version = "main" if version.endswith("99") else f"v{version}"
221+
gh_link_base_url = f"https://github.com/nrfconnect/sdk-nrf"
222+
gh_link_prefixes = {
223+
"applications/.*": "",
224+
"samples/.*": "",
225+
"scripts/.*": "",
226+
"tests/.*": "",
227+
".*": "doc/nrf",
228+
}
229+
230+
217231
def setup(app):
218232
app.add_css_file("css/nrf.css")
219233

0 commit comments

Comments
 (0)