build(aio): map H3 headings into H4 headings for certain templates (#24000)

The sections such as methods and decorator options are already headed
by a H3 heading so we need to map the H3 headings in the API doc source
down to H4 headings.

This commit includes general heading mapping functionality accessible via
the `marked` Nunjucks filter.

PR Close #24000
This commit is contained in:
Pete Bacon Darwin
2018-05-18 15:07:11 +01:00
committed by Miško Hevery
parent e371b226fa
commit 77309e2ea4
6 changed files with 107 additions and 16 deletions

View File

@ -113,12 +113,24 @@
</td>
</tr>
{% endif %}
{% if method.description %}<tr>
{% if method.description -%}
<tr>
<td class="description">
{$ method.description | marked $}
{$ method.description | marked({ h3: 'h4' }) $}
</td>
</tr>{% endif %}
</tbody>
</tr>
{%- endif %}
{% if method.usageNotes -%}
<tr>
<td class="usage-notes">
<h3>Usage Notes</h3>
{$ method.usageNotes | marked({ h3: 'h4' }) $}
</td>
</tr>
{%- endif %}
</tbody>
</table>
{% endmacro -%}