module.rst 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. {% if not obj.display %}
  2. :orphan:
  3. {% endif %}
  4. :mod:`{{ obj.name }}`
  5. ======={{ "=" * obj.name|length }}
  6. .. py:module:: {{ obj.name }}
  7. {% if obj.docstring %}
  8. .. autoapi-nested-parse::
  9. {{ obj.docstring|prepare_docstring|indent(3) }}
  10. {% endif %}
  11. {% block subpackages %}
  12. {% set visible_subpackages = obj.subpackages|selectattr("display")|list %}
  13. {% if visible_subpackages %}
  14. .. toctree::
  15. :titlesonly:
  16. :maxdepth: 3
  17. {% for subpackage in visible_subpackages %}
  18. {{ subpackage.short_name }}/index.rst
  19. {% endfor %}
  20. {% endif %}
  21. {% endblock %}
  22. {% block submodules %}
  23. {% set visible_submodules = obj.submodules|selectattr("display")|list %}
  24. {% if visible_submodules %}
  25. .. toctree::
  26. :titlesonly:
  27. :maxdepth: 1
  28. {% for submodule in visible_submodules %}
  29. {{ submodule.short_name }}/index.rst
  30. {% endfor %}
  31. {% endif %}
  32. {% endblock %}
  33. {% block content %}
  34. {% if obj.all is not none %}
  35. {% set visible_children = obj.children|selectattr("short_name", "in", obj.all)|list %}
  36. {% elif obj.type is equalto("package") %}
  37. {% set visible_children = obj.children|selectattr("display")|list %}
  38. {% else %}
  39. {% set visible_children = obj.children|selectattr("display")|rejectattr("imported")|list %}
  40. {% endif %}
  41. {% if visible_children %}
  42. {{ "-" * obj.type|length }}---------
  43. {% set visible_classes = visible_children|selectattr("type", "equalto", "class")|list %}
  44. {% set visible_functions = visible_children|selectattr("type", "equalto", "function")|list %}
  45. {% if "show-module-summary" in autoapi_options and (visible_classes or visible_functions) %}
  46. {% block classes %}
  47. {% if visible_classes %}
  48. Classes
  49. ~~~~~~~
  50. .. autoapisummary::
  51. {% for klass in visible_classes %}
  52. {{ klass.id }}
  53. {% endfor %}
  54. {% endif %}
  55. {% endblock %}
  56. {% block functions %}
  57. {% if visible_functions %}
  58. Functions
  59. ~~~~~~~~~
  60. .. autoapisummary::
  61. {% for function in visible_functions %}
  62. {{ function.id }}
  63. {% endfor %}
  64. {% endif %}
  65. {% endblock %}
  66. {% endif %}
  67. {% for obj_item in visible_children %}
  68. {{ obj_item.rendered|indent(0) }}
  69. {% endfor %}
  70. {% endif %}
  71. {% endblock %}