File: source-file.html

package info (click to toggle)
mkdocs-material 9.6.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 76,636 kB
  • sloc: javascript: 3,965; python: 3,622; makefile: 2
file content (110 lines) | stat: -rw-r--r-- 3,590 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{#-
  This file was automatically generated - do not edit
-#}
{% macro render_updated(date) %}
  <span class="md-source-file__fact">
    <span class="md-icon" title="{{ lang.t('source.file.date.updated') }}">
      {% include ".icons/material/clock-edit-outline.svg" %}
    </span>
    {{ date }}
  </span>
{% endmacro %}
{% macro render_created(date) %}
  <span class="md-source-file__fact">
    <span class="md-icon" title="{{ lang.t('source.file.date.created') }}">
      {% include ".icons/material/clock-plus-outline.svg" %}
    </span>
    {{ date }}
  </span>
{% endmacro %}
{% macro render_authors(authors) %}
  {% set git_authors = config.plugins.get("git-authors") %}
  <span class="md-source-file__fact">
    <span class="md-icon" title="{{ lang.t('source.file.contributors') }}">
      {% if authors | length == 1 %}
        {% include ".icons/material/account.svg" %}
      {% else %}
        {% include ".icons/material/account-group.svg" %}
      {% endif %}
    </span>
    <nav>
      {% for author in authors %}
        {%- if git_authors.config.show_email_address %}
        <a href="mailto:{{ author.email }}">
          {{- author.name -}}
        </a>
        {%- else -%}
          {{- author.name -}}
        {% endif -%}
        {%- if loop.revindex > 1 %}, {% endif -%}
      {% endfor %}
    </nav>
  </span>
{% endmacro %}
{% macro render_committers_github(title) %}
  <span class="md-icon" title="{{ lang.t('source.file.contributors') }}">
    {% include ".icons/material/github.svg" %}
  </span>
  <span>{{ title }}</span>
{% endmacro %}
{% macro render_committers_gitlab(title) %}
  <span class="md-icon" title="{{ lang.t('source.file.contributors') }}">
    {% include ".icons/material/gitlab.svg" %}
  </span>
  <span>{{ title }}</span>
{% endmacro %}
{% macro render_committers(authors) %}
  <span class="md-source-file__fact">
    {% if committers_source == "gitlab" %}
      {{ render_committers_gitlab("GitLab") }}
    {% else %}
      {{ render_committers_github("GitHub") }}
    {% endif %}
    <nav>
      {% for author in authors[:4] %}
        <a href="{{ author.url }}" class="md-author" title="@{{ author.login }}">
          {% set separator = "&" if "?" in author.avatar else "?" %}
          <img src="{{ author.avatar }}{{ separator }}size=72" alt="{{ author.name or 'GitHub user' }}">
        </a>
      {% endfor %}
      {% set more = authors[4:] | length %}
      {% if more > 0 %}
        {% if page.edit_url %}
          <a href="{{ page.edit_url | replace('edit', 'blob') }}" class="md-author md-author--more">
            +{{ more }}
          </a>
        {% else %}
          <span class="md-author md-author--more">
            +{{ more }}
          </span>
        {% endif %}
      {% endif %}
    </nav>
  </span>
{% endmacro %}
{% if page.meta %}
  {% if page.meta.git_revision_date_localized %}
    {% set updated = page.meta.git_revision_date_localized %}
  {% elif page.meta.revision_date %}
    {% set updated = page.meta.revision_date %}
  {% endif %}
  {% if page.meta.git_creation_date_localized %}
    {% set created = page.meta.git_creation_date_localized %}
  {% endif %}
{% endif %}
{% if updated or created or git_info or committers %}
  <aside class="md-source-file">
    {% if updated %}
      {{ render_updated(updated) }}
    {% endif %}
    {% if created %}
      {{ render_created(created) }}
    {% endif %}
    {% if git_info %}
      {{ render_authors(git_info.get("page_authors")) }}
    {% endif %}
    {% if committers %}
      {{ render_committers(committers) }}
    {% endif %}
  </aside>
{% endif %}