Skip to content

Commit e133910

Browse files
committed
🎨 Improve metadata tables
1 parent d76e86b commit e133910

File tree

3 files changed

+67
-51
lines changed

3 files changed

+67
-51
lines changed

data/templates/vuepress/class.md.twig

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -52,31 +52,40 @@
5252
{%- set traits = traits|merge({ (name): (name|split('\\')|last) }) -%}
5353
{% endfor %}
5454

55-
| Name | {{ class.name }} |
56-
| ----:|:---------------- |
57-
{% if class.parent %}
58-
**Extends** | [{{ class.parent.namespace|trim('\\') -}}\\<span style="font-weight: bold;">{{ class.parent.name }}</span>](/api/classes.html#
59-
{{- class.parent|trim('\\')|lower|replace('\\', '-') }})
60-
{% endif %}
61-
{% for iname, ishort in interfaces if ishort is not empty %}
62-
{% if loop.first -%}
63-
**Implements** |
64-
{%- endif -%}
65-
[{{ iname|trim('\\')|split('\\')|slice(0, -1)|join('\\') }}\\<span style="font-weight: bold;">{{ ishort }}</span>](/api/interfaces.html#{{ iname|lower|replace('\\', '-') }}) {{- '<br />' -}}
66-
{% endfor %}
67-
68-
{% for tName, tShort in traits if tShort is not empty %}
69-
{% if loop.first -%}
70-
**Uses** |
71-
{%- endif -%}
72-
[{{ tName|trim('\\')|split('\\')|slice(0, -1)|join('\\') }}\\<span style="font-weight: bold;">{{ tShort }}</span>](/api/traits.html#{{ tName|trim('\\')|lower|replace('\\', '-') }}) {{- '<br />' -}}
73-
{% endfor %}
74-
75-
{% for author in class.tags.author %}
76-
{% if loop.first %}- **Authors:**{% endif %}
55+
| | |
56+
| ---:|:--- |
57+
| **Extends** |
58+
{%- if class.parent -%}
59+
[{{ class.parent.namespace|trim('\\') -}}\\<span style="font-weight: bold;">{{ class.parent.name }}</span>](/api/classes.html#
60+
{{- class.parent|trim('\\')|lower|replace('\\', '-') }})
61+
{%- else -%}
62+
_Nothing_
63+
{%- endif -%}
64+
|
65+
| **Implements** |
66+
{%- for iname, ishort in interfaces if ishort is not empty -%}
67+
[{{ iname|trim('\\')|split('\\')|slice(0, -1)|join('\\') }}\\<span style="font-weight: bold;">{{ ishort }}</span>](/api/interfaces.html#
68+
{{- iname|lower|replace('\\', '-') }}) <br />
69+
{%- else -%}
70+
_Nothing_
71+
{%- endfor -%}
72+
|
73+
| **Uses** |
74+
{%- for tName, tShort in traits if tShort is not empty -%}
75+
[{{ tName|trim('\\')|split('\\')|slice(0, -1)|join('\\') }}\\<span style="font-weight: bold;">{{ tShort }}</span>](/api/traits.html#
76+
{{- tName|trim('\\')|lower|replace('\\', '-') }}) <br />
77+
{%- else -%}
78+
_Nothing_
79+
{%- endfor -%}
80+
|
7781

78-
- {{ author.description }}
79-
{%- endfor %}
82+
| | |
83+
|:---:| --- |
84+
| **Authors** |
85+
{%- for author in class.tags.author -%}
86+
{{ author.description }} <br />
87+
{%- endfor -%}
88+
|
8089

8190

8291
{% if class.tags.see is not empty or class.tags.link is not empty %}

data/templates/vuepress/interface.md.twig

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,24 @@
2626
{%- set parents = parents|merge({ (name|trim('\\')): (name|split('\\')|last) }) -%}
2727
{% endfor %}
2828

29-
| Name | {{ interface.name }} |
30-
| ----:|:-------------------- |
31-
{% for iname, ishort in parents if ishort is not empty %}
32-
{% if loop.first -%}
33-
**Extends** |
34-
{%- endif -%}
35-
[{{ iname|trim('\\')|split('\\')|slice(0, -1)|join('\\') }}\\<span style="font-weight: bold;">{{ ishort }}</span>](/api/interfaces.html#{{ iname|lower|replace('\\', '-') }}) {{- '<br />' -}}
36-
{% endfor %}
37-
38-
{% for author in interface.tags.author %}
39-
{% if loop.first %}- **Authors:**{% endif %}
29+
| | |
30+
| ---:|:--- |
31+
| **Extends** |
32+
{%- for iname, ishort in parents if ishort is not empty -%}
33+
[{{ iname|trim('\\')|split('\\')|slice(0, -1)|join('\\') }}\\<span style="font-weight: bold;">{{ ishort }}</span>](/api/interfaces.html#
34+
{{- iname|lower|replace('\\', '-') }}) <br />
35+
{%- else -%}
36+
_Nothing_
37+
{%- endfor -%}
38+
|
4039

41-
- {{ author.description }}
42-
{%- endfor %}
40+
| | |
41+
|:---:| --- |
42+
| **Authors** |
43+
{%- for author in interface.tags.author -%}
44+
{{ author.description }} <br />
45+
{%- endfor -%}
46+
|
4347

4448

4549
{% if interface.tags.see is not empty or interface.tags.link is not empty %}

data/templates/vuepress/trait.md.twig

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,24 @@
2727
{%- set usedTraits = usedTraits|merge({ (name): (name|split('\\')|last) }) -%}
2828
{% endfor %}
2929

30-
| Name | {{ trait.name }} |
31-
| ----:|:---------------- |
32-
{% for tName, tShort in usedTraits if tShort is not empty %}{# FIXME #}
33-
{% if loop.first -%}
34-
**Uses** |
35-
{%- endif -%}
36-
[{{ tName|trim('\\')|split('\\')|slice(0, -1)|join('\\') }}\\<span style="font-weight: bold;">{{ tShort }}</span>](/api/traits.html#{{ tShort|lower|replace('\\', '-') }}) {{- '<br />' -}}
37-
{% endfor %}
38-
39-
40-
{% for author in trait.tags.author %}
41-
{% if loop.first %}- **Authors:**{% endif %}
30+
| | |
31+
| ---:| --- |
32+
| ***Uses*** {# FIXME #} |
33+
{%- for tName, tShort in usedTraits if tShort is not empty -%}
34+
[{{ tName|trim('\\')|split('\\')|slice(0, -1)|join('\\') }}\\<span style="font-weight: bold;">{{ tShort }}</span>](/api/traits.html#
35+
{{- tName|trim('\\')|lower|replace('\\', '-') }}) <br />
36+
{%- else -%}
37+
_Nothing_
38+
{%- endfor -%}
39+
|
4240

43-
- {{ author.description }}
44-
{%- endfor %}
41+
| | |
42+
|:---:| --- |
43+
| ***Authors*** |
44+
{%- for author in trait.tags.author -%}
45+
{{ author.description }} <br />
46+
{%- endfor -%}
47+
|
4548

4649

4750
{% if trait.tags.see is not empty or trait.tags.link is not empty %}

0 commit comments

Comments
 (0)