Skip to content

Commit 39de747

Browse files
committed
intersphinx mapping whitespace resolution
1 parent bed1eac commit 39de747

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

{{ cookiecutter.__dirname }}/docs/{% if cookiecutter.sphinx_docs in ['y', 'yes'] %}conf.py{% endif %}

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,35 @@ extensions = [
2929

3030
autodoc_preserve_defaults = True
3131

32+
{% if cookiecutter.requires_bus_device in ["y", "yes"] and cookiecutter.requires_register in ["y", "yes"] -%}
33+
intersphinx_mapping = {
34+
"python": ("https://docs.python.org/3", None),
35+
"BusDevice": ("https://docs.circuitpython.org/projects/busdevice/en/latest/", None),
36+
"Register": ("https://docs.circuitpython.org/projects/register/en/latest/", None),
37+
"CircuitPython": ("https://docs.circuitpython.org/en/latest/", None),
38+
}
3239

40+
{% elif cookiecutter.requires_bus_device in ["y", "yes"] -%}
3341
intersphinx_mapping = {
3442
"python": ("https://docs.python.org/3", None),
35-
{% if cookiecutter.requires_bus_device in ["y", "yes"] -%}
3643
"BusDevice": ("https://docs.circuitpython.org/projects/busdevice/en/latest/", None),
37-
{%- endif %}
38-
{% if cookiecutter.requires_register in ["y", "yes"] -%}
44+
"CircuitPython": ("https://docs.circuitpython.org/en/latest/", None),
45+
}
46+
47+
{% elif cookiecutter.requires_register in ["y", "yes"] -%}
48+
intersphinx_mapping = {
49+
"python": ("https://docs.python.org/3", None),
3950
"Register": ("https://docs.circuitpython.org/projects/register/en/latest/", None),
40-
{%- endif %}
4151
"CircuitPython": ("https://docs.circuitpython.org/en/latest/", None),
4252
}
4353

54+
{% else -%}
55+
intersphinx_mapping = {
56+
"python": ("https://docs.python.org/3", None),
57+
"CircuitPython": ("https://docs.circuitpython.org/en/latest/", None),
58+
}
59+
60+
{% endif -%}
4461
# Show the docstring from both the class and its __init__() method.
4562
autoclass_content = "both"
4663

0 commit comments

Comments
 (0)