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

{#- Section: Contributors (Markdown) -#}
{#- Renders the contributors section with top contributor tables -#}
{#-
    Context required:
        - contributors (dict): Contributor data and lists
        - config (dict): Configuration options

    This section displays:
        - Top contributors by commit count
        - Matches production format: 8 columns, no Email, includes LOC/Δ LOC
-#}

{% if config.include_sections.contributors and contributors.has_contributors %}
## 👥 Top Contributors

The data presented in the table below covers the past 365 days.

**Contributors Found:** {{ contributors.top_by_commits_count | default(0) | format_number_raw }}

| Rank | Contributor | Commits | LOC | Δ LOC | Avg LOC/Commit | Repositories | Organization |
| --- | --- | --- | --- | --- | --- | --- | --- |
{% for contributor in contributors.top_by_commits %}
| {{ loop.index }} | {{ contributor.name | default('Unknown') }} | {{ contributor.total_commits | default(0) }} | {{ contributor.total_lines_added | format_loc }} | {{ contributor.delta_loc | default(0) }} | {{ contributor.avg_loc_per_commit | format_loc }} | {{ contributor.repositories_count | default(0) }} | {{ contributor.organization | default('Unknown') }} |
{% endfor %}

---
{% endif %}
