mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 04:50:12 +03:00
Ensure API docs work with links at first level
This commit is contained in:
parent
4013a2e789
commit
065bb275a4
|
@ -15,8 +15,10 @@
|
|||
</div>
|
||||
|
||||
{% for section_key, section in document.data.items %}
|
||||
{% if section_key %}
|
||||
<h2 id="{{ section_key }}" class="coredocs-section-title">{{ section_key }} <a href="#{{ section_key }}"><i class="fa fa-link" aria-hidden="true"></i>
|
||||
</a></h2>
|
||||
{% endif %}
|
||||
|
||||
{% for link_key, link in section.links.items %}
|
||||
{% include "rest_framework/docs/link.html" %}
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
<ul id="menu-content" class="menu-content collapse out">
|
||||
{% for section_key, section in document.data.items %}
|
||||
<li data-toggle="collapse" data-target="#{{ section_key }}-dropdown" class="collapsed">
|
||||
<a><i class="fa fa-dot-circle-o fa-lg"></i> {{ section_key }} <span class="arrow"></span></a>
|
||||
<a><i class="fa fa-dot-circle-o fa-lg"></i> {% if section_key %}{{ section_key }}{% else %}API Endpoints{% endif %} <span class="arrow"></span></a>
|
||||
</li>
|
||||
<ul class="sub-menu collapse" id="{{ section_key }}-dropdown">
|
||||
<ul class="sub-menu {% if section_key %}collapse{% endif %}" id="{{ section_key }}-dropdown">
|
||||
{% for link_key, link in section.links.items %}
|
||||
<li><a href="#{{ section_key }}-{{ link_key }}">{{ link.title|default:link_key }}</a></li>
|
||||
{% endfor %}
|
||||
|
|
|
@ -39,7 +39,7 @@ class CodeNode(template.Node):
|
|||
|
||||
def render(self, context):
|
||||
text = self.nodelist.render(context)
|
||||
return pygments_highlight(text)
|
||||
return pygments_highlight(text, self.lang, self.style)
|
||||
|
||||
|
||||
@register.filter()
|
||||
|
|
Loading…
Reference in New Issue
Block a user