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>
This commit is contained in:
parent
c4cdbc6062
commit
569b794d4b
1 changed files with 3 additions and 0 deletions
|
@ -67,6 +67,9 @@ def vcs_link_get_url(app: Sphinx, pagename: str) -> Optional[str]:
|
||||||
|
|
||||||
|
|
||||||
def add_jinja_filter(app: Sphinx):
|
def add_jinja_filter(app: Sphinx):
|
||||||
|
if app.builder.name != "html":
|
||||||
|
return
|
||||||
|
|
||||||
app.builder.templates.environment.filters["vcs_link_get_url"] = partial(
|
app.builder.templates.environment.filters["vcs_link_get_url"] = partial(
|
||||||
vcs_link_get_url, app
|
vcs_link_get_url, app
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue