clean-jsdoc-theme 3.3.3 → 4.0.2

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.
Files changed (61) hide show
  1. package/.github/workflows/{codeql-analysis.yml → codeql.yml} +23 -18
  2. package/.github/workflows/greetings.yml +16 -0
  3. package/CHANGELOG.md +16 -0
  4. package/LICENSE +1 -1
  5. package/README.md +206 -311
  6. package/jsdoc-config.json +7 -5
  7. package/minify.js +52 -0
  8. package/package.json +10 -6
  9. package/publish.js +805 -871
  10. package/static/fonts/Inconsolata-Regular.ttf +0 -0
  11. package/static/fonts/OpenSans-Regular.ttf +0 -0
  12. package/static/fonts/WorkSans-Bold.ttf +0 -0
  13. package/static/scripts/core.js +576 -0
  14. package/static/scripts/core.min.js +23 -0
  15. package/static/scripts/resize.js +59 -54
  16. package/static/scripts/search.js +220 -53
  17. package/static/scripts/search.min.js +11 -0
  18. package/static/scripts/third-party/hljs-line-num.js +1 -0
  19. package/static/scripts/third-party/hljs-original.js +5162 -0
  20. package/static/scripts/third-party/hljs.js +1 -0
  21. package/static/scripts/third-party/popper.js +6 -0
  22. package/static/scripts/third-party/tippy.js +2 -0
  23. package/static/scripts/third-party/tocbot.js +1 -0
  24. package/static/styles/clean-jsdoc-theme-base.css +752 -190
  25. package/static/styles/clean-jsdoc-theme-dark.css +216 -133
  26. package/static/styles/clean-jsdoc-theme-light.css +239 -170
  27. package/static/styles/clean-jsdoc-theme.min.css +1 -0
  28. package/tmpl/container.tmpl +13 -12
  29. package/tmpl/details.tmpl +16 -16
  30. package/tmpl/examples.tmpl +3 -1
  31. package/tmpl/icons.tmpl +43 -5
  32. package/tmpl/layout.tmpl +62 -81
  33. package/tmpl/members.tmpl +1 -2
  34. package/tmpl/method.tmpl +4 -5
  35. package/tmpl/mobile-sidebar.tmpl +21 -0
  36. package/tmpl/navbar-actions.tmpl +19 -0
  37. package/tmpl/navbar-menu.tmpl +25 -0
  38. package/tmpl/navbar.tmpl +14 -0
  39. package/tmpl/returns.tmpl +1 -1
  40. package/tmpl/search.tmpl +17 -0
  41. package/tmpl/sidebar-items.tmpl +24 -0
  42. package/tmpl/sidebar-title.tmpl +10 -0
  43. package/tmpl/sidebar.tmpl +9 -0
  44. package/tmpl/source.tmpl +7 -2
  45. package/tmpl/toc.tmpl +4 -0
  46. package/helpers/navbarBuilder.js +0 -0
  47. package/static/fonts/MavenPro-Regular.ttf +0 -0
  48. package/static/fonts/Montserrat-Regular.ttf +0 -0
  49. package/static/fonts/Muli-Black.ttf +0 -0
  50. package/static/fonts/OFL-hind.txt +0 -93
  51. package/static/fonts/OFL-montserrat.txt +0 -93
  52. package/static/scripts/fix-code-block.js +0 -53
  53. package/static/scripts/fix-navbar.js +0 -25
  54. package/static/scripts/linenumber.js +0 -25
  55. package/static/scripts/misc.js +0 -217
  56. package/static/scripts/third-party/lang-css.js +0 -2
  57. package/static/scripts/third-party/prettify.js +0 -28
  58. package/static/styles/reset.css +0 -351
  59. package/static/styles/third-party/ionicons.min.css +0 -11
  60. package/static/styles/third-party/prettify-jsdoc.css +0 -111
  61. package/static/styles/third-party/prettify-tomorrow.css +0 -5
package/README.md CHANGED
@@ -1,59 +1,53 @@
1
- <hr>
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
- [![Stars](https://img.shields.io/github/stars/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme) [![Fork](https://img.shields.io/github/forks/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/fork) ![Version](https://img.shields.io/badge/version-3.3.3-005bff) [![Issues Open](https://img.shields.io/github/issues/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/issues) [![Contributors](https://img.shields.io/github/contributors/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/graphs/contributors) [![Build Status](https://travis-ci.org/ankitskvmdam/clean-jsdoc-theme.svg?branch=production)](https://travis-ci.org/ankitskvmdam/clean-jsdoc-theme) [![license](https://img.shields.io/github/license/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/master/LICENSE)
3
+ [![Stars](https://img.shields.io/github/stars/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme) [![Fork](https://img.shields.io/github/forks/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/fork) ![Version](https://img.shields.io/badge/version-4.0.2-005bff) [![Issues Open](https://img.shields.io/github/issues/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/issues) [![Contributors](https://img.shields.io/github/contributors/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/graphs/contributors) [![Build Status](https://travis-ci.org/ankitskvmdam/clean-jsdoc-theme.svg?branch=production)](https://travis-ci.org/ankitskvmdam/clean-jsdoc-theme) [![license](https://img.shields.io/github/license/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/master/LICENSE)
7
4
  <br>
8
5
 
9
- Clean-jsdoc-theme is a beautifully crafted theme/template for JSDoc 3. This theme/template looks and feels like a premium theme/template as it's mobile responsive and also highly customizable. For more options [look below at the options section](#options).
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
- For any suggestions, questions or bugs, feel free to create an <a href="https://github.com/ankitskvmdam/clean-jsdoc-theme/issues">issue</a> in this repo.
8
+ Some salient features:
12
9
 
13
- ## Demo
14
-
15
- 1. Live demo (dark): <a href="https://ankdev.me/clean-jsdoc-theme/dark/index.html">https://ankdev.me/clean-jsdoc-theme/dark/index.html</a> <br>
16
- 1. Live demo (light): <a href="https://ankdev.me/clean-jsdoc-theme/light/index.html">https://ankdev.me/clean-jsdoc-theme/light/index.html</a>
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.
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).
21
16
 
22
- #### Screenshot
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>.
23
18
 
24
- ![Screen-1](./example/screen-1.png)
25
- ![Screen-2](./example/screen-2.png)
26
- ![Screen-3](./example/screen-3.png)
27
- ![Screen-4](./example/screen-4.png)
28
- ![Screen-5](./example/screen-5.png)
29
- ![Screen-6](./example/screen-6.png)
19
+ ## Demo
30
20
 
31
- ## Libraries Used
21
+ 1. To view this theme, visit [https://ankdev.me/clean-jsdoc-theme/v4](https://ankdev.me/clean-jsdoc-theme/v4).
32
22
 
33
- 1. [Fuse.js](https://fusejs.io/) - Fuse.js is a powerful, lightweight fuzzy-search library, with zero dependencies.
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.
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.
36
24
 
37
- ## Motivation
25
+ ## Screenshots
38
26
 
39
- When I was new to JavaScript documentation and [JSDoc](https://jsdoc.app/), it was hard for me to find a theme for JSDoc which was highly customizable or regularly maintained. Features that these lacked included responsiveness, a working search bar, and customization.
40
- To tackle these problems I created this project, an easy to use, responsive theme for JSDoc. I am actively working on this project and I try to make changes to the project frequently to make sure it's up to date.
27
+ ![Dark theme](./example/screen-1.png)
28
+ ![Light theme](./example/screen-2.png)
29
+ ![Mobile View](./example/screen-3.png)
30
+ ![Search view](./example/screen-4.png)
31
+ ![Class page](./example/screen-5.png)
32
+ ![Code page](./example/screen-6.png)
41
33
 
42
34
  ## Installation
43
35
 
44
- > Note you must have `npm` installed on your machine.
36
+ > Note you must have `node` and `npm` installed on your machine.
45
37
 
46
38
  On your command line type
47
39
 
48
40
  ```bash
49
- npm install clean-jsdoc-theme
41
+ npm install clean-jsdoc-theme --save-dev
42
+ # or
43
+ yarn add clean-jsdoc-theme -D
50
44
  ```
51
45
 
52
- In your projects `package.json` file add a generate script
46
+ In your projects `package.json` file add a generate script. You need to run this script when you want to generate documentation.
53
47
 
54
48
  ```json
55
49
  "script": {
56
- "generate-docs": "node_modules/.bin/jsdoc --configure jsdoc.json --verbose"
50
+ "generate-docs": "jsdoc --configure jsdoc.json --verbose"
57
51
  }
58
52
  ```
59
53
 
@@ -65,6 +59,8 @@ In your `jsdoc.json` file, add a template option.
65
59
  }
66
60
  ```
67
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
+
68
64
  Now to generate docs run
69
65
 
70
66
  ```bash
@@ -93,7 +89,11 @@ For more information look at [https://github.com/ankitskvmdam/clean-jsdoc-theme-
93
89
  "verbose": true,
94
90
  "template": "./node_modules/clean-jsdoc-theme",
95
91
  "theme_opts": {
96
- "theme": "dark"
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
97
  }
98
98
  }
99
99
  }
@@ -101,67 +101,97 @@ For more information look at [https://github.com/ankitskvmdam/clean-jsdoc-theme-
101
101
 
102
102
  ## Options
103
103
 
104
- To use custom options (such as light and dark modes), pass an object called `theme_opts` in your config file under `opts`.
104
+ ### Set a default theme
105
105
 
106
- ### `theme : "light" | "dark"`
106
+ To set the default theme add the following in your jsodc config file:
107
107
 
108
- To set the overall theme of the documentation file(s). Currently there is only two variant `"light"` and `"dark"` but in future I will try to add more.
109
- `Default value is "light"`
108
+ ```json
109
+ "theme_opts": {
110
+ "default_theme": "dark" // or "light"
111
+ }
112
+ ```
110
113
 
111
- ### `favicon: string`
114
+ ### Set base url
112
115
 
113
- This option sets the favicon of the document. It accepts strings defining the path of the icon.
116
+ If you want to set the base url:
114
117
 
115
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": {
116
134
  "favion": "path/to/img"
135
+ }
136
+
117
137
  ```
118
138
 
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`. For more details look `static_dir` section.
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`.
120
140
 
121
- ### `title: string | HTML`
141
+ ### Add title
122
142
 
123
- This option sets the title of the document in the navbar. 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:
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:
124
144
 
125
145
  ```json
126
- "title": "<img src='path/to/img' class='my-custom-class'/>"
146
+ "theme_opts": {
147
+ "title": "<img src='path/to/img' class='my-custom-class'/>" // or "title": "clean-jsodc-theme"
148
+ }
127
149
  ```
128
150
 
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`. For more details look `static_dir` section.
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`.
130
152
 
131
- ### `menu: Array<{}>`
153
+ ### Add navbar menu
132
154
 
133
- This options allows rendering of extra link(s) in navbar to the side of the documentation. It accepts an array of objects, such as in the following example example:
155
+ To render extra link(s) in navbar. It accepts an array of objects:
134
156
 
135
157
  ```json
136
- "menu" : [
137
- {
138
- "title": "Website",
139
- "link": "https://ankdev.me/clean-jsdoc-theme/dark/",
140
- "target": "_blank",
141
- "class": "some-class",
142
- "id": "some-id"
143
- }
144
- ]
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
+ }
145
172
  ```
146
173
 
147
- #### Required properties
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.
148
175
 
149
- | name | type |
150
- | ------- | -------- |
151
- | `title` | `string` |
152
- | `link` | `string` |
176
+ <b>Properties</b>
153
177
 
154
- #### Optional Properties
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 |
155
185
 
156
- | name | type |
157
- | -------- | -------- |
158
- | `target` | `string` |
159
- | `class` | `string` |
160
- | `id` | `string` |
186
+ ### Sections
161
187
 
162
- ### `sections: Array<SECTION_TYPE>`
188
+ There is an option to order the occurrence of sections in the sidebar. You can use this option to hide/remove any section.
163
189
 
164
- This can be used to order the navbar sections. This can also be used to hide/remove any section.
190
+ ```json
191
+ "theme_opts": {
192
+ "sections": ["Classes", "Modules", "Global"] // Only three members will be in the sidebar.
193
+ }
194
+ ```
165
195
 
166
196
  ```js
167
197
  // SECTION_TYPE
@@ -175,142 +205,86 @@ This can be used to order the navbar sections. This can also be used to hide/rem
175
205
  'Tutorials',
176
206
  'Interfaces',
177
207
  'Global',
178
- 'Menu',
179
208
  ];
180
209
  ```
181
210
 
182
- ```json5
183
- "sections": ["Classes", "Modules", "Global", "Menu"] // Only 4 members will be in the navbar.
184
- ```
185
-
186
- ### `meta: Array<{}>`
211
+ ### Meta
187
212
 
188
- A list of `meta` tag attributes to add to the `head` of each page.
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`.
189
214
 
190
215
  ```json
191
- "meta" : [
192
- {
193
- "name": "author",
194
- "content": "Ankit Kumar"
195
- },
196
- {
197
- "name": "description",
198
- "content": "Best Clean and minimal JSDoc 3 Template/Theme"
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,
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
+ ]
219
227
  }
220
228
  ```
221
229
 
222
- If you don't want to render search box then do the following:
223
-
224
- ```json
225
- "search" false
226
- ```
227
-
228
- #### Properties
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).
229
231
 
230
- Any valid [fuse.js properties](https://fusejs.io/api/options.html)
232
+ ### Search
231
233
 
232
- ### `overlay_scrollbar: {}`
233
-
234
- Includes the OverlayScrollbars plugin. Simply passing an empty object will activate this feature.
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
235
 
236
236
  ```json
237
- "overlay_scrollbar": {
238
- "option": {}
237
+ "theme_opts": {
238
+ "search": false
239
239
  }
240
240
  ```
241
241
 
242
- #### Properties
242
+ > Make sure you have added the `base_url` option as well, otherwise your search query might fail.
243
243
 
244
- Any valid [overlay scrollbar properties](https://kingsora.github.io/OverlayScrollbars/#!documentation/options)
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.
245
246
 
246
- ### `resizeable: {}`
247
+ ### CodePen
247
248
 
248
- This will make certain element in DOM resizeable. Currently we only support navbar to be resizeable. By default navbar is not resizeable. To make navbar resizeable you have to do the following:
249
+ > Note: Currently this feature is only enabled for the examples section.
249
250
 
250
251
  ```json
251
- "resizeable": {
252
- "navbar": {
253
- "min": "300",
254
- "max": "600"
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
+ }
255
259
  }
256
260
  }
257
261
  ```
258
262
 
259
- Don't include any unit. Also, units of max and min is inferred in `px`.
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.
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)
271
264
 
272
- ### `codepen: {}`
265
+ ### Add static dir
273
266
 
274
- This will add a link to the codepen with prefilled data.
275
-
276
- > Note: Currently this feature is only enabled for examples section.
267
+ To include static files:
277
268
 
278
269
  ```json
279
- "codepen": {
280
- "enable_for": ["examples"],
281
- "options": {
282
- "js_external": "https://code.jquery.com/jquery-3.6.0.min.js",
283
- "js_pre_processor": "babel"
284
- }
270
+ "theme_opts": {
271
+ "static_dir": ["./static"],
285
272
  }
286
273
  ```
287
274
 
288
- `options` can be any valid codepen options. For more visit: [Codepen Prefill options](https://blog.codepen.io/documentation/prefill/#all-the-json-options-0)
289
- if you want default behaviour then don't pass anything in options.
290
-
291
- ### `create_style: string`
275
+ ### Add styles
292
276
 
293
277
  To create custom style rules. Example:
294
278
 
295
279
  ```json
296
- "create_style": "nav{background: yellow} footer {background: green}"
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')}"
280
+ "theme_opts" {
281
+ "create_style": ".sidebar-title { font-size: 2rem }"
282
+ }
307
283
  ```
308
284
 
309
- Here the script is to attached to the HTML's `script` tag.
285
+ ### Add style paths
310
286
 
311
- ### `add_style_path: Array<{}>`
312
-
313
- Use this option to add third party css library.
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)
314
288
 
315
289
  > Note: You have to pass an array of object, and object keys are actually the attributes which you want in you link tag.
316
290
 
@@ -326,13 +300,33 @@ Example:
326
300
  ],
327
301
  ```
328
302
 
329
- #### Properties
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
330
314
 
331
- Any valid [style tag attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style)
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.
332
316
 
333
- ### `add_script_path: Array<{}>`
317
+ ### Add scripts
334
318
 
335
- Use this option to add third party js library.
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)
336
330
 
337
331
  > Note: You have to pass an array of object, and object keys are actually the attributes which you want in you script tag.
338
332
 
@@ -348,58 +342,36 @@ Example:
348
342
  ],
349
343
  ```
350
344
 
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
345
  This will copy the static folder to the output dir.
373
346
 
374
347
  > Note: If the directory doesn't exists then you may get an error. Also directory is relative to your jsdoc config file.
375
348
 
376
- This will not flatten then directory it keep the directory structure as it is.
349
+ This will not flatten the directory it keep the directory structure as it is.
377
350
 
378
- ### `include_css: Array<string>`
351
+ ### Add custom script files
379
352
 
380
- To include css files. Example:
353
+ To include js files. Example:
381
354
 
382
355
  ```json
383
- "include_css": ["./static/index.css", "./src/docs/index.css"]
356
+ "theme_opts": {
357
+ "include_js": ["./static/index.js", "./src/docs/index.js"]
358
+ }
384
359
  ```
385
360
 
386
361
  > Note: You are not required to manually copy file to output dir
387
362
 
388
- 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.
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.
389
364
 
390
- ### `include_js: Array<string>`
391
-
392
- To include js files. Example:
365
+ ### Footer
393
366
 
394
367
  ```json
395
- "include_js": ["./static/index.js", "./src/docs/index.js"]
396
- ```
397
-
398
- > Note: You are not required to manually copy file to output dir
368
+ "theme_opts": {
399
369
 
400
- 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.
370
+ "footer": "This is footer" // or <div class="footer-wrapper">This is a footer </div>
371
+ }
372
+ ```
401
373
 
402
- ### `exclude_inherited: <boolean>`
374
+ ### To exclude inherited
403
375
 
404
376
  To exclude inherited symbols. Example:
405
377
 
@@ -409,108 +381,26 @@ To exclude inherited symbols. Example:
409
381
 
410
382
  This will remove all symbols (members, methods ...) that come from inherited parents.
411
383
 
412
- ### Example `theme_opts`
413
-
414
- ```json
415
- "opts":{
416
- "theme_opts":{
417
- "theme": "dark",
418
- "title": "clean-jsdoc-theme",
419
- "menu": [
420
- {
421
- "title": "Website",
422
- "link": "https://ankdev.me/clean-jsdoc-theme/index.html",
423
- "target": "_blank",
424
- "class": "some-class",
425
- "id": "some-id"
426
- },
427
- {
428
- "title": "Github",
429
- "link": "https://github.com/ankitskvmdam/clean-jsdoc-theme/",
430
- "target": "_blank",
431
- "class": "some-class",
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>` |
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>` |
514
404
 
515
405
  ## Changelog
516
406
 
@@ -525,20 +415,25 @@ git clone https://github.com/ankitskvmdam/clean-jsdoc-theme.git
525
415
  cd clean-jsdoc-theme
526
416
  npm install
527
417
  npm install jsdoc --no-save
528
- npm run test
418
+ npm run build
529
419
  ```
530
420
 
531
- `npm run test` will generate files in output folder.
421
+ `npm run build` will generate files in output folder.
532
422
 
533
423
  ## Contributors
534
424
 
535
425
  <a href="https://github.com/ankitskvmdam/clean-jsdoc-theme/graphs/contributors">
536
- <img src="https://contrib.rocks/image?repo=ankitskvmdam/clean-jsdoc-theme" />
426
+ <img src="https://contrib.rocks/image?repo=ankitskvmdam/clean-jsdoc-theme" alt="clean-jsdoc-contributors" />
537
427
  </a>
538
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
+
539
433
  ## Contact
540
434
 
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>
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
+
542
437
  Mail me at: <a href="mailto:hello@ankdev.me">hello@ankdev.me</a> <br>
543
438
 
544
439
  ## License