doc: enable vcs_link extension
Enable the vcs_link extension so that pages contain "Open on Github" link at the top. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
1e79096d9a
commit
fe7529f917
2 changed files with 25 additions and 0 deletions
8
doc/_templates/breadcrumbs.html
vendored
8
doc/_templates/breadcrumbs.html
vendored
|
@ -17,4 +17,12 @@
|
||||||
<li class="wy-breadcrumbs-aside">
|
<li class="wy-breadcrumbs-aside">
|
||||||
<dark-mode-toggle id="dark-mode-toggle" appearance="toggle" permanent="true"/>
|
<dark-mode-toggle id="dark-mode-toggle" appearance="toggle" permanent="true"/>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="wy-breadcrumbs-aside">
|
||||||
|
{%- if display_vcs_link %}
|
||||||
|
{% set vcs_url = pagename | vcs_link_get_url %}
|
||||||
|
{% if vcs_url %}
|
||||||
|
<a href="{{ vcs_url }}" class="fa fa-github"> {{ _('Open on GitHub') }}</a>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
{%- endblock %}
|
{%- endblock %}
|
||||||
|
|
17
doc/conf.py
17
doc/conf.py
|
@ -80,6 +80,7 @@ extensions = [
|
||||||
"sphinx_tabs.tabs",
|
"sphinx_tabs.tabs",
|
||||||
"zephyr.warnings_filter",
|
"zephyr.warnings_filter",
|
||||||
"zephyr.doxyrunner",
|
"zephyr.doxyrunner",
|
||||||
|
"zephyr.vcs_link",
|
||||||
"notfound.extension",
|
"notfound.extension",
|
||||||
"zephyr.external_content",
|
"zephyr.external_content",
|
||||||
]
|
]
|
||||||
|
@ -149,6 +150,7 @@ html_context = {
|
||||||
("2.3.0", "/2.3.0/"),
|
("2.3.0", "/2.3.0/"),
|
||||||
("1.14.1", "/1.14.1/"),
|
("1.14.1", "/1.14.1/"),
|
||||||
),
|
),
|
||||||
|
"display_vcs_link": True,
|
||||||
}
|
}
|
||||||
|
|
||||||
# -- Options for LaTeX output ---------------------------------------------
|
# -- Options for LaTeX output ---------------------------------------------
|
||||||
|
@ -221,6 +223,21 @@ warnings_filter_silent = False
|
||||||
|
|
||||||
notfound_urls_prefix = f"/{version}/" if is_release else "/latest/"
|
notfound_urls_prefix = f"/{version}/" if is_release else "/latest/"
|
||||||
|
|
||||||
|
# -- Options for zephyr.vcs_link ------------------------------------------
|
||||||
|
|
||||||
|
vcs_link_version = f"v{version}" if is_release else "main"
|
||||||
|
vcs_link_base_url = f"https://github.com/zephyrproject-rtos/zephyr/blob/{vcs_link_version}"
|
||||||
|
vcs_link_prefixes = {
|
||||||
|
"samples/.*": "",
|
||||||
|
"boards/.*": "",
|
||||||
|
".*": "doc",
|
||||||
|
}
|
||||||
|
vcs_link_exclude = [
|
||||||
|
"reference/kconfig.*",
|
||||||
|
"reference/devicetree/bindings.*",
|
||||||
|
"reference/devicetree/compatibles.*",
|
||||||
|
]
|
||||||
|
|
||||||
# -- Options for zephyr.external_content ----------------------------------
|
# -- Options for zephyr.external_content ----------------------------------
|
||||||
|
|
||||||
external_content_contents = [
|
external_content_contents = [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue