From 3b299be33279a6bfd40ee63b96b56bf08b3200a7 Mon Sep 17 00:00:00 2001 From: Ashley Whetter Date: Sat, 6 Apr 2019 10:33:38 -0700 Subject: [PATCH] Tidied up index page --- autoapi/mappers/base.py | 8 ++++++++ autoapi/templates/index.rst | 23 ++++++++++------------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/autoapi/mappers/base.py b/autoapi/mappers/base.py index cfeefb3..9f711e0 100644 --- a/autoapi/mappers/base.py +++ b/autoapi/mappers/base.py @@ -140,6 +140,14 @@ class PythonMapperBase(object): parts.append("index") return "/".join(parts) + @property + def display(self): + """Whether to display this object or not. + + :type: bool + """ + return True + @property def ref_type(self): return self.type diff --git a/autoapi/templates/index.rst b/autoapi/templates/index.rst index 0a80174..f8c78f0 100644 --- a/autoapi/templates/index.rst +++ b/autoapi/templates/index.rst @@ -1,18 +1,15 @@ -Sphinx AutoAPI Index -#################### +API Reference +============= -This page is the top-level of your generated API documentation. -Below is a list of all items that are documented here. +This page contains auto-generated API reference documentation [#f1]_. .. toctree:: - :includehidden: - :glob: - :maxdepth: 1 + :titlesonly: - {# Force whitespace #} - - {%- for page in pages %} - {%- if page.top_level_object %} + {% for page in pages %} + {% if page.top_level_object and page.display %} {{ page.include_path }} - {%- endif %} - {%- endfor %} + {% endif %} + {% endfor %} + +.. [#f1] Created with `sphinx-autoapi `_