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:
Gerard Marull-Paretas 2021-06-28 20:08:13 +02:00 committed by Carles Cufí
commit fe7529f917
2 changed files with 25 additions and 0 deletions

View file

@ -17,4 +17,12 @@
<li class="wy-breadcrumbs-aside">
<dark-mode-toggle id="dark-mode-toggle" appearance="toggle" permanent="true"/>
</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 %}

View file

@ -80,6 +80,7 @@ extensions = [
"sphinx_tabs.tabs",
"zephyr.warnings_filter",
"zephyr.doxyrunner",
"zephyr.vcs_link",
"notfound.extension",
"zephyr.external_content",
]
@ -149,6 +150,7 @@ html_context = {
("2.3.0", "/2.3.0/"),
("1.14.1", "/1.14.1/"),
),
"display_vcs_link": True,
}
# -- Options for LaTeX output ---------------------------------------------
@ -221,6 +223,21 @@ warnings_filter_silent = False
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 ----------------------------------
external_content_contents = [