clean-jsdoc-theme 3.3.4 → 4.0.3
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 → codeql.yml} +72 -67
- package/.github/workflows/greetings.yml +16 -0
- 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 +441 -546
- package/SECURITY.md +21 -21
- package/helpers/down-arrow.js +9 -9
- package/jsdoc-config.json +62 -60
- package/minify.js +52 -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-original.js +5162 -0
- package/static/scripts/third-party/hljs.js +1 -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 +959 -393
- package/static/styles/clean-jsdoc-theme-dark.css +407 -324
- package/static/styles/clean-jsdoc-theme-light.css +388 -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 +25 -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/README.md
CHANGED
|
@@ -1,546 +1,441 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
1.
|
|
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
|
-
## Options
|
|
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
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
###
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
```json
|
|
191
|
-
"
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
"
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
###
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
```json
|
|
237
|
-
"
|
|
238
|
-
"
|
|
239
|
-
}
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
"
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
"
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
"
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
###
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
To
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
"name": "description",
|
|
443
|
-
"content": "Best Clean and minimal JSDoc 3 Template/Theme"
|
|
444
|
-
}
|
|
445
|
-
],
|
|
446
|
-
"search": {},
|
|
447
|
-
"create_style": "nav{background: yellow}",
|
|
448
|
-
"add_style_path": [
|
|
449
|
-
{
|
|
450
|
-
"href": "https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css",
|
|
451
|
-
"integrity": "sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1",
|
|
452
|
-
"crossorigin": "anonymous"
|
|
453
|
-
}
|
|
454
|
-
],
|
|
455
|
-
"add_scripts": "function foo(){console.log('foo')}",
|
|
456
|
-
"add_script_path": [
|
|
457
|
-
{
|
|
458
|
-
"src": "https://code.jquery.com/jquery-3.5.1.js",
|
|
459
|
-
"integrity": "sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc=",
|
|
460
|
-
"crossorigin": "anonymous"
|
|
461
|
-
}
|
|
462
|
-
],
|
|
463
|
-
|
|
464
|
-
"footer": "This is footer",
|
|
465
|
-
"static_dir": ["./static"],
|
|
466
|
-
"include_css": ["./static/index.css", "./src/docs/index.css"],
|
|
467
|
-
"include_js": ["./static/main.js", "./third-party/test/index.js"],
|
|
468
|
-
|
|
469
|
-
"exclude_inherited": true,
|
|
470
|
-
|
|
471
|
-
"overlay_scrollbar": {
|
|
472
|
-
"options": {
|
|
473
|
-
}
|
|
474
|
-
},
|
|
475
|
-
"resizeable": {
|
|
476
|
-
"navbar": {
|
|
477
|
-
"min": "300",
|
|
478
|
-
"max": "600"
|
|
479
|
-
}
|
|
480
|
-
},
|
|
481
|
-
"codepen": {
|
|
482
|
-
"enable_for": ["examples"],
|
|
483
|
-
"options": {
|
|
484
|
-
"js_external": "https://code.jquery.com/jquery-3.6.0.min.js",
|
|
485
|
-
"js_pre_processor": "babel"
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
```
|
|
491
|
-
|
|
492
|
-
### Cheat sheet
|
|
493
|
-
|
|
494
|
-
| name | default | use case | expected value(s) |
|
|
495
|
-
| ------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ------------------------- |
|
|
496
|
-
| `theme` | `"light"` | To set the theme variant | `"light" or "dark"` |
|
|
497
|
-
| `title` | `null` | To set the title | `HTML` or `string` |
|
|
498
|
-
| `menu` | `null` | To render extra link in navbar | Array of Object(s) |
|
|
499
|
-
| `meta` | `null` | Meta tag attributes | Array of Object(s) |
|
|
500
|
-
| `search` | `{}` | To render search or not | Fuse.js options |
|
|
501
|
-
| `resizeable` | `{}` | To make certain element resizeable | `Object` |
|
|
502
|
-
| `codepen` | `{}` | To open code in codepen | `Object` |
|
|
503
|
-
| `create_style` | `null` | To create custom style rules | `string` |
|
|
504
|
-
| `add_style_path` | `null` | To add external css libraries/files | Array of Object(s) |
|
|
505
|
-
| `add_scripts` | `null` | To create custom script | `string` |
|
|
506
|
-
| `add_script_path` | `null` | To add external js libraries/files | Array of Object(s) |
|
|
507
|
-
| `footer` | `null` | To render footer | `HTML` or `string` |
|
|
508
|
-
| `static_dir` | `null` | To include static dir | Array of string |
|
|
509
|
-
| `include_css` | `null` | To include css files | Array of string |
|
|
510
|
-
| `include_js` | `null` | To include js files | `string` |
|
|
511
|
-
| `exclude_inherited` | `false` | To exclude inherited symbols | `boolean` |
|
|
512
|
-
| `overlay_scrollbar` | `null` | To use overlay scrollbar | Overlay Scrollbar options |
|
|
513
|
-
| `sections` | `["Menu", "Modules", "Classes", "Externals", "Events", "Namespaces", "Mixins", "Tutorials", "Interfaces", "Global"]` | To order navbar/sidebar sections or to hide/remove navbar/sidebar sections | `Array<SECTION_TYPE>` |
|
|
514
|
-
|
|
515
|
-
## Changelog
|
|
516
|
-
|
|
517
|
-
Changelog is moved to [https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/master/CHANGELOG.md](https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/master/CHANGELOG.md)
|
|
518
|
-
|
|
519
|
-
## Developing
|
|
520
|
-
|
|
521
|
-
Before starting please go through our [contributing guide](https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/master/CONTRIBUTING.md).
|
|
522
|
-
|
|
523
|
-
```bash
|
|
524
|
-
git clone https://github.com/ankitskvmdam/clean-jsdoc-theme.git
|
|
525
|
-
cd clean-jsdoc-theme
|
|
526
|
-
npm install
|
|
527
|
-
npm install jsdoc --no-save
|
|
528
|
-
npm run test
|
|
529
|
-
```
|
|
530
|
-
|
|
531
|
-
`npm run test` will generate files in output folder.
|
|
532
|
-
|
|
533
|
-
## Contributors
|
|
534
|
-
|
|
535
|
-
<a href="https://github.com/ankitskvmdam/clean-jsdoc-theme/graphs/contributors">
|
|
536
|
-
<img src="https://contrib.rocks/image?repo=ankitskvmdam/clean-jsdoc-theme" />
|
|
537
|
-
</a>
|
|
538
|
-
|
|
539
|
-
## Contact
|
|
540
|
-
|
|
541
|
-
If you like my work, then give me a <a href="https://github.com/ankitskvmdam/clean-jsdoc-theme" data-icon="octicon-star" aria-label="Star ankitskvmdam/clean-jsdoc-theme on GitHub">star</a>. This will act as a driving force to add new feature more frequently. <br>
|
|
542
|
-
Mail me at: <a href="mailto:hello@ankdev.me">hello@ankdev.me</a> <br>
|
|
543
|
-
|
|
544
|
-
## License
|
|
545
|
-
|
|
546
|
-
Licensed under the MIT license.
|
|
1
|
+
# clean-jsdoc-theme
|
|
2
|
+
|
|
3
|
+
[](https://github.com/ankitskvmdam/clean-jsdoc-theme) [](https://github.com/ankitskvmdam/clean-jsdoc-theme/fork)  [](https://github.com/ankitskvmdam/clean-jsdoc-theme/issues) [](https://github.com/ankitskvmdam/clean-jsdoc-theme/graphs/contributors) [](https://travis-ci.org/ankitskvmdam/clean-jsdoc-theme) [](https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/master/LICENSE)
|
|
4
|
+
<br>
|
|
5
|
+
|
|
6
|
+
clean-jsdoc-theme is a beautifully crafted theme for JSDoc 3. It is a clean and fully responsive theme with loads of customisation features.
|
|
7
|
+
|
|
8
|
+
Some salient features:
|
|
9
|
+
|
|
10
|
+
1. It supports most screens, i.e., desktops, laptops, iPad and mobile devices.
|
|
11
|
+
1. It has a premium-looking dark and light theme.
|
|
12
|
+
1. It minifies all the output HTML files (this helps in saving a few KBs).
|
|
13
|
+
1. It has search support. The search feature doesn't increase the size of output HTML files.
|
|
14
|
+
1. It updates regularly.
|
|
15
|
+
1. It is highly performant. Check lighthouse report [here](https://googlechrome.github.io/lighthouse/viewer/?psiurl=https%3A%2F%2Fankdev.me%2Fclean-jsdoc-theme%2Fv4%2Findex.html&strategy=desktop&category=performance&category=accessibility&category=best-practices&category=seo&category=pwa&utm_source=lh-chrome-ext).
|
|
16
|
+
|
|
17
|
+
We know that no library is perfect. That's why we are open to hearing from the community about the theme. For any suggestions, questions or bugs, feel free to create an <a href="https://github.com/ankitskvmdam/clean-jsdoc-theme/issues">issue</a>.
|
|
18
|
+
|
|
19
|
+
## Demo
|
|
20
|
+
|
|
21
|
+
1. To view this theme, visit [https://ankdev.me/clean-jsdoc-theme/v4](https://ankdev.me/clean-jsdoc-theme/v4).
|
|
22
|
+
|
|
23
|
+
1. If you want to see a demo repo to set up this theme, visit [https://github.com/ankitskvmdam/clean-jsdoc-theme-example](https://github.com/ankitskvmdam/clean-jsdoc-theme-example). This repo will guide you step by step on how to setup jsdoc and clean-jsdoc-theme in your existing repo.
|
|
24
|
+
|
|
25
|
+
## Screenshots
|
|
26
|
+
|
|
27
|
+

|
|
28
|
+

|
|
29
|
+

|
|
30
|
+

|
|
31
|
+

|
|
32
|
+

|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
> Note you must have `node` and `npm` installed on your machine.
|
|
37
|
+
|
|
38
|
+
On your command line type
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm install clean-jsdoc-theme --save-dev
|
|
42
|
+
# or
|
|
43
|
+
yarn add clean-jsdoc-theme -D
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
In your projects `package.json` file add a generate script. You need to run this script when you want to generate documentation.
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
"script": {
|
|
50
|
+
"generate-docs": "jsdoc --configure jsdoc.json --verbose"
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
In your `jsdoc.json` file, add a template option.
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
"opts": {
|
|
58
|
+
"template": "node_modules/clean-jsdoc-theme"
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
> Heads Up! In the `generate_docs` script, there is a configure option. The value of that option is `jsdoc.json`. Make sure the `jsdoc.json` file exists. `jsdoc.json` contains configurations for JSDoc. If you have your JSDoc config in a different file, replace `jsdoc.json` with the name of the file in which you have your JSDoc config.
|
|
63
|
+
|
|
64
|
+
Now to generate docs run
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm run generate-docs
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
For more information look at [https://github.com/ankitskvmdam/clean-jsdoc-theme-example](https://github.com/ankitskvmdam/clean-jsdoc-theme-example)
|
|
71
|
+
|
|
72
|
+
## Example JSDoc Config
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"source": {
|
|
77
|
+
"include": ["lib", "package.json", "README.md"],
|
|
78
|
+
"includePattern": ".js$",
|
|
79
|
+
"excludePattern": "(node_modules/|docs)"
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
"plugins": ["plugins/markdown"],
|
|
83
|
+
|
|
84
|
+
"opts": {
|
|
85
|
+
"encoding": "utf8",
|
|
86
|
+
"readme": "./README.md",
|
|
87
|
+
"destination": "docs/",
|
|
88
|
+
"recurse": true,
|
|
89
|
+
"verbose": true,
|
|
90
|
+
"template": "./node_modules/clean-jsdoc-theme",
|
|
91
|
+
"theme_opts": {
|
|
92
|
+
"default_theme": "dark"
|
|
93
|
+
},
|
|
94
|
+
"markdown": {
|
|
95
|
+
"hardwrap": false,
|
|
96
|
+
"idInHeadings": true // This is important for clean-jsdoc-theme, otherwise some features might not work.
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Options
|
|
103
|
+
|
|
104
|
+
### Set a default theme
|
|
105
|
+
|
|
106
|
+
To set the default theme add the following in your jsodc config file:
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
"theme_opts": {
|
|
110
|
+
"default_theme": "dark" // or "light"
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Set base url
|
|
115
|
+
|
|
116
|
+
If you want to set the base url:
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
"theme_opts": {
|
|
120
|
+
"base_url": "https://ankdev.me/v4/"
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
> Make sure to add the ending forward slash (`/`).
|
|
125
|
+
|
|
126
|
+
If you are using search feature then make sure to add `base_url`, otherwise your search query might fail.
|
|
127
|
+
|
|
128
|
+
### Add favicon
|
|
129
|
+
|
|
130
|
+
To set favicon add the following in your jsodc config files.
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
"theme_opts": {
|
|
134
|
+
"favion": "path/to/img"
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
You can use [`static_dir`](#add-static-dir) option to copy all you static files to output dir and use that path in place of `path/to/img`.
|
|
140
|
+
|
|
141
|
+
### Add title
|
|
142
|
+
|
|
143
|
+
Both strings and HTML are accepted; use HTML to overwrite the default HTML, and a string to set a plaintext title. One example of this is below:
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
"theme_opts": {
|
|
147
|
+
"title": "<img src='path/to/img' class='my-custom-class'/>" // or "title": "clean-jsodc-theme"
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
You can use [`static_dir`](#add-static-dir) option to copy all you static files to output dir and use that path in place of `path/to/img`.
|
|
152
|
+
|
|
153
|
+
### Add navbar menu
|
|
154
|
+
|
|
155
|
+
To render extra link(s) in navbar. It accepts an array of objects:
|
|
156
|
+
|
|
157
|
+
```json
|
|
158
|
+
"theme_opts": {
|
|
159
|
+
"menu" : [
|
|
160
|
+
{
|
|
161
|
+
"title": "Website",
|
|
162
|
+
"link": "https://ankdev.me/clean-jsdoc-theme/dark/",
|
|
163
|
+
"target": "_blank",
|
|
164
|
+
"class": "some-class",
|
|
165
|
+
"id": "some-id"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
// more if you want to.
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
`menu` is an array of object. Each object has five properties, out of which two are required (`title` and `link`). If any object doesn't have the required properties then you might expect an error.
|
|
175
|
+
|
|
176
|
+
<b>Properties</b>
|
|
177
|
+
|
|
178
|
+
| name | type | required |
|
|
179
|
+
| -------- | -------- | -------- |
|
|
180
|
+
| `title` | `string` | required |
|
|
181
|
+
| `link` | `string` | required |
|
|
182
|
+
| `target` | `string` | optional |
|
|
183
|
+
| `class` | `string` | optional |
|
|
184
|
+
| `id` | `string` | optional |
|
|
185
|
+
|
|
186
|
+
### Sections
|
|
187
|
+
|
|
188
|
+
There is an option to order the occurrence of sections in the sidebar. You can use this option to hide/remove any section.
|
|
189
|
+
|
|
190
|
+
```json
|
|
191
|
+
"theme_opts": {
|
|
192
|
+
"sections": ["Classes", "Modules", "Global"] // Only three members will be in the sidebar.
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
```js
|
|
197
|
+
// SECTION_TYPE
|
|
198
|
+
[
|
|
199
|
+
'Classes',
|
|
200
|
+
'Modules',
|
|
201
|
+
'Externals',
|
|
202
|
+
'Events',
|
|
203
|
+
'Namespaces',
|
|
204
|
+
'Mixins',
|
|
205
|
+
'Tutorials',
|
|
206
|
+
'Interfaces',
|
|
207
|
+
'Global',
|
|
208
|
+
];
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Meta
|
|
212
|
+
|
|
213
|
+
There is also an option to add meta tag to every generated HTML file. You can use `meta` option to include a list of `meta` tags into `head`.
|
|
214
|
+
|
|
215
|
+
```json
|
|
216
|
+
"theme_opts": {
|
|
217
|
+
"meta" : [
|
|
218
|
+
{
|
|
219
|
+
"name": "author",
|
|
220
|
+
"content": "Ankit Kumar"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"name": "description",
|
|
224
|
+
"content": "Best Clean and minimal JSDoc 3 Template/Theme"
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
`meta` is an array of object. Each objects can have any valid combination of [HTML metadata attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#Attributes).
|
|
231
|
+
|
|
232
|
+
### Search
|
|
233
|
+
|
|
234
|
+
By default, the search feature is available in the theme. If you don't want the search feature, you can do the following:
|
|
235
|
+
|
|
236
|
+
```json
|
|
237
|
+
"theme_opts": {
|
|
238
|
+
"search": false
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
> Make sure you have added the `base_url` option as well, otherwise your search query might fail.
|
|
243
|
+
|
|
244
|
+
How does the search work?
|
|
245
|
+
If the search feature is enabled, you'll see a `data` folder in the output. This `data` folder contains a JSON called `search.json`. There is a fetch request when user types anything in the search box. That means search data is only loaded if user wants to search anything.
|
|
246
|
+
|
|
247
|
+
### CodePen
|
|
248
|
+
|
|
249
|
+
> Note: Currently this feature is only enabled for the examples section.
|
|
250
|
+
|
|
251
|
+
```json
|
|
252
|
+
"theme_opts": {
|
|
253
|
+
"codepen": {
|
|
254
|
+
"enable_for": ["examples"],
|
|
255
|
+
"options": {
|
|
256
|
+
"js_external": "https://code.jquery.com/jquery-3.6.0.min.js",
|
|
257
|
+
"js_pre_processor": "babel"
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
`options` can be any valid CodePen options. For more visit: [Codepen Prefill options](https://blog.codepen.io/documentation/prefill/#all-the-json-options-0)
|
|
264
|
+
|
|
265
|
+
### Add static dir
|
|
266
|
+
|
|
267
|
+
To include static files:
|
|
268
|
+
|
|
269
|
+
```json
|
|
270
|
+
"theme_opts": {
|
|
271
|
+
"static_dir": ["./static"],
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Add styles
|
|
276
|
+
|
|
277
|
+
To create custom style rules. Example:
|
|
278
|
+
|
|
279
|
+
```json
|
|
280
|
+
"theme_opts" {
|
|
281
|
+
"create_style": ".sidebar-title { font-size: 2rem }"
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Add style paths
|
|
286
|
+
|
|
287
|
+
Use this option to add third party css library. If you want to add your own custom css file then consider using [Add custom css files](#add-custom-css-files)
|
|
288
|
+
|
|
289
|
+
> Note: You have to pass an array of object, and object keys are actually the attributes which you want in you link tag.
|
|
290
|
+
|
|
291
|
+
Example:
|
|
292
|
+
|
|
293
|
+
```json
|
|
294
|
+
"add_style_path": [
|
|
295
|
+
{
|
|
296
|
+
"href": "https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css",
|
|
297
|
+
"integrity": "sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1",
|
|
298
|
+
"crossorigin": "anonymous"
|
|
299
|
+
}
|
|
300
|
+
],
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Add custom css files
|
|
304
|
+
|
|
305
|
+
To include css files. Example:
|
|
306
|
+
|
|
307
|
+
```json
|
|
308
|
+
"theme_opts" {
|
|
309
|
+
"include_css": ["./static/index.css", "./src/docs/index.css"]
|
|
310
|
+
}
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
> Note: You are not required to manually copy file to output dir
|
|
314
|
+
|
|
315
|
+
It will include the css files to the output dir and also attach a link tag to the html pointing to the included css file.
|
|
316
|
+
|
|
317
|
+
### Add scripts
|
|
318
|
+
|
|
319
|
+
To create custom scripts. Example:
|
|
320
|
+
|
|
321
|
+
```json
|
|
322
|
+
"theme_opts": {
|
|
323
|
+
"add_scripts": "function foo(){console.log('foo')} function bar() {console.log('bar')}"
|
|
324
|
+
}
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### Add script paths
|
|
328
|
+
|
|
329
|
+
Use this option to add third party js library. If you want to add your own custom script file then consider using [Add custom script files](#add-custom-script-files)
|
|
330
|
+
|
|
331
|
+
> Note: You have to pass an array of object, and object keys are actually the attributes which you want in you script tag.
|
|
332
|
+
|
|
333
|
+
Example:
|
|
334
|
+
|
|
335
|
+
```json
|
|
336
|
+
"add_script_path": [
|
|
337
|
+
{
|
|
338
|
+
"href": "https://code.jquery.com/jquery-3.5.1.js",
|
|
339
|
+
"integrity": "sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc=",
|
|
340
|
+
"crossorigin": "anonymous"
|
|
341
|
+
}
|
|
342
|
+
],
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
This will copy the static folder to the output dir.
|
|
346
|
+
|
|
347
|
+
> Note: If the directory doesn't exists then you may get an error. Also directory is relative to your jsdoc config file.
|
|
348
|
+
|
|
349
|
+
This will not flatten the directory it keep the directory structure as it is.
|
|
350
|
+
|
|
351
|
+
### Add custom script files
|
|
352
|
+
|
|
353
|
+
To include js files. Example:
|
|
354
|
+
|
|
355
|
+
```json
|
|
356
|
+
"theme_opts": {
|
|
357
|
+
"include_js": ["./static/index.js", "./src/docs/index.js"]
|
|
358
|
+
}
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
> Note: You are not required to manually copy file to output dir
|
|
362
|
+
|
|
363
|
+
It will include the js files to the output dir and also attach a script tag to the html pointing to the included js file.
|
|
364
|
+
|
|
365
|
+
### Footer
|
|
366
|
+
|
|
367
|
+
```json
|
|
368
|
+
"theme_opts": {
|
|
369
|
+
|
|
370
|
+
"footer": "This is footer" // or <div class="footer-wrapper">This is a footer </div>
|
|
371
|
+
}
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### To exclude inherited
|
|
375
|
+
|
|
376
|
+
To exclude inherited symbols. Example:
|
|
377
|
+
|
|
378
|
+
```json
|
|
379
|
+
"exclude_inherited": true
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
This will remove all symbols (members, methods ...) that come from inherited parents.
|
|
383
|
+
|
|
384
|
+
## Cheat sheet
|
|
385
|
+
|
|
386
|
+
| name | default | use case | expected value(s) |
|
|
387
|
+
| ------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- | --------------------- |
|
|
388
|
+
| `default_theme` | `"dark"` | To set the default theme | `"light" or "dark"` |
|
|
389
|
+
| `title` | `null` | To set the title | `HTML` or `string` |
|
|
390
|
+
| `menu` | `null` | To render extra link in navbar | Array of Object(s) |
|
|
391
|
+
| `meta` | `null` | Meta tag attributes | Array of Object(s) |
|
|
392
|
+
| `search` | `true` | To render search or not | `true` or `false` |
|
|
393
|
+
| `codepen` | `{}` | To open code in codepen | `Object` |
|
|
394
|
+
| `static_dir` | `null` | To include static dir | Array of string |
|
|
395
|
+
| `create_style` | `null` | To create custom style rules | `string` |
|
|
396
|
+
| `add_style_path` | `null` | To add external css libraries/files | Array of Object(s) |
|
|
397
|
+
| `include_css` | `null` | To include css files | Array of string |
|
|
398
|
+
| `add_scripts` | `null` | To create custom script | `string` |
|
|
399
|
+
| `add_script_path` | `null` | To add external js libraries/files | Array of Object(s) |
|
|
400
|
+
| `include_js` | `null` | To include js files | `string` |
|
|
401
|
+
| `footer` | `null` | To render footer | `HTML` or `string` |
|
|
402
|
+
| `exclude_inherited` | `false` | To exclude inherited symbols | `boolean` |
|
|
403
|
+
| `sections` | `["Modules", "Classes", "Externals", "Events", "Namespaces", "Mixins", "Tutorials", "Interfaces", "Global"]` | To order navbar/sidebar sections or to hide/remove navbar/sidebar sections | `Array<SECTION_TYPE>` |
|
|
404
|
+
|
|
405
|
+
## Changelog
|
|
406
|
+
|
|
407
|
+
Changelog is moved to [https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/master/CHANGELOG.md](https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/master/CHANGELOG.md)
|
|
408
|
+
|
|
409
|
+
## Developing
|
|
410
|
+
|
|
411
|
+
Before starting please go through our [contributing guide](https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/master/CONTRIBUTING.md).
|
|
412
|
+
|
|
413
|
+
```bash
|
|
414
|
+
git clone https://github.com/ankitskvmdam/clean-jsdoc-theme.git
|
|
415
|
+
cd clean-jsdoc-theme
|
|
416
|
+
npm install
|
|
417
|
+
npm install jsdoc --no-save
|
|
418
|
+
npm run build
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
`npm run build` will generate files in output folder.
|
|
422
|
+
|
|
423
|
+
## Contributors
|
|
424
|
+
|
|
425
|
+
<a href="https://github.com/ankitskvmdam/clean-jsdoc-theme/graphs/contributors">
|
|
426
|
+
<img src="https://contrib.rocks/image?repo=ankitskvmdam/clean-jsdoc-theme" alt="clean-jsdoc-contributors" />
|
|
427
|
+
</a>
|
|
428
|
+
|
|
429
|
+
## Thanks
|
|
430
|
+
|
|
431
|
+
Thanks to [fuse.js](https://fusejs.io/), [hljs](https://highlightjs.org/),[tippy.js](https://tippyjs.bootcss.com/), and all awesome contributors.
|
|
432
|
+
|
|
433
|
+
## Contact
|
|
434
|
+
|
|
435
|
+
If you like my work, then give me a <a href="https://github.com/ankitskvmdam/clean-jsdoc-theme" data-icon="octicon-star" aria-label="Star ankitskvmdam/clean-jsdoc-theme on GitHub">star</a>.
|
|
436
|
+
|
|
437
|
+
Mail me at: <a href="mailto:hello@ankdev.me">hello@ankdev.me</a> <br>
|
|
438
|
+
|
|
439
|
+
## License
|
|
440
|
+
|
|
441
|
+
Licensed under the MIT license.
|