File tree Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 1
1
module . exports = function ( hbs ) {
2
2
3
+ var context ;
4
+
3
5
hbs . registerHelper ( 'ifCond' , function ( a , b , options ) {
4
6
return a === b ? options . fn ( this ) : options . inverse ( this ) ;
5
7
} ) ;
@@ -12,4 +14,12 @@ module.exports = function (hbs) {
12
14
return String ( name ) . replace ( / \. p r o t o t y p e / g, '' ) ;
13
15
} ) ;
14
16
17
+ hbs . registerHelper ( 'registerContext' , function ( ) {
18
+ context = this ;
19
+ } ) ;
20
+
21
+ hbs . registerHelper ( 'registerVariable' , function ( name , value ) {
22
+ context [ name ] = value ;
23
+ } ) ;
24
+
15
25
} ;
Original file line number Diff line number Diff line change 99
99
100
100
{{ #if ctx }}
101
101
102
+ {{ registerContext this }}
103
+
102
104
<h2 id =" {{ formatId ctx.string }} " >
103
105
<a href =" #{{ formatId ctx.string }} " class =" permalink" >#</a > {{ formatName ctx.string }}
104
106
</h2 >
105
107
106
108
{{{ description.summary }}}
107
109
110
+ {{ #each tags }}{{ #ifCond type " param" }}
111
+ {{ registerVariable " displayParameters" true }}
112
+ {{ /ifCond }}{{ /each }}
113
+
114
+ {{ #if displayParameters }}
115
+
108
116
<section class =" parameters" >
109
117
110
118
<h3 >Parameters</h3 >
130
138
131
139
</section >
132
140
141
+ {{ /if }}
142
+
143
+ {{ #each tags }}{{ #ifCond type " property" }}
144
+ {{ registerVariable " displayProperties" true }}
145
+ {{ /ifCond }}{{ /each }}
146
+
147
+ {{ #if displayProperties }}
148
+
133
149
<section class =" properties" >
134
150
135
151
<h3 >Properties</h3 >
155
171
156
172
</section >
157
173
174
+ {{ /if }}
175
+
158
176
<section class =" examples" >
159
177
160
178
<h3 >Examples</h3 >
Original file line number Diff line number Diff line change 3
3
>{{ description }}
4
4
5
5
{{ #each methods }}{{ #unless ignore }}{{ #if ctx }}
6
+
7
+ {{ registerContext this }}
8
+
6
9
##{{ formatName ctx.string }}
7
10
{{{ description.summary }}}
8
11
12
+ {{ #each tags }}{{ #ifCond type " param" }}
13
+ {{ registerVariable " displayParameters" true }}
14
+ {{ /ifCond }}{{ /each }}
15
+
16
+ {{ #if displayParameters }}
17
+
9
18
###Parameters
10
19
11
20
{{ #each tags }}{{ #ifCond type " param" }}
12
21
- **{{ name }} ** {{ #each types }} `{{ . }} `{{ /each }} {{ #if optional }} _Optional_{{ /if }} {{{ description }}}
13
22
{{ /ifCond }}{{ /each }}
14
23
24
+ {{ /if }}
25
+
26
+ {{ #each tags }}{{ #ifCond type " property" }}
27
+ {{ registerVariable " displayProperties" true }}
28
+ {{ /ifCond }}{{ /each }}
29
+
30
+ {{ #if displayProperties }}
31
+
15
32
###Properties
16
33
17
34
{{ #each tags }}{{ #ifCond type " property" }}
18
35
- **{{ name }} ** {{ #each types }} `{{ . }} `{{ /each }} {{ #if optional }} _Optional_{{ /if }} {{{ description }}}
19
36
{{ /ifCond }}{{ /each }}
20
37
38
+ {{ /if }}
39
+
21
40
###Examples
22
41
23
42
{{{ description.body }}}
You can’t perform that action at this time.
0 commit comments