doc: extensions: vcs_link: only run for HTML builder
The vcs_link should only run for the HTML builder, since it is the only
target of this extension. The other builders do not have the templates
instance, making them fail.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
diff --git a/doc/_extensions/zephyr/vcs_link.py b/doc/_extensions/zephyr/vcs_link.py
index b9769c8..23aedb5 100644
--- a/doc/_extensions/zephyr/vcs_link.py
+++ b/doc/_extensions/zephyr/vcs_link.py
@@ -67,6 +67,9 @@
def add_jinja_filter(app: Sphinx):
+ if app.builder.name != "html":
+ return
+
app.builder.templates.environment.filters["vcs_link_get_url"] = partial(
vcs_link_get_url, app
)