clean-jsdoc-theme 3.3.4 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +4 -4
- package/.eslintrc.js +3 -3
- package/.github/ISSUE_TEMPLATE/bug_report.md +43 -43
- package/.github/ISSUE_TEMPLATE/feature_request.md +27 -27
- package/.github/pull_request_template.md +16 -16
- package/.github/workflows/codeql-analysis.yml +67 -67
- package/.prettierignore +2 -2
- package/.prettierrc +5 -5
- package/.stylelintignore +3 -3
- package/.stylelintrc +23 -23
- package/.travis.yml +30 -30
- package/CHANGELOG.md +232 -216
- package/CODE_OF_CONDUCT.md +76 -76
- package/CODE_OF_CONDUCT_HINDI.md +46 -46
- package/CONTRIBUTING.md +24 -24
- package/LICENSE +21 -21
- package/README.md +439 -546
- package/SECURITY.md +21 -21
- package/helpers/down-arrow.js +9 -9
- package/jsdoc-config.json +62 -60
- package/minify.js +48 -0
- package/package.json +50 -46
- package/publish.js +1131 -1197
- package/static/fonts/Inconsolata-Regular.ttf +0 -0
- package/static/fonts/OpenSans-Regular.ttf +0 -0
- package/static/fonts/WorkSans-Bold.ttf +0 -0
- package/static/scripts/core.js +576 -0
- package/static/scripts/core.min.js +23 -0
- package/static/scripts/resize.js +90 -85
- package/static/scripts/search.js +244 -77
- package/static/scripts/search.min.js +11 -0
- package/static/scripts/third-party/Apache-License-2.0.txt +202 -202
- package/static/scripts/third-party/fuse.js +8 -8
- package/static/scripts/third-party/hljs-line-num.js +1 -0
- package/static/scripts/third-party/hljs.js +1173 -0
- package/static/scripts/third-party/popper.js +6 -0
- package/static/scripts/third-party/tippy.js +2 -0
- package/static/scripts/third-party/tocbot.js +1 -0
- package/static/styles/clean-jsdoc-theme-base.css +941 -393
- package/static/styles/clean-jsdoc-theme-dark.css +411 -324
- package/static/styles/clean-jsdoc-theme-light.css +392 -319
- package/static/styles/clean-jsdoc-theme.min.css +1 -0
- package/tmpl/augments.tmpl +10 -10
- package/tmpl/container.tmpl +190 -189
- package/tmpl/details.tmpl +208 -208
- package/tmpl/example.tmpl +3 -3
- package/tmpl/examples.tmpl +40 -38
- package/tmpl/exceptions.tmpl +32 -32
- package/tmpl/icons.tmpl +72 -34
- package/tmpl/layout.tmpl +146 -165
- package/tmpl/mainpage.tmpl +10 -10
- package/tmpl/members.tmpl +42 -43
- package/tmpl/method.tmpl +139 -140
- package/tmpl/mobile-sidebar.tmpl +21 -0
- package/tmpl/navbar-actions.tmpl +19 -0
- package/tmpl/navbar-menu.tmpl +21 -0
- package/tmpl/navbar.tmpl +14 -0
- package/tmpl/params.tmpl +124 -124
- package/tmpl/properties.tmpl +109 -109
- package/tmpl/returns.tmpl +18 -18
- package/tmpl/search.tmpl +17 -0
- package/tmpl/sidebar-items.tmpl +24 -0
- package/tmpl/sidebar-title.tmpl +10 -0
- package/tmpl/sidebar.tmpl +9 -0
- package/tmpl/source.tmpl +12 -7
- package/tmpl/toc.tmpl +4 -0
- package/tmpl/tutorial.tmpl +19 -19
- package/tmpl/type.tmpl +6 -6
- package/helpers/navbarBuilder.js +0 -0
- package/static/fonts/MavenPro-Regular.ttf +0 -0
- package/static/fonts/Montserrat-Regular.ttf +0 -0
- package/static/fonts/Muli-Black.ttf +0 -0
- package/static/fonts/OFL-hind.txt +0 -93
- package/static/fonts/OFL-montserrat.txt +0 -93
- package/static/scripts/fix-code-block.js +0 -53
- package/static/scripts/fix-navbar.js +0 -25
- package/static/scripts/linenumber.js +0 -25
- package/static/scripts/misc.js +0 -217
- package/static/scripts/third-party/lang-css.js +0 -2
- package/static/scripts/third-party/prettify.js +0 -28
- package/static/styles/reset.css +0 -351
- package/static/styles/third-party/ionicons.min.css +0 -11
- package/static/styles/third-party/prettify-jsdoc.css +0 -111
- package/static/styles/third-party/prettify-tomorrow.css +0 -5
package/tmpl/method.tmpl
CHANGED
|
@@ -1,140 +1,139 @@
|
|
|
1
|
-
<?js
|
|
2
|
-
var data = obj;
|
|
3
|
-
var self = this;
|
|
4
|
-
?>
|
|
5
|
-
<?js if (data.kind !== 'module' && !data.hideconstructor) { ?>
|
|
6
|
-
<?js if (data.kind === 'class' && data.classdesc) { ?>
|
|
7
|
-
<h2>Constructor</h2>
|
|
8
|
-
<?js } ?>
|
|
9
|
-
|
|
10
|
-
<h4 class="name" id="<?js= id ?>">
|
|
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
|
-
<?js
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
<?js } ?>
|
|
1
|
+
<?js
|
|
2
|
+
var data = obj;
|
|
3
|
+
var self = this;
|
|
4
|
+
?>
|
|
5
|
+
<?js if (data.kind !== 'module' && !data.hideconstructor) { ?>
|
|
6
|
+
<?js if (data.kind === 'class' && data.classdesc) { ?>
|
|
7
|
+
<h2 id="constructor" class="has-anchor">Constructor</h2>
|
|
8
|
+
<?js } ?>
|
|
9
|
+
|
|
10
|
+
<h4 class="name has-anchor" id="<?js= id ?>">
|
|
11
|
+
<?js= data.attribs + (kind === 'class' ? 'new ' : '') + name + (data.signature || '') ?>
|
|
12
|
+
</h4>
|
|
13
|
+
|
|
14
|
+
<?js if (data.summary) { ?>
|
|
15
|
+
<p class="summary"><?js= summary ?></p>
|
|
16
|
+
<?js } ?>
|
|
17
|
+
<?js } ?>
|
|
18
|
+
|
|
19
|
+
<?js if (data.kind !== 'module' && data.description) { ?>
|
|
20
|
+
<div class="description">
|
|
21
|
+
<?js= data.description ?>
|
|
22
|
+
</div>
|
|
23
|
+
<?js } ?>
|
|
24
|
+
|
|
25
|
+
<?js if (data.augments && data.alias && data.alias.indexOf('module:') === 0) { ?>
|
|
26
|
+
<div class="method-member-container mt-20">
|
|
27
|
+
<strong>Extends:</strong>
|
|
28
|
+
<?js= self.partial('augments.tmpl', data) ?>
|
|
29
|
+
</div>
|
|
30
|
+
<?js } ?>
|
|
31
|
+
|
|
32
|
+
<?js if (kind === 'event' && data.type && data.type.names) {?>
|
|
33
|
+
<div class="method-member-container mt-20">
|
|
34
|
+
<strong>Type:</strong>
|
|
35
|
+
<ul>
|
|
36
|
+
<li>
|
|
37
|
+
<?js= self.partial('type.tmpl', data.type.names) ?>
|
|
38
|
+
</li>
|
|
39
|
+
</ul>
|
|
40
|
+
</div>
|
|
41
|
+
<?js } ?>
|
|
42
|
+
|
|
43
|
+
<?js if (data['this']) { ?>
|
|
44
|
+
<div class="method-member-container mt-20">
|
|
45
|
+
<strong>This:</strong>
|
|
46
|
+
<ul><li><?js= this.linkto(data['this'], data['this']) ?></li></ul>
|
|
47
|
+
</div>
|
|
48
|
+
<?js } ?>
|
|
49
|
+
|
|
50
|
+
<?js if (data.params && params.length) { ?>
|
|
51
|
+
<div class="method-member-container flex flex-col w-100 overflow-auto mt-20">
|
|
52
|
+
<strong>Parameters:</strong>
|
|
53
|
+
<?js= this.partial('params.tmpl', params) ?>
|
|
54
|
+
</div>
|
|
55
|
+
<?js } ?>
|
|
56
|
+
|
|
57
|
+
<?js= this.partial('details.tmpl', data) ?>
|
|
58
|
+
|
|
59
|
+
<?js if (data.kind !== 'module' && data.requires && data.requires.length) { ?>
|
|
60
|
+
<div class="method-member-container flex flex-col w-100 overflow-auto mt-20">
|
|
61
|
+
<strong>Requires:</strong>
|
|
62
|
+
<ul>
|
|
63
|
+
<?js data.requires.forEach(function(r) { ?>
|
|
64
|
+
<li><?js= self.linkto(r) ?></li>
|
|
65
|
+
<?js }); ?>
|
|
66
|
+
</ul>
|
|
67
|
+
</div>
|
|
68
|
+
<?js } ?>
|
|
69
|
+
|
|
70
|
+
<?js if (data.fires && fires.length) { ?>
|
|
71
|
+
<div class="method-member-container flex w-100 overflow-auto mt-20">
|
|
72
|
+
<strong>Fires:</strong>
|
|
73
|
+
<ul>
|
|
74
|
+
<?js fires.forEach(function(f) { ?>
|
|
75
|
+
<li><?js= self.linkto(f) ?></li>
|
|
76
|
+
<?js }); ?>
|
|
77
|
+
</ul>
|
|
78
|
+
</div>
|
|
79
|
+
<?js } ?>
|
|
80
|
+
|
|
81
|
+
<?js if (data.listens && listens.length) { ?>
|
|
82
|
+
<div class="method-member-container flex w-100 overflow-auto mt-20">
|
|
83
|
+
<strong>Listens to Events:</strong>
|
|
84
|
+
<ul>
|
|
85
|
+
<?js listens.forEach(function(f) { ?>
|
|
86
|
+
<li><?js= self.linkto(f) ?></li>
|
|
87
|
+
<?js }); ?>
|
|
88
|
+
</ul>
|
|
89
|
+
</div>
|
|
90
|
+
<?js } ?>
|
|
91
|
+
|
|
92
|
+
<?js if (data.listeners && listeners.length) { ?>
|
|
93
|
+
<div class="method-member-container mt-20">
|
|
94
|
+
<strong>Listeners of This Event:</strong>
|
|
95
|
+
<ul>
|
|
96
|
+
<?js listeners.forEach(function(f) { ?>
|
|
97
|
+
<li><?js= self.linkto(f) ?></li>
|
|
98
|
+
<?js }); ?>
|
|
99
|
+
</ul>
|
|
100
|
+
</div>
|
|
101
|
+
<?js } ?>
|
|
102
|
+
|
|
103
|
+
<?js if (data.exceptions && exceptions.length) { ?>
|
|
104
|
+
<div class="method-member-container mt-20">
|
|
105
|
+
<strong>Throws:</strong>
|
|
106
|
+
<?js if (exceptions.length > 1) { ?>
|
|
107
|
+
<ul>
|
|
108
|
+
<?js exceptions.forEach(function(r) { ?>
|
|
109
|
+
<li><?js= self.partial('exceptions.tmpl', r) ?></li>
|
|
110
|
+
<?js }); ?>
|
|
111
|
+
</ul>
|
|
112
|
+
<?js } else { exceptions.forEach(function(r) { ?>
|
|
113
|
+
<?js= self.partial('exceptions.tmpl', r) ?>
|
|
114
|
+
<?js });} ?>
|
|
115
|
+
</div>
|
|
116
|
+
<?js } ?>
|
|
117
|
+
|
|
118
|
+
<?js if (data.returns && returns.length) { ?>
|
|
119
|
+
<div class="method-member-container mt-20">
|
|
120
|
+
<strong>Returns:</strong>
|
|
121
|
+
<?js if (returns.length > 1) { ?>
|
|
122
|
+
<ul>
|
|
123
|
+
<?js returns.forEach(function(r) { ?>
|
|
124
|
+
<li><?js= self.partial('returns.tmpl', r) ?></li>
|
|
125
|
+
<?js }); ?>
|
|
126
|
+
</ul>
|
|
127
|
+
|
|
128
|
+
<?js } else { returns.forEach(function(r) { ?>
|
|
129
|
+
<?js= self.partial('returns.tmpl', r) ?>
|
|
130
|
+
<?js });} ?>
|
|
131
|
+
</div>
|
|
132
|
+
<?js } ?>
|
|
133
|
+
|
|
134
|
+
<?js if (data.examples && examples.length) { ?>
|
|
135
|
+
<div class="method-member-container flex flex-col w-100 overflow-auto mt-20">
|
|
136
|
+
<strong>Example<?js= examples.length > 1? 's':'' ?></strong>
|
|
137
|
+
<?js= this.partial('examples.tmpl', examples) ?>
|
|
138
|
+
</div>
|
|
139
|
+
<?js } ?>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<div class="mobile-menu-icon-container">
|
|
2
|
+
<button class="icon-button" id="mobile-menu" data-isopen="false">
|
|
3
|
+
<svg><use xlink:href="#menu-icon"></use></svg>
|
|
4
|
+
</button>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<div id="mobile-sidebar" class="mobile-sidebar-container">
|
|
8
|
+
<div class="mobile-sidebar-wrapper">
|
|
9
|
+
<?js= this.partial('sidebar-title.tmpl') ?>
|
|
10
|
+
<div class="mobile-nav-links">
|
|
11
|
+
<?js= this.partial('navbar-menu.tmpl') ?>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="mobile-sidebar-items-c">
|
|
14
|
+
<?js= this.partial('sidebar-items.tmpl') ?>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="mobile-navbar-actions">
|
|
17
|
+
<?js= this.partial('navbar-actions.tmpl') ?>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<?js
|
|
2
|
+
var data = this.navbar
|
|
3
|
+
if(data.search) { ?>
|
|
4
|
+
<div class="navbar-right-item">
|
|
5
|
+
<button class="icon-button search-button">
|
|
6
|
+
<svg><use xlink:href="#search-icon"></use></svg>
|
|
7
|
+
</button>
|
|
8
|
+
</div>
|
|
9
|
+
<?js } ?>
|
|
10
|
+
<div class="navbar-right-item" >
|
|
11
|
+
<button class="icon-button theme-toggle">
|
|
12
|
+
<svg><use class="theme-svg-use" xlink:href="#<?js= (this.theme === 'dark' ? 'light' : 'dark') ?>-theme-icon"></use></svg>
|
|
13
|
+
</button>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="navbar-right-item" >
|
|
16
|
+
<button class="icon-button font-size">
|
|
17
|
+
<svg><use xlink:href="#font-size-icon"></use></svg>
|
|
18
|
+
</button>
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<?js
|
|
2
|
+
var data = this.navbar
|
|
3
|
+
if(data.menu) { ?>
|
|
4
|
+
<?js
|
|
5
|
+
data.menu.forEach(function(item) {
|
|
6
|
+
var className = item.class || '';
|
|
7
|
+
var id = item.id || '';
|
|
8
|
+
var target = item.target || '';
|
|
9
|
+
className += ' navbar-item'
|
|
10
|
+
?>
|
|
11
|
+
|
|
12
|
+
<div class="<?js=className ?>">
|
|
13
|
+
<a id="<?js= id ?>" href="<?js= item.link ?>" target="<?js= target ?>">
|
|
14
|
+
<?js= item.title?>
|
|
15
|
+
</a>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<?js
|
|
19
|
+
})
|
|
20
|
+
}
|
|
21
|
+
?>
|
package/tmpl/navbar.tmpl
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?js
|
|
2
|
+
var data = this.navbar;
|
|
3
|
+
?>
|
|
4
|
+
|
|
5
|
+
<nav class="navbar">
|
|
6
|
+
<div class="navbar-left-items">
|
|
7
|
+
<?js= this.partial('navbar-menu.tmpl') ?>
|
|
8
|
+
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="navbar-right-items">
|
|
12
|
+
<?js= this.partial('navbar-actions.tmpl') ?>
|
|
13
|
+
</div>
|
|
14
|
+
<nav>
|
package/tmpl/params.tmpl
CHANGED
|
@@ -1,124 +1,124 @@
|
|
|
1
|
-
<?js
|
|
2
|
-
var params = obj;
|
|
3
|
-
|
|
4
|
-
/* sort subparams under their parent params (like opts.classname) */
|
|
5
|
-
var parentParam = null;
|
|
6
|
-
params.forEach(function(param, i) {
|
|
7
|
-
var paramRegExp;
|
|
8
|
-
|
|
9
|
-
if (!param) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (parentParam && parentParam.name && param.name) {
|
|
14
|
-
paramRegExp = new RegExp('^(?:' + parentParam.name + '(?:\\[\\])*)\\.(.+)$');
|
|
15
|
-
|
|
16
|
-
if ( paramRegExp.test(param.name) ) {
|
|
17
|
-
param.name = RegExp.$1;
|
|
18
|
-
parentParam.subparams = parentParam.subparams || [];
|
|
19
|
-
parentParam.subparams.push(param);
|
|
20
|
-
params[i] = null;
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
parentParam = param;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
parentParam = param;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
/* determine if we need extra columns, "attributes" and "default" */
|
|
32
|
-
params.hasAttributes = false;
|
|
33
|
-
params.hasDefault = false;
|
|
34
|
-
params.hasName = false;
|
|
35
|
-
|
|
36
|
-
params.forEach(function(param) {
|
|
37
|
-
if (!param) { return; }
|
|
38
|
-
|
|
39
|
-
if (param.optional || param.nullable || param.variable) {
|
|
40
|
-
params.hasAttributes = true;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (param.name) {
|
|
44
|
-
params.hasName = true;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (typeof param.defaultvalue !== 'undefined') {
|
|
48
|
-
params.hasDefault = true;
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
?>
|
|
52
|
-
|
|
53
|
-
<table class="params">
|
|
54
|
-
<thead>
|
|
55
|
-
<tr>
|
|
56
|
-
<?js if (params.hasName) {?>
|
|
57
|
-
<th>Name</th>
|
|
58
|
-
<?js } ?>
|
|
59
|
-
|
|
60
|
-
<th>Type</th>
|
|
61
|
-
|
|
62
|
-
<?js if (params.hasAttributes) {?>
|
|
63
|
-
<th>Attributes</th>
|
|
64
|
-
<?js } ?>
|
|
65
|
-
|
|
66
|
-
<?js if (params.hasDefault) {?>
|
|
67
|
-
<th>Default</th>
|
|
68
|
-
<?js } ?>
|
|
69
|
-
|
|
70
|
-
<th class="last">Description</th>
|
|
71
|
-
</tr>
|
|
72
|
-
</thead>
|
|
73
|
-
|
|
74
|
-
<tbody>
|
|
75
|
-
<?js
|
|
76
|
-
var self = this;
|
|
77
|
-
params.forEach(function(param) {
|
|
78
|
-
if (!param) { return; }
|
|
79
|
-
?>
|
|
80
|
-
|
|
81
|
-
<tr>
|
|
82
|
-
<?js if (params.hasName) {?>
|
|
83
|
-
<td class="name"><code><?js= param.name ?></code></td>
|
|
84
|
-
<?js } ?>
|
|
85
|
-
|
|
86
|
-
<td class="type">
|
|
87
|
-
<?js if (param.type && param.type.names) {?>
|
|
88
|
-
<?js= self.partial('type.tmpl', param.type.names) ?>
|
|
89
|
-
<?js } ?>
|
|
90
|
-
</td>
|
|
91
|
-
|
|
92
|
-
<?js if (params.hasAttributes) {?>
|
|
93
|
-
<td class="attributes">
|
|
94
|
-
<?js if (param.optional) { ?>
|
|
95
|
-
<optional><br>
|
|
96
|
-
<?js } ?>
|
|
97
|
-
|
|
98
|
-
<?js if (param.nullable) { ?>
|
|
99
|
-
<nullable><br>
|
|
100
|
-
<?js } ?>
|
|
101
|
-
|
|
102
|
-
<?js if (param.variable) { ?>
|
|
103
|
-
<repeatable><br>
|
|
104
|
-
<?js } ?>
|
|
105
|
-
</td>
|
|
106
|
-
<?js } ?>
|
|
107
|
-
|
|
108
|
-
<?js if (params.hasDefault) {?>
|
|
109
|
-
<td class="default">
|
|
110
|
-
<?js if (typeof param.defaultvalue !== 'undefined') { ?>
|
|
111
|
-
<?js= self.htmlsafe(param.defaultvalue) ?>
|
|
112
|
-
<?js } ?>
|
|
113
|
-
</td>
|
|
114
|
-
<?js } ?>
|
|
115
|
-
|
|
116
|
-
<td class="description last"><?js= param.description ?><?js if (param.subparams) { ?>
|
|
117
|
-
<h6>Properties</h6>
|
|
118
|
-
<?js= self.partial('params.tmpl', param.subparams) ?>
|
|
119
|
-
<?js } ?></td>
|
|
120
|
-
</tr>
|
|
121
|
-
|
|
122
|
-
<?js }); ?>
|
|
123
|
-
</tbody>
|
|
124
|
-
</table>
|
|
1
|
+
<?js
|
|
2
|
+
var params = obj;
|
|
3
|
+
|
|
4
|
+
/* sort subparams under their parent params (like opts.classname) */
|
|
5
|
+
var parentParam = null;
|
|
6
|
+
params.forEach(function(param, i) {
|
|
7
|
+
var paramRegExp;
|
|
8
|
+
|
|
9
|
+
if (!param) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (parentParam && parentParam.name && param.name) {
|
|
14
|
+
paramRegExp = new RegExp('^(?:' + parentParam.name + '(?:\\[\\])*)\\.(.+)$');
|
|
15
|
+
|
|
16
|
+
if ( paramRegExp.test(param.name) ) {
|
|
17
|
+
param.name = RegExp.$1;
|
|
18
|
+
parentParam.subparams = parentParam.subparams || [];
|
|
19
|
+
parentParam.subparams.push(param);
|
|
20
|
+
params[i] = null;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
parentParam = param;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
parentParam = param;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/* determine if we need extra columns, "attributes" and "default" */
|
|
32
|
+
params.hasAttributes = false;
|
|
33
|
+
params.hasDefault = false;
|
|
34
|
+
params.hasName = false;
|
|
35
|
+
|
|
36
|
+
params.forEach(function(param) {
|
|
37
|
+
if (!param) { return; }
|
|
38
|
+
|
|
39
|
+
if (param.optional || param.nullable || param.variable) {
|
|
40
|
+
params.hasAttributes = true;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (param.name) {
|
|
44
|
+
params.hasName = true;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (typeof param.defaultvalue !== 'undefined') {
|
|
48
|
+
params.hasDefault = true;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
?>
|
|
52
|
+
|
|
53
|
+
<table class="params">
|
|
54
|
+
<thead>
|
|
55
|
+
<tr>
|
|
56
|
+
<?js if (params.hasName) {?>
|
|
57
|
+
<th>Name</th>
|
|
58
|
+
<?js } ?>
|
|
59
|
+
|
|
60
|
+
<th>Type</th>
|
|
61
|
+
|
|
62
|
+
<?js if (params.hasAttributes) {?>
|
|
63
|
+
<th>Attributes</th>
|
|
64
|
+
<?js } ?>
|
|
65
|
+
|
|
66
|
+
<?js if (params.hasDefault) {?>
|
|
67
|
+
<th>Default</th>
|
|
68
|
+
<?js } ?>
|
|
69
|
+
|
|
70
|
+
<th class="last">Description</th>
|
|
71
|
+
</tr>
|
|
72
|
+
</thead>
|
|
73
|
+
|
|
74
|
+
<tbody>
|
|
75
|
+
<?js
|
|
76
|
+
var self = this;
|
|
77
|
+
params.forEach(function(param) {
|
|
78
|
+
if (!param) { return; }
|
|
79
|
+
?>
|
|
80
|
+
|
|
81
|
+
<tr>
|
|
82
|
+
<?js if (params.hasName) {?>
|
|
83
|
+
<td class="name"><code><?js= param.name ?></code></td>
|
|
84
|
+
<?js } ?>
|
|
85
|
+
|
|
86
|
+
<td class="type">
|
|
87
|
+
<?js if (param.type && param.type.names) {?>
|
|
88
|
+
<?js= self.partial('type.tmpl', param.type.names) ?>
|
|
89
|
+
<?js } ?>
|
|
90
|
+
</td>
|
|
91
|
+
|
|
92
|
+
<?js if (params.hasAttributes) {?>
|
|
93
|
+
<td class="attributes">
|
|
94
|
+
<?js if (param.optional) { ?>
|
|
95
|
+
<optional><br>
|
|
96
|
+
<?js } ?>
|
|
97
|
+
|
|
98
|
+
<?js if (param.nullable) { ?>
|
|
99
|
+
<nullable><br>
|
|
100
|
+
<?js } ?>
|
|
101
|
+
|
|
102
|
+
<?js if (param.variable) { ?>
|
|
103
|
+
<repeatable><br>
|
|
104
|
+
<?js } ?>
|
|
105
|
+
</td>
|
|
106
|
+
<?js } ?>
|
|
107
|
+
|
|
108
|
+
<?js if (params.hasDefault) {?>
|
|
109
|
+
<td class="default">
|
|
110
|
+
<?js if (typeof param.defaultvalue !== 'undefined') { ?>
|
|
111
|
+
<?js= self.htmlsafe(param.defaultvalue) ?>
|
|
112
|
+
<?js } ?>
|
|
113
|
+
</td>
|
|
114
|
+
<?js } ?>
|
|
115
|
+
|
|
116
|
+
<td class="description last"><?js= param.description ?><?js if (param.subparams) { ?>
|
|
117
|
+
<h6>Properties</h6>
|
|
118
|
+
<?js= self.partial('params.tmpl', param.subparams) ?>
|
|
119
|
+
<?js } ?></td>
|
|
120
|
+
</tr>
|
|
121
|
+
|
|
122
|
+
<?js }); ?>
|
|
123
|
+
</tbody>
|
|
124
|
+
</table>
|