{#
SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: 2025 The Linux Foundation
#}

{#- Table of Contents Component (Markdown) -#}
{#- Renders a table of contents with links to report sections -#}
{#-
    Context required:
        - config (dict): Configuration options with table_of_contents flag
        - toc (dict): Table of contents data with sections list

    This component displays:
        - Navigation links to each visible section
        - Only rendered if table_of_contents is enabled
        - Sections determined dynamically based on config and data
        - Uses Markdown anchor links for navigation
-#}

{% if config.table_of_contents and toc.has_sections %}
## Table of Contents

{% for section in toc.sections %}
- [{{ section.title }}](#{{ section.anchor }})
{% endfor %}

---

{% endif %}
