Skip to content

Commit 7c2638f

Browse files
authored
Merge pull request #244 from FoamyGuy/docs_api_rst_title
Changes to make fresh project pass precommit and docs build
2 parents 788309c + 39de747 commit 7c2638f

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
.. If your library file(s) are nested in a directory (e.g. /adafruit_foo/foo.py)
55
.. use this format as the module name: "adafruit_foo.foo"
66

7+
API Reference
8+
#############
9+
710
.. automodule:: {% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | lower }}_{% endif %}{{ cookiecutter.library_name | lower | replace(" ", "_") }}
811
:members:

{{ 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)