custom-module-template.rst 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. .. Adapted from https://stackoverflow.com/a/62613202
  2. {{ fullname | escape | underline}}
  3. {% block modules %}
  4. {% if modules %}
  5. .. rubric:: Modules
  6. .. autosummary::
  7. :toctree:
  8. :template: custom-module-template.rst
  9. :recursive:
  10. {% for item in modules %}
  11. {% if "test" not in item %}
  12. {{ item }}
  13. {% endif %}
  14. {%- endfor %}
  15. {% endif %}
  16. {% endblock %}
  17. .. automodule:: {{ fullname }}
  18. {% block attributes %}
  19. {% if attributes %}
  20. .. rubric:: Module Attributes
  21. {% for item in attributes %}
  22. .. autoattribute::
  23. {{ item }}
  24. {%- endfor %}
  25. {% endif %}
  26. {% endblock %}
  27. {% block functions %}
  28. {% if functions %}
  29. .. rubric:: {{ _('Functions') }}
  30. {% for item in functions %}
  31. .. autofunction::
  32. {{ item }}
  33. {%- endfor %}
  34. {% endif %}
  35. {% endblock %}
  36. {% block classes %}
  37. {% if classes %}
  38. .. rubric:: {{ _('Classes') }}
  39. {% for item in classes %}
  40. .. autoclass:: {{ item }}
  41. :members:
  42. :special-members: __init__
  43. :private-members:
  44. {%- endfor %}
  45. {% endif %}
  46. {% endblock %}
  47. {% block exceptions %}
  48. {% if exceptions %}
  49. .. rubric:: {{ _('Exceptions') }}
  50. {% for item in exceptions %}
  51. .. autoexception::
  52. {{ item }}
  53. {%- endfor %}
  54. {% endif %}
  55. {% endblock %}