Skip to content

Commit

Permalink
Merge pull request #244 from FoamyGuy/docs_api_rst_title
Browse files Browse the repository at this point in the history
Changes to make fresh project pass precommit and docs build
  • Loading branch information
tannewt authored Jan 13, 2025
2 parents 788309c + 39de747 commit 7c2638f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
.. If your library file(s) are nested in a directory (e.g. /adafruit_foo/foo.py)
.. use this format as the module name: "adafruit_foo.foo"

API Reference
#############

.. automodule:: {% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | lower }}_{% endif %}{{ cookiecutter.library_name | lower | replace(" ", "_") }}
:members:
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,35 @@ extensions = [

autodoc_preserve_defaults = True

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

{% elif cookiecutter.requires_bus_device in ["y", "yes"] -%}
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
{% if cookiecutter.requires_bus_device in ["y", "yes"] -%}
"BusDevice": ("https://docs.circuitpython.org/projects/busdevice/en/latest/", None),
{%- endif %}
{% if cookiecutter.requires_register in ["y", "yes"] -%}
"CircuitPython": ("https://docs.circuitpython.org/en/latest/", None),
}

{% elif cookiecutter.requires_register in ["y", "yes"] -%}
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"Register": ("https://docs.circuitpython.org/projects/register/en/latest/", None),
{%- endif %}
"CircuitPython": ("https://docs.circuitpython.org/en/latest/", None),
}

{% else -%}
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"CircuitPython": ("https://docs.circuitpython.org/en/latest/", None),
}

{% endif -%}
# Show the docstring from both the class and its __init__() method.
autoclass_content = "both"

Expand Down

0 comments on commit 7c2638f

Please sign in to comment.