Browse Source

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>
pull/39742/head
Gerard Marull-Paretas 4 years ago committed by Carles Cufí
parent
commit
fe7529f917
  1. 8
      doc/_templates/breadcrumbs.html
  2. 17
      doc/conf.py

8
doc/_templates/breadcrumbs.html vendored

@ -17,4 +17,12 @@ @@ -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 %}

17
doc/conf.py

@ -80,6 +80,7 @@ extensions = [ @@ -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 = { @@ -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 @@ -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 = [

Loading…
Cancel
Save