clean-jsdoc-theme 3.3.1 → 3.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## Change Log
2
2
 
3
+ ### In version 3.3.2
4
+
5
+ ### Feature
6
+
7
+ 1. Add an option to excludes inherited symbols. (#96)[https://github.com/ankitskvmdam/clean-jsdoc-theme/pull/96]
8
+
3
9
  ### In version 3.3.0
4
10
 
5
11
  ### Feature
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  <p align=center><i align="center">A beautiful, responsive, customizable theme for JSDoc</i></p>
4
4
  <hr>
5
5
 
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.1-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)
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.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
7
  <br>
8
8
 
9
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).
@@ -37,7 +37,7 @@ For any suggestions, questions or bugs, feel free to create an <a href="https://
37
37
  ## Motivation
38
38
 
39
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, and suggestions and bugs are fixed.
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.
41
41
 
42
42
  ## Installation
43
43
 
@@ -49,21 +49,11 @@ On your command line type
49
49
  npm install clean-jsdoc-theme
50
50
  ```
51
51
 
52
- ## Usage
53
-
54
- Clone repository to your designated JSDoc template directory, then run the following command:
55
-
56
- ```bash
57
- jsdoc entry-file.js -t path/to/clean-jsdoc-theme
58
- ```
59
-
60
- ## Node.js Dependency
61
-
62
52
  In your projects `package.json` file add a generate script
63
53
 
64
54
  ```json
65
55
  "script": {
66
- "generate-docs": "node_modules/.bin/jsdoc --configure .jsdoc.json --verbose"
56
+ "generate-docs": "node_modules/.bin/jsdoc --configure jsdoc.json --verbose"
67
57
  }
68
58
  ```
69
59
 
@@ -75,6 +65,14 @@ In your `jsdoc.json` file, add a template option.
75
65
  }
76
66
  ```
77
67
 
68
+ Now to generate docs run
69
+
70
+ ```bash
71
+ npm run generate-docs
72
+ ```
73
+
74
+ For more information look at [https://github.com/ankitskvmdam/clean-jsdoc-theme-example](https://github.com/ankitskvmdam/clean-jsdoc-theme-example)
75
+
78
76
  ## Example JSDoc Config
79
77
 
80
78
  ```json
@@ -305,7 +303,7 @@ Here the nav and footer style rule is to attached to the HTML's `style` tag.
305
303
  To create custom scripts. Example:
306
304
 
307
305
  ```json
308
- "create_style": "function foo(){console.log('foo')} function bar() {console.log('bar')}"
306
+ "add_scripts": "function foo(){console.log('foo')} function bar() {console.log('bar')}"
309
307
  ```
310
308
 
311
309
  Here the script is to attached to the HTML's `script` tag.
@@ -401,6 +399,16 @@ To include js files. Example:
401
399
 
402
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.
403
401
 
402
+ ### `exclude_inherited: <boolean>`
403
+
404
+ To exclude inherited symbols. Example:
405
+
406
+ ```json
407
+ "exclude_inherited": true
408
+ ```
409
+
410
+ This will remove all symbols (members, methods ...) that come from inherited parents.
411
+
404
412
  ### Example `theme_opts`
405
413
 
406
414
  ```json
@@ -458,6 +466,8 @@ It will include the js files to the output dir and also attach a script tag to t
458
466
  "include_css": ["./static/index.css", "./src/docs/index.css"],
459
467
  "include_js": ["./static/main.js", "./third-party/test/index.js"],
460
468
 
469
+ "exclude_inherited": true,
470
+
461
471
  "overlay_scrollbar": {
462
472
  "options": {
463
473
  }
@@ -481,25 +491,26 @@ It will include the js files to the output dir and also attach a script tag to t
481
491
 
482
492
  ### Cheat sheet
483
493
 
484
- | name | default | use case | expected value(s) |
485
- | ------------------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | ------------------------- |
486
- | `theme` | `"light"` | To set the theme variant | `"light" or "dark"` |
487
- | `title` | `null` | To set the title | `HTML` or `string` |
488
- | `menu` | `null` | To render extra link in navbar | Array of Object(s) |
489
- | `meta` | `null` | Meta tag attributes | Array of Object(s) |
490
- | `search` | `{}` | To render search or not | Fuse.js options |
491
- | `resizeable` | `{}` | To make certain element resizeable | `Object` |
492
- | `codepen` | `{}` | To open code in codepen | `Object` |
493
- | `create_style` | `null` | To create custom style rules | `string` |
494
- | `add_style_path` | `null` | To add external css libraries/files | Array of Object(s) |
495
- | `add_scripts` | `null` | To create custom script | `string` |
496
- | `add_script_path` | `null` | To add external js libraries/files | Array of Object(s) |
497
- | `footer` | `null` | To render footer | `HTML` or `string` |
498
- | `static_dir` | `null` | To include static dir | Array of string |
499
- | `include_css` | `null` | To include css files | Array of string |
500
- | `include_js` | `null` | To include js files | `string` |
501
- | `overlay_scrollbar` | `null` | To use overlay scrollbar | Overlay Scrollbar options |
502
- | `sections` | `["Menu", "Modules", "Classes", "Externals", "Events", "Namespaces", "Mixins", "Tutorials", "Interfaces", "Global"]` | To order navbar sections or to hide/remove sidebar sections | `Array<SECTION_TYPE>` |
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>` |
503
514
 
504
515
  ## Changelog
505
516
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clean-jsdoc-theme",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
4
4
  "description": "A beautifully crafted theme/template for JSDoc 3. This theme/template looks and feels like a premium theme/template. This is a fully mobile responsive theme and also fully customizable theme.",
5
5
  "main": "publish.js",
6
6
  "scripts": {
package/publish.js CHANGED
@@ -1051,6 +1051,7 @@ exports.publish = function(taffyData, opts, tutorials) {
1051
1051
  view.search = search();
1052
1052
  view.resizeable = resizeable();
1053
1053
  view.codepen = codepen();
1054
+ view.excludeInherited = Boolean(themeOpts.exclude_inherited);
1054
1055
  attachModuleSymbols(
1055
1056
  find({ longname: { left: 'module:' } }),
1056
1057
  members.modules
@@ -87,7 +87,7 @@
87
87
  <?js } ?>
88
88
 
89
89
  <?js
90
- var classes = self.find({kind: 'class', memberof: doc.longname});
90
+ var classes = self.find({kind: 'class', memberof: doc.longname, inherited: {'!is': self.excludeInherited}});
91
91
  if (!isGlobalPage && classes && classes.length) {
92
92
  ?>
93
93
  <h3 class="subsection-title">Classes</h3>
@@ -99,7 +99,7 @@
99
99
  <?js } ?>
100
100
 
101
101
  <?js
102
- var mixins = self.find({kind: 'mixin', memberof: doc.longname});
102
+ var mixins = self.find({kind: 'mixin', memberof: doc.longname, inherited: {'!is': self.excludeInherited}});
103
103
  if (!isGlobalPage && mixins && mixins.length) {
104
104
  ?>
105
105
  <h3 class="subsection-title">Mixins</h3>
@@ -111,7 +111,7 @@
111
111
  <?js } ?>
112
112
 
113
113
  <?js
114
- var namespaces = self.find({kind: 'namespace', memberof: doc.longname});
114
+ var namespaces = self.find({kind: 'namespace', memberof: doc.longname, inherited: {'!is': self.excludeInherited}});
115
115
  if (!isGlobalPage && namespaces && namespaces.length) {
116
116
  ?>
117
117
  <h3 class="subsection-title">Namespaces</h3>
@@ -123,7 +123,7 @@
123
123
  <?js } ?>
124
124
 
125
125
  <?js
126
- var members = self.find({kind: 'member', memberof: isGlobalPage ? {isUndefined: true} : doc.longname});
126
+ var members = self.find({kind: 'member', memberof: isGlobalPage ? {isUndefined: true} : doc.longname, inherited: {'!is': self.excludeInherited}});
127
127
 
128
128
  // symbols that are assigned to module.exports are not globals, even though they're not a memberof anything
129
129
  if (isGlobalPage && members && members.length && members.forEach) {
@@ -141,7 +141,7 @@
141
141
  <?js } ?>
142
142
 
143
143
  <?js
144
- var methods = self.find({kind: 'function', memberof: isGlobalPage ? {isUndefined: true} : doc.longname});
144
+ var methods = self.find({kind: 'function', memberof: isGlobalPage ? {isUndefined: true} : doc.longname, inherited: {'!is': self.excludeInherited}});
145
145
  if (methods && methods.length && methods.forEach) {
146
146
  ?>
147
147
  <h3 class="subsection-title">Methods</h3>
@@ -152,7 +152,7 @@
152
152
  <?js } ?>
153
153
 
154
154
  <?js
155
- var typedefs = self.find({kind: 'typedef', memberof: isGlobalPage ? {isUndefined: true} : doc.longname});
155
+ var typedefs = self.find({kind: 'typedef', memberof: isGlobalPage ? {isUndefined: true} : doc.longname, inherited: {'!is': self.excludeInherited}});
156
156
  if (typedefs && typedefs.length && typedefs.forEach) {
157
157
  ?>
158
158
  <h3 class="subsection-title">Type Definitions</h3>
@@ -172,7 +172,7 @@
172
172
  <?js } ?>
173
173
 
174
174
  <?js
175
- var events = self.find({kind: 'event', memberof: isGlobalPage ? {isUndefined: true} : doc.longname});
175
+ var events = self.find({kind: 'event', memberof: isGlobalPage ? {isUndefined: true} : doc.longname, inherited: {'!is': self.excludeInherited}});
176
176
  if (events && events.length && events.forEach) {
177
177
  ?>
178
178
  <h3 class="subsection-title">Events</h3>
package/tmpl/layout.tmpl CHANGED
@@ -150,12 +150,6 @@
150
150
  </script>
151
151
  <?js } ?>
152
152
 
153
- <?js if(this.dynamicScript != undefined ) { ?>
154
- <script type="text/javascript">
155
- <?js= this.dynamicScript ?>
156
- </script>
157
- <?js } ?>
158
-
159
153
  <?js if(this.overlayScrollbar != undefined ) { ?>
160
154
  <script type="text/javascript">
161
155
  var option = JSON.parse('<?js=this.overlayScrollbar ?>')