diff --git a/rest_framework/templates/rest_framework/docs/_recursive_document.html b/rest_framework/templates/rest_framework/docs/_recursive_document.html new file mode 100644 index 000000000..d0f904aa3 --- /dev/null +++ b/rest_framework/templates/rest_framework/docs/_recursive_document.html @@ -0,0 +1,15 @@ +{% for section_key, section in items %} +{% if section_key %} + {{ section_key }} + +{% endif %} + + {% if section.links.items %} + {% for link_key, link in section.links.items %} + {% include "rest_framework/docs/link.html" with prefix=prefix level=level|add:1%} + {% endfor %} + {% else %} + {% include 'rest_framework/docs/_recursive_document.html' with items=section.items prefix=prefix|add:section_key|add:'/' level=level|add:1 %} + {% endif %} +{% endfor %} + diff --git a/rest_framework/templates/rest_framework/docs/_recursive_menu.html b/rest_framework/templates/rest_framework/docs/_recursive_menu.html new file mode 100644 index 000000000..d00a16747 --- /dev/null +++ b/rest_framework/templates/rest_framework/docs/_recursive_menu.html @@ -0,0 +1,17 @@ + + diff --git a/rest_framework/templates/rest_framework/docs/document.html b/rest_framework/templates/rest_framework/docs/document.html index c2dcb3ddc..375c3a97e 100644 --- a/rest_framework/templates/rest_framework/docs/document.html +++ b/rest_framework/templates/rest_framework/docs/document.html @@ -14,16 +14,7 @@ -{% for section_key, section in document.data.items %} -{% if section_key %} -

{{ section_key }} -

-{% endif %} - - {% for link_key, link in section.links.items %} - {% include "rest_framework/docs/link.html" %} - {% endfor %} -{% endfor %} +{% include 'rest_framework/docs/_recursive_document.html' with items=document.data.items level=2 %} {% for link_key, link in document.links.items %} {% include "rest_framework/docs/link.html" %} diff --git a/rest_framework/templates/rest_framework/docs/interact.html b/rest_framework/templates/rest_framework/docs/interact.html index 3703301c2..4d2f8b063 100644 --- a/rest_framework/templates/rest_framework/docs/interact.html +++ b/rest_framework/templates/rest_framework/docs/interact.html @@ -16,7 +16,7 @@ -
+