-
Notifications
You must be signed in to change notification settings - Fork 0
/
section._
153 lines (140 loc) · 5.93 KB
/
section._
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<section class='p2 mb2 clearfix bg-white minishadow'>
<% if (typeof nested === 'undefined' || (section.context && section.context.github)) { %>
<div class='clearfix'>
<% if (typeof nested === 'undefined') { %>
<h3 class='fl m0' id='<%- slug(section.namespace) %>'>
<%- section.name %>
</h3>
<% } %>
<% if (section.context && section.context.github) { %>
<a class='fr fill-darken0 round round pad1x quiet h5' href='<%= section.context.github.url %>'>
<span><%= section.context.github.path %></span>
</a>
<% } %>
</div>
<% } %>
<%= md(section.description) %>
<% if (section.type) { %>
<p>
Type:
<%= formatType(section.type) %>
</p>
<% } %>
<% if (section.augments && section.augments.length) { %>
<p>
Extends
<% if (section.augments) { %>
<%= section.augments.map(function(tag) {
return autolink(tag.name);
}).join(', ') %>
<% } %>
</p>
<% } %>
<% if (section.deprecated) { %><div>Deprecated: <%= md(section.deprecated, true) %></div><% }%>
<% if (section.version) { %><div>Version: <%- section.version %></div><% }%>
<% if (section.license) { %><div>License: <%- section.license %></div><% }%>
<% if (section.author) { %><div>Author: <%- section.author %></div><% }%>
<% if (section.copyright) { %><div>Copyright: <%= md(section.copyright, true) %></div><% }%>
<% if (section.since) { %><div>Since: <%- section.since %></div><% }%>
<% if (section.params && section.params.length) { %>
<div class='py1 quiet mt1 prose-big'>Parameters</div>
<div class='prose'>
<% section.params.forEach(function(param) { %>
<div class='space-bottom0'>
<div>
<span class='code bold'><%- param.name%></span> <code class='quiet'>(<%= formatType(param.type) %><% if (param.default) { %>
= <code><%- param.default %></code><% } %>)</code>
<%= md(param.description, true) %>
</div>
<% if (param.properties && param.properties.length) { %>
<table class='mt1 mb2 fixed-table h5 col-12'>
<colgroup>
<col width='30%' />
<col width='70%' />
</colgroup>
<thead>
<tr class='bold fill-light'>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody class='mt1'>
<% param.properties.forEach(function(property) { %>
<%= renderParamProperty({
property: property,
renderParamProperty: renderParamProperty
}) %>
<% }) %>
</tbody>
</table>
<% } %>
</div>
<% }) %>
</div>
<% } %>
<% if (section.properties && section.properties.length) { %>
<div class='py1 quiet mt1 prose-big'>Properties</div>
<div>
<% section.properties.forEach(function(property) { %>
<div class='space-bottom0'>
<span class='code bold'><%- property.name%></span> <code class='quiet'>(<%= formatType(property.type) %>)</code>
<% if (property.default) { %>
(default <code><%- property.default %></code>)
<% } %><% if (property.description) {
%>: <%= md(property.description, true) %><%
} %>
<% if (property.properties && property.properties.length) { %>
<ul>
<% property.properties.forEach(function(property) { %>
<li><code><%- property.name %></code> <%= formatType(property.type) %>
<% if (property.default) { %>
(default <code><%- property.default %></code>)
<% } %>
<%= md(property.description) %></li>
<% }) %>
</ul>
<% } %>
</div>
<% }) %>
</div>
<% } %>
<% if (section.returns && section.returns.length) { %>
<% section.returns.forEach(function(ret) { %>
<div class='py1 quiet mt1 prose-big'>Returns</div>
<code><%= formatType(ret.type) %></code><% if (ret.description) { %>:
<%= md(ret.description, true) %>
<% }%>
<% }) %>
<% } %>
<% if (section.throws && section.throws.length) { %>
<div class='py1 quiet mt1 prose-big'>Throws</div>
<ul>
<% section.throws.forEach(function(throws) { %>
<li><%= formatType(throws.type) %>: <%= md(throws.description, true) %></li>
<% }); %>
</ul>
<% } %>
<% if (section.examples && section.examples.length) { %>
<div class='py1 quiet mt1 prose-big'>Example</div>
<% section.examples.forEach(function(example) { %>
<% if (example.caption) { %><p><%= md(example.caption) %></p><% } %>
<pre class='p1 overflow-auto round fill-light'><%= highlight(example.description) %></pre>
<% }) %>
<% } %>
<% if (section.members.static && section.members.static.length) { %>
<div class='py1 quiet mt1 prose-big'>Static Members</div>
<%= renderSectionList({ members: section.members.static, renderSection: renderSection, renderParamProperty: renderParamProperty, noun: 'Static Member' }) %>
<% } %>
<% if (section.members.instance && section.members.instance.length) { %>
<div class='py1 quiet mt1 prose-big'>Instance Members</div>
<%= renderSectionList({ members: section.members.instance, renderSection: renderSection, renderParamProperty: renderParamProperty, noun: 'Instance Member' }) %>
<% } %>
<% if (section.members.inner && section.members.inner.length) { %>
<div class='py1 quiet mt1 prose-big'>Inner Members</div>
<%= renderSectionList({ members: section.members.inner, renderSection: renderSection, renderParamProperty: renderParamProperty, noun: 'Inner Member' }) %>
<% } %>
<% if (section.members.events && section.members.events.length) { %>
<div class='py1 quiet mt1 prose-big'>Events</div>
<%= renderSectionList({ members: section.members.events, renderSection: renderSection, renderParamProperty: renderParamProperty, noun: 'Event' }) %>
<% } %>
</section>