openstack-ansible-security/doc/metadata/template_toc.j2

32 lines
783 B
Django/Jinja

{% set page_title = "STIG Controls by " + toc_type | title %}
{{ "=" * page_title | length }}
{{ page_title }}
{{ "=" * page_title | length }}
.. contents::
:depth: 2
:backlinks: none
{% for section_header, stig_id_list in stig_dict.items() %}
{% if toc_type == 'tag' %}
{% set section_title = section_header + " (" + stig_id_list | length | string + " controls)" %}
{% else %}
{% set section_title = section_header | title + " (" + stig_id_list | length | string + " controls)" %}
{% endif %}
.. _{{ toc_type | replace(' ', '-') }}-{{ section_header | replace(' ', '-') }}:
{{ section_title }}
{{ "=" * section_title | length }}
{% for stig_id in stig_id_list | sort %}
{% include "template_doc.j2" %}
{% if not loop.last %}
----
{% endif %}
{% endfor %}
{% endfor %}