-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnamespace.md.twig
More file actions
91 lines (69 loc) · 2.35 KB
/
Copy pathnamespace.md.twig
File metadata and controls
91 lines (69 loc) · 2.35 KB
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
{% import _self as self %}
# Namespaces
[{{ node.name }}]({{ path(node) }})
{% set counter = 0 %}
{# {{ self.renderNamespaceSidebar(node) }} #}
{{ self.renderNamespaceDetails(node) }}
{% macro elementSummary(element, type) %}
##### [{{ element.name }}]({{ path(element) }})
{{ element.summary }}
{% if type == 'function' %}
{% include 'method.html.twig' with {'method': element} %}
{% else %}
{{ element.description|raw }}
{% endif %}
{% endmacro %}{# elementSummary #}
{% macro buildBreadcrumb(element) %}
{% set value = 'no spaces' %}
{% import _self as self %}
{% if element.parent and element.parent.name != '\\' %}{{ self.buildBreadcrumb(element.parent) }}{% endif %}
[{{ element.name }}]({{ path(element) }})
{% endmacro %}
{% macro renderNamespaceDetails(node) %}
{% import _self as self %}
### {{ node.name }}
{% if node.classes|length > 0 or node.interfaces|length > 0 or node.traits|length > 0 or node.functions|length > 0 or node.constants|length > 0 %}
{{ self.buildBreadcrumb(node) }}
{% if node.functions|length > 0 %}
<div class="namespace-indent">
<h3><i class="icon-custom icon-function"></i> Functions</h3>
{% for function in node.functions|sort_asc %}
{{ self.elementSummary(function, 'function') }}
{% endfor %}
</div>
{% endif %}
{% if node.constants|length > 0 %}
<div class="namespace-indent">
<h3><i class="icon-custom icon-constant"></i> Constants</h3>
{% for constant in node.constants %}
{{ self.elementSummary(constant, 'constant') }}
{% endfor %}
</div>
{% endif %}
{% if node.classes|length > 0 or node.interfaces|length > 0 or node.traits|length > 0 %}
### Classes, interfaces and traits
{% for trait in node.traits|sort_asc %}
{{ self.elementSummary(trait, 'trait') }}
{% endfor %}
{% for interface in node.interfaces|sort_asc %}
{{ self.elementSummary(interface, 'interface') }}
{% endfor %}
{% for class in node.classes|sort_asc %}
{{ self.elementSummary(class, 'class') }}
{% endfor %}
{% endif %}{# node.classes|length #}
{% endif %}
{% for namespace in node.children %}
{{ self.renderNamespaceDetails(namespace) }}
{% endfor %}
{% endmacro %}{# renderNamespaceDetails #}
{#
{% macro renderNamespaceSidebar(node) %}
{% import _self as self %}
**{% set counter = counter + 1 %}**
{% for namespace in node.children|sort_asc %}
[{{ namespace.name }}]({{ path(namespace) }})
{{ self.renderNamespaceSidebar(namespace) }}
{% endfor %}
{% endmacro %}
#}