clean-jsdoc-theme 3.3.2 → 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/CHANGELOG.md +16 -0
- package/LICENSE +1 -1
- package/README.md +203 -310
- package/jsdoc-config.json +7 -5
- package/minify.js +48 -0
- package/package.json +10 -6
- package/publish.js +805 -870
- 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 +59 -54
- package/static/scripts/search.js +217 -56
- package/static/scripts/search.min.js +11 -0
- 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 +738 -190
- package/static/styles/clean-jsdoc-theme-dark.css +208 -121
- package/static/styles/clean-jsdoc-theme-light.css +241 -168
- package/static/styles/clean-jsdoc-theme.min.css +1 -0
- package/tmpl/container.tmpl +13 -12
- package/tmpl/details.tmpl +16 -16
- package/tmpl/examples.tmpl +3 -1
- package/tmpl/icons.tmpl +43 -5
- package/tmpl/layout.tmpl +60 -79
- package/tmpl/members.tmpl +1 -2
- package/tmpl/method.tmpl +3 -4
- 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/returns.tmpl +1 -1
- 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 +7 -2
- package/tmpl/toc.tmpl +4 -0
- 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,59 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
<h1 align="center">clean-jsdoc-theme</h1>
|
|
3
|
-
<p align=center><i align="center">A beautiful, responsive, customizable theme for JSDoc</i></p>
|
|
4
|
-
<hr>
|
|
1
|
+
# clean-jsdoc-theme
|
|
5
2
|
|
|
6
|
-
[](https://github.com/ankitskvmdam/clean-jsdoc-theme) [](https://github.com/ankitskvmdam/clean-jsdoc-theme/fork) ](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)
|
|
7
4
|
<br>
|
|
8
5
|
|
|
9
|
-
|
|
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.
|
|
10
7
|
|
|
11
|
-
|
|
8
|
+
Some salient features:
|
|
12
9
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
1.
|
|
16
|
-
1.
|
|
17
|
-
|
|
18
|
-
## Examples
|
|
19
|
-
|
|
20
|
-
1. [https://github.com/ankitskvmdam/clean-jsdoc-theme-example](https://github.com/ankitskvmdam/clean-jsdoc-theme-example) - This repo will give an overview of how to setup clean-jsdoc-theme.
|
|
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.
|
|
21
14
|
|
|
22
|
-
|
|
15
|
+
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>.
|
|
23
16
|
|
|
24
|
-
|
|
25
|
-

|
|
26
|
-

|
|
27
|
-

|
|
28
|
-

|
|
29
|
-

|
|
17
|
+
## Demo
|
|
30
18
|
|
|
31
|
-
|
|
19
|
+
1. To view this theme, visit [ankdev.me/clean-jsdoc-theme/v4](https://ankdev.me/clean-jsdoc-theme/v4).
|
|
32
20
|
|
|
33
|
-
1. [
|
|
34
|
-
1. [Overlay Scrollbars](https://kingsora.github.io/OverlayScrollbars/#!overview) - A javascript scrollbar plugin which hides native scrollbars, provides
|
|
35
|
-
custom styleable overlay scrollbars and keeps the native functionality and feeling of native scrollbars.
|
|
21
|
+
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.
|
|
36
22
|
|
|
37
|
-
##
|
|
23
|
+
## Screenshots
|
|
38
24
|
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+

|
|
26
|
+

|
|
27
|
+

|
|
28
|
+

|
|
29
|
+

|
|
30
|
+

|
|
41
31
|
|
|
42
32
|
## Installation
|
|
43
33
|
|
|
44
|
-
> Note you must have `npm` installed on your machine.
|
|
34
|
+
> Note you must have `node` and `npm` installed on your machine.
|
|
45
35
|
|
|
46
36
|
On your command line type
|
|
47
37
|
|
|
48
38
|
```bash
|
|
49
|
-
npm install clean-jsdoc-theme
|
|
39
|
+
npm install clean-jsdoc-theme --save-dev
|
|
40
|
+
# or
|
|
41
|
+
yarn add clean-jsdoc-theme -D
|
|
50
42
|
```
|
|
51
43
|
|
|
52
|
-
In your projects `package.json` file add a generate script
|
|
44
|
+
In your projects `package.json` file add a generate script. You need to run this script when you want to generate documentation.
|
|
53
45
|
|
|
54
46
|
```json
|
|
55
47
|
"script": {
|
|
56
|
-
"generate-docs": "
|
|
48
|
+
"generate-docs": "jsdoc --configure jsdoc.json --verbose"
|
|
57
49
|
}
|
|
58
50
|
```
|
|
59
51
|
|
|
@@ -65,6 +57,8 @@ In your `jsdoc.json` file, add a template option.
|
|
|
65
57
|
}
|
|
66
58
|
```
|
|
67
59
|
|
|
60
|
+
> 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.
|
|
61
|
+
|
|
68
62
|
Now to generate docs run
|
|
69
63
|
|
|
70
64
|
```bash
|
|
@@ -93,7 +87,11 @@ For more information look at [https://github.com/ankitskvmdam/clean-jsdoc-theme-
|
|
|
93
87
|
"verbose": true,
|
|
94
88
|
"template": "./node_modules/clean-jsdoc-theme",
|
|
95
89
|
"theme_opts": {
|
|
96
|
-
"
|
|
90
|
+
"default_theme": "dark"
|
|
91
|
+
},
|
|
92
|
+
"markdown": {
|
|
93
|
+
"hardwrap": false,
|
|
94
|
+
"idInHeadings": true // This is important for clean-jsdoc-theme, otherwise some features might not work.
|
|
97
95
|
}
|
|
98
96
|
}
|
|
99
97
|
}
|
|
@@ -101,67 +99,97 @@ For more information look at [https://github.com/ankitskvmdam/clean-jsdoc-theme-
|
|
|
101
99
|
|
|
102
100
|
## Options
|
|
103
101
|
|
|
104
|
-
|
|
102
|
+
### Set a default theme
|
|
105
103
|
|
|
106
|
-
|
|
104
|
+
To set the default theme add the following in your jsodc config file:
|
|
107
105
|
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
```json
|
|
107
|
+
"theme_opts": {
|
|
108
|
+
"default_theme": "dark" // or "light"
|
|
109
|
+
}
|
|
110
|
+
```
|
|
110
111
|
|
|
111
|
-
###
|
|
112
|
+
### Set base url
|
|
112
113
|
|
|
113
|
-
|
|
114
|
+
If you want to set the base url:
|
|
114
115
|
|
|
115
116
|
```json
|
|
117
|
+
"theme_opts": {
|
|
118
|
+
"base_url": "https://ankdev.me/v4/"
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
> Make sure to add the ending forward slash (`/`).
|
|
123
|
+
|
|
124
|
+
If you are using search feature then make sure to add `base_url`, otherwise your search query might fail.
|
|
125
|
+
|
|
126
|
+
### Add favicon
|
|
127
|
+
|
|
128
|
+
To set favicon add the following in your jsodc config files.
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
"theme_opts": {
|
|
116
132
|
"favion": "path/to/img"
|
|
133
|
+
}
|
|
134
|
+
|
|
117
135
|
```
|
|
118
136
|
|
|
119
|
-
You can use `static_dir` to copy all you static files to output dir and use that path in place of `path/to/img`.
|
|
137
|
+
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`.
|
|
120
138
|
|
|
121
|
-
###
|
|
139
|
+
### Add title
|
|
122
140
|
|
|
123
|
-
|
|
141
|
+
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:
|
|
124
142
|
|
|
125
143
|
```json
|
|
126
|
-
|
|
144
|
+
"theme_opts": {
|
|
145
|
+
"title": "<img src='path/to/img' class='my-custom-class'/>" // or "title": "clean-jsodc-theme"
|
|
146
|
+
}
|
|
127
147
|
```
|
|
128
148
|
|
|
129
|
-
You can use `static_dir` to copy all you static files to output dir and use that path in place of `path/to/img`.
|
|
149
|
+
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`.
|
|
130
150
|
|
|
131
|
-
###
|
|
151
|
+
### Add navbar menu
|
|
132
152
|
|
|
133
|
-
|
|
153
|
+
To render extra link(s) in navbar. It accepts an array of objects:
|
|
134
154
|
|
|
135
155
|
```json
|
|
136
|
-
"
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
156
|
+
"theme_opts": {
|
|
157
|
+
"menu" : [
|
|
158
|
+
{
|
|
159
|
+
"title": "Website",
|
|
160
|
+
"link": "https://ankdev.me/clean-jsdoc-theme/dark/",
|
|
161
|
+
"target": "_blank",
|
|
162
|
+
"class": "some-class",
|
|
163
|
+
"id": "some-id"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
// more if you want to.
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
}
|
|
145
170
|
```
|
|
146
171
|
|
|
147
|
-
|
|
172
|
+
`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.
|
|
148
173
|
|
|
149
|
-
|
|
150
|
-
| ------- | -------- |
|
|
151
|
-
| `title` | `string` |
|
|
152
|
-
| `link` | `string` |
|
|
174
|
+
<b>Properties</b>
|
|
153
175
|
|
|
154
|
-
|
|
176
|
+
| name | type | required |
|
|
177
|
+
| -------- | -------- | -------- |
|
|
178
|
+
| `title` | `string` | required |
|
|
179
|
+
| `link` | `string` | required |
|
|
180
|
+
| `target` | `string` | optional |
|
|
181
|
+
| `class` | `string` | optional |
|
|
182
|
+
| `id` | `string` | optional |
|
|
155
183
|
|
|
156
|
-
|
|
157
|
-
| -------- | -------- |
|
|
158
|
-
| `target` | `string` |
|
|
159
|
-
| `class` | `string` |
|
|
160
|
-
| `id` | `string` |
|
|
184
|
+
### Sections
|
|
161
185
|
|
|
162
|
-
|
|
186
|
+
There is an option to order the occurrence of sections in the sidebar. You can use this option to hide/remove any section.
|
|
163
187
|
|
|
164
|
-
|
|
188
|
+
```json
|
|
189
|
+
"theme_opts": {
|
|
190
|
+
"sections": ["Classes", "Modules", "Global"] // Only three members will be in the sidebar.
|
|
191
|
+
}
|
|
192
|
+
```
|
|
165
193
|
|
|
166
194
|
```js
|
|
167
195
|
// SECTION_TYPE
|
|
@@ -175,142 +203,86 @@ This can be used to order the navbar sections. This can also be used to hide/rem
|
|
|
175
203
|
'Tutorials',
|
|
176
204
|
'Interfaces',
|
|
177
205
|
'Global',
|
|
178
|
-
'Menu',
|
|
179
206
|
];
|
|
180
207
|
```
|
|
181
208
|
|
|
182
|
-
|
|
183
|
-
"sections": ["Classes", "Modules", "Global", "Menu"] // Only 4 members will be in the navbar.
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### `meta: Array<{}>`
|
|
209
|
+
### Meta
|
|
187
210
|
|
|
188
|
-
|
|
211
|
+
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`.
|
|
189
212
|
|
|
190
213
|
```json
|
|
191
|
-
"
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
#### Properties
|
|
204
|
-
|
|
205
|
-
Any valid combination of [HTML metadata attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#Attributes).
|
|
206
|
-
|
|
207
|
-
### `search: {}`
|
|
208
|
-
|
|
209
|
-
To render search. Default value:
|
|
210
|
-
|
|
211
|
-
```json
|
|
212
|
-
"search": {
|
|
213
|
-
"shouldSort": true,
|
|
214
|
-
"threshold": 0.4,
|
|
215
|
-
"location": 0,
|
|
216
|
-
"distance": 100,
|
|
217
|
-
"maxPatternLength": 32,
|
|
218
|
-
"minMatchCharLength": 1,
|
|
214
|
+
"theme_opts": {
|
|
215
|
+
"meta" : [
|
|
216
|
+
{
|
|
217
|
+
"name": "author",
|
|
218
|
+
"content": "Ankit Kumar"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"name": "description",
|
|
222
|
+
"content": "Best Clean and minimal JSDoc 3 Template/Theme"
|
|
223
|
+
}
|
|
224
|
+
]
|
|
219
225
|
}
|
|
220
226
|
```
|
|
221
227
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
```json
|
|
225
|
-
"search" false
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
#### Properties
|
|
228
|
+
`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).
|
|
229
229
|
|
|
230
|
-
|
|
230
|
+
### Search
|
|
231
231
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
Includes the OverlayScrollbars plugin. Simply passing an empty object will activate this feature.
|
|
232
|
+
By default, the search feature is available in the theme. If you don't want the search feature, you can do the following:
|
|
235
233
|
|
|
236
234
|
```json
|
|
237
|
-
"
|
|
238
|
-
"
|
|
235
|
+
"theme_opts": {
|
|
236
|
+
"search": false
|
|
239
237
|
}
|
|
240
238
|
```
|
|
241
239
|
|
|
242
|
-
|
|
240
|
+
> Make sure you have added the `base_url` option as well, otherwise your search query might fail.
|
|
243
241
|
|
|
244
|
-
|
|
242
|
+
How does the search work?
|
|
243
|
+
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.
|
|
245
244
|
|
|
246
|
-
###
|
|
245
|
+
### CodePen
|
|
247
246
|
|
|
248
|
-
|
|
247
|
+
> Note: Currently this feature is only enabled for the examples section.
|
|
249
248
|
|
|
250
249
|
```json
|
|
251
|
-
"
|
|
252
|
-
"
|
|
253
|
-
"
|
|
254
|
-
"
|
|
250
|
+
"theme_opts": {
|
|
251
|
+
"codepen": {
|
|
252
|
+
"enable_for": ["examples"],
|
|
253
|
+
"options": {
|
|
254
|
+
"js_external": "https://code.jquery.com/jquery-3.6.0.min.js",
|
|
255
|
+
"js_pre_processor": "babel"
|
|
256
|
+
}
|
|
255
257
|
}
|
|
256
258
|
}
|
|
257
259
|
```
|
|
258
260
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
> Note: Navbar is not resizeable on mobile/small screens.
|
|
262
|
-
> If you don't want to give min and max value and want to use the default values then pass empty object.
|
|
263
|
-
|
|
264
|
-
```json
|
|
265
|
-
"resizeable": {
|
|
266
|
-
"navbar": {}
|
|
267
|
-
}
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
If you didn't pass any thing in navbar then navbar is not resizeable.
|
|
261
|
+
`options` can be any valid CodePen options. For more visit: [Codepen Prefill options](https://blog.codepen.io/documentation/prefill/#all-the-json-options-0)
|
|
271
262
|
|
|
272
|
-
###
|
|
263
|
+
### Add static dir
|
|
273
264
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
> Note: Currently this feature is only enabled for examples section.
|
|
265
|
+
To include static files:
|
|
277
266
|
|
|
278
267
|
```json
|
|
279
|
-
"
|
|
280
|
-
"
|
|
281
|
-
"options": {
|
|
282
|
-
"js_external": "https://code.jquery.com/jquery-3.6.0.min.js",
|
|
283
|
-
"js_pre_processor": "babel"
|
|
284
|
-
}
|
|
268
|
+
"theme_opts": {
|
|
269
|
+
"static_dir": ["./static"],
|
|
285
270
|
}
|
|
286
271
|
```
|
|
287
272
|
|
|
288
|
-
|
|
289
|
-
if you want default behaviour then don't pass anything in options.
|
|
290
|
-
|
|
291
|
-
### `create_style: string`
|
|
273
|
+
### Add styles
|
|
292
274
|
|
|
293
275
|
To create custom style rules. Example:
|
|
294
276
|
|
|
295
277
|
```json
|
|
296
|
-
"
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
Here the nav and footer style rule is to attached to the HTML's `style` tag.
|
|
300
|
-
|
|
301
|
-
### `add_scripts: string`
|
|
302
|
-
|
|
303
|
-
To create custom scripts. Example:
|
|
304
|
-
|
|
305
|
-
```json
|
|
306
|
-
"add_scripts": "function foo(){console.log('foo')} function bar() {console.log('bar')}"
|
|
278
|
+
"theme_opts" {
|
|
279
|
+
"create_style": ".sidebar-title { font-size: 2rem }"
|
|
280
|
+
}
|
|
307
281
|
```
|
|
308
282
|
|
|
309
|
-
|
|
283
|
+
### Add style paths
|
|
310
284
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
Use this option to add third party css library.
|
|
285
|
+
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)
|
|
314
286
|
|
|
315
287
|
> Note: You have to pass an array of object, and object keys are actually the attributes which you want in you link tag.
|
|
316
288
|
|
|
@@ -326,13 +298,33 @@ Example:
|
|
|
326
298
|
],
|
|
327
299
|
```
|
|
328
300
|
|
|
329
|
-
|
|
301
|
+
### Add custom css files
|
|
302
|
+
|
|
303
|
+
To include css files. Example:
|
|
304
|
+
|
|
305
|
+
```json
|
|
306
|
+
"theme_opts" {
|
|
307
|
+
"include_css": ["./static/index.css", "./src/docs/index.css"]
|
|
308
|
+
}
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
> Note: You are not required to manually copy file to output dir
|
|
330
312
|
|
|
331
|
-
|
|
313
|
+
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.
|
|
332
314
|
|
|
333
|
-
###
|
|
315
|
+
### Add scripts
|
|
334
316
|
|
|
335
|
-
|
|
317
|
+
To create custom scripts. Example:
|
|
318
|
+
|
|
319
|
+
```json
|
|
320
|
+
"theme_opts": {
|
|
321
|
+
"add_scripts": "function foo(){console.log('foo')} function bar() {console.log('bar')}"
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### Add script paths
|
|
326
|
+
|
|
327
|
+
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)
|
|
336
328
|
|
|
337
329
|
> Note: You have to pass an array of object, and object keys are actually the attributes which you want in you script tag.
|
|
338
330
|
|
|
@@ -348,58 +340,36 @@ Example:
|
|
|
348
340
|
],
|
|
349
341
|
```
|
|
350
342
|
|
|
351
|
-
### Properties
|
|
352
|
-
|
|
353
|
-
Any valid [script tag attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script)
|
|
354
|
-
|
|
355
|
-
### `footer: string | HTML`
|
|
356
|
-
|
|
357
|
-
Thing which you want to render as the footer. You can either pass a string or HTML.
|
|
358
|
-
Use HTML to overwrite the default HTML.
|
|
359
|
-
|
|
360
|
-
```json
|
|
361
|
-
"footer": "This is footer"
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
### `static_dir: Array<string>`
|
|
365
|
-
|
|
366
|
-
To include static files. Example:
|
|
367
|
-
|
|
368
|
-
```json
|
|
369
|
-
"static_dir": ["./static"],
|
|
370
|
-
```
|
|
371
|
-
|
|
372
343
|
This will copy the static folder to the output dir.
|
|
373
344
|
|
|
374
345
|
> Note: If the directory doesn't exists then you may get an error. Also directory is relative to your jsdoc config file.
|
|
375
346
|
|
|
376
|
-
This will not flatten
|
|
347
|
+
This will not flatten the directory it keep the directory structure as it is.
|
|
377
348
|
|
|
378
|
-
###
|
|
349
|
+
### Add custom script files
|
|
379
350
|
|
|
380
|
-
To include
|
|
351
|
+
To include js files. Example:
|
|
381
352
|
|
|
382
353
|
```json
|
|
383
|
-
"
|
|
354
|
+
"theme_opts": {
|
|
355
|
+
"include_js": ["./static/index.js", "./src/docs/index.js"]
|
|
356
|
+
}
|
|
384
357
|
```
|
|
385
358
|
|
|
386
359
|
> Note: You are not required to manually copy file to output dir
|
|
387
360
|
|
|
388
|
-
It will include the
|
|
361
|
+
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.
|
|
389
362
|
|
|
390
|
-
###
|
|
391
|
-
|
|
392
|
-
To include js files. Example:
|
|
363
|
+
### Footer
|
|
393
364
|
|
|
394
365
|
```json
|
|
395
|
-
"
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
> Note: You are not required to manually copy file to output dir
|
|
366
|
+
"theme_opts": {
|
|
399
367
|
|
|
400
|
-
|
|
368
|
+
"footer": "This is footer" // or <div class="footer-wrapper">This is a footer </div>
|
|
369
|
+
}
|
|
370
|
+
```
|
|
401
371
|
|
|
402
|
-
###
|
|
372
|
+
### To exclude inherited
|
|
403
373
|
|
|
404
374
|
To exclude inherited symbols. Example:
|
|
405
375
|
|
|
@@ -409,108 +379,26 @@ To exclude inherited symbols. Example:
|
|
|
409
379
|
|
|
410
380
|
This will remove all symbols (members, methods ...) that come from inherited parents.
|
|
411
381
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
"id": "some-id"
|
|
433
|
-
}
|
|
434
|
-
],
|
|
435
|
-
|
|
436
|
-
"meta": [
|
|
437
|
-
{
|
|
438
|
-
"name": "author",
|
|
439
|
-
"content": "Ankit Kumar"
|
|
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>` |
|
|
382
|
+
## Cheat sheet
|
|
383
|
+
|
|
384
|
+
| name | default | use case | expected value(s) |
|
|
385
|
+
| ------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- | --------------------- |
|
|
386
|
+
| `default_theme` | `"dark"` | To set the default theme | `"light" or "dark"` |
|
|
387
|
+
| `title` | `null` | To set the title | `HTML` or `string` |
|
|
388
|
+
| `menu` | `null` | To render extra link in navbar | Array of Object(s) |
|
|
389
|
+
| `meta` | `null` | Meta tag attributes | Array of Object(s) |
|
|
390
|
+
| `search` | `true` | To render search or not | `true` or `false` |
|
|
391
|
+
| `codepen` | `{}` | To open code in codepen | `Object` |
|
|
392
|
+
| `static_dir` | `null` | To include static dir | Array of string |
|
|
393
|
+
| `create_style` | `null` | To create custom style rules | `string` |
|
|
394
|
+
| `add_style_path` | `null` | To add external css libraries/files | Array of Object(s) |
|
|
395
|
+
| `include_css` | `null` | To include css files | Array of string |
|
|
396
|
+
| `add_scripts` | `null` | To create custom script | `string` |
|
|
397
|
+
| `add_script_path` | `null` | To add external js libraries/files | Array of Object(s) |
|
|
398
|
+
| `include_js` | `null` | To include js files | `string` |
|
|
399
|
+
| `footer` | `null` | To render footer | `HTML` or `string` |
|
|
400
|
+
| `exclude_inherited` | `false` | To exclude inherited symbols | `boolean` |
|
|
401
|
+
| `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>` |
|
|
514
402
|
|
|
515
403
|
## Changelog
|
|
516
404
|
|
|
@@ -525,10 +413,10 @@ git clone https://github.com/ankitskvmdam/clean-jsdoc-theme.git
|
|
|
525
413
|
cd clean-jsdoc-theme
|
|
526
414
|
npm install
|
|
527
415
|
npm install jsdoc --no-save
|
|
528
|
-
npm run
|
|
416
|
+
npm run build
|
|
529
417
|
```
|
|
530
418
|
|
|
531
|
-
`npm run
|
|
419
|
+
`npm run build` will generate files in output folder.
|
|
532
420
|
|
|
533
421
|
## Contributors
|
|
534
422
|
|
|
@@ -536,9 +424,14 @@ npm run test
|
|
|
536
424
|
<img src="https://contrib.rocks/image?repo=ankitskvmdam/clean-jsdoc-theme" />
|
|
537
425
|
</a>
|
|
538
426
|
|
|
427
|
+
## Thanks
|
|
428
|
+
|
|
429
|
+
Thanks to [fuse.js](https://fusejs.io/), [hljs](https://highlightjs.org/), and [tippy.js](https://tippyjs.bootcss.com/).
|
|
430
|
+
|
|
539
431
|
## Contact
|
|
540
432
|
|
|
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>.
|
|
433
|
+
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>.
|
|
434
|
+
|
|
542
435
|
Mail me at: <a href="mailto:hello@ankdev.me">hello@ankdev.me</a> <br>
|
|
543
436
|
|
|
544
437
|
## License
|