clean-jsdoc-theme 3.2.5 → 3.2.9

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,6 +1,23 @@
1
1
  ## Change Log
2
2
 
3
- ### In version 3.2.5
3
+
4
+ ### In version 3.2.8
5
+ ### Bug Fixes
6
+ 1. Fix: Search condition statement. (#81)[https://github.com/ankitskvmdam/clean-jsdoc-theme/pull/81]
7
+ 1. Fix: missing styles/heading.css. (#80)[https://github.com/ankitskvmdam/clean-jsdoc-theme/issues/80]
8
+
9
+ ### Feature
10
+ 1. Feat: add menuLocation option to adjust the place to append extra links. (#78)[https://github.com/ankitskvmdam/clean-jsdoc-theme/pull/78]
11
+
12
+ ### In version 3.2.7
13
+
14
+ ### Bug Fix
15
+
16
+ 1. Fix: quotes issue for codepen options.
17
+ 1. Fix: source is not printing if source is the only key. (#71)[https://github.com/ankitskvmdam/clean-jsdoc-theme/issues/71]
18
+ 1. Fix (css): font size of return type. (#70)[https://github.com/ankitskvmdam/clean-jsdoc-theme/issues/70]
19
+
20
+ ### In version 3.2.6
4
21
 
5
22
  ### Feature
6
23
 
@@ -10,6 +27,7 @@
10
27
 
11
28
  1. Fix the css of example caption. [View changes.](https://github.com/ankitskvmdam/clean-jsdoc-theme/commit/1cba9400a6d9ae2991eb5b32282e7572510656c6)
12
29
  1. Fix the overflow css of code section. [View changes.](https://github.com/ankitskvmdam/clean-jsdoc-theme/commit/1cba9400a6d9ae2991eb5b32282e7572510656c6)
30
+ 1. Fix the css of code block in dark theme.
13
31
 
14
32
  ### In version 3.2.4
15
33
 
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.2.5-%23007bff) [![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.2.9%23007bff) [![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).
@@ -106,6 +106,16 @@ To use custom options (such as light and dark modes), pass an object called `the
106
106
  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.
107
107
  `Default value is "light"`
108
108
 
109
+ ### `favicon: string`
110
+
111
+ This option sets the favicon of the document. It accepts strings defining the path of the icon.
112
+
113
+ ```json
114
+ "favion": "path/to/img"
115
+ ```
116
+
117
+ 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.
118
+
109
119
  ### `title: string | HTML`
110
120
 
111
121
  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:
@@ -147,6 +157,10 @@ This options allows rendering of extra link(s) in navbar to the side of the docu
147
157
  | `class` | `string` |
148
158
  | `id` | `string` |
149
159
 
160
+ ### `menuLocation: "up" | "down"`
161
+
162
+ This options allows to adjust the location of the menu items listed in `menu` array, either at the top or at the bottom among all navbar items. `Default value is "up".`
163
+
150
164
  ### `meta: Array<{}>`
151
165
 
152
166
  A list of `meta` tag attributes to add to the `head` of each page.
@@ -423,6 +437,19 @@ It will include the js files to the output dir and also attach a script tag to t
423
437
  "overlay_scrollbar": {
424
438
  "options": {
425
439
  }
440
+ },
441
+ "resizeable": {
442
+ "navbar": {
443
+ "min": "300",
444
+ "max": "600"
445
+ }
446
+ },
447
+ "codepen": {
448
+ "enable_for": ["examples"],
449
+ "options": {
450
+ "js_external": "https://code.jquery.com/jquery-3.6.0.min.js",
451
+ "js_pre_processor": "babel"
452
+ }
426
453
  }
427
454
  }
428
455
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "clean-jsdoc-theme",
3
- "version": "3.2.5",
3
+ "version": "3.2.9",
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": {
7
- "test": "node_modules/jsdoc/jsdoc.js -c jsdoc-config.json",
7
+ "test": "node node_modules/jsdoc/jsdoc.js -c jsdoc-config.json",
8
8
  "lint:js": "eslint . --ext .js",
9
9
  "lint:style": "stylelint static/styles/",
10
10
  "lint": "concurrently --prefix '{time}-{pid}' 'npm run lint:types' 'npm run lint:style'"
package/publish.js CHANGED
@@ -376,6 +376,12 @@ function buildFooter() {
376
376
  return footer;
377
377
  }
378
378
 
379
+ function getFavicon() {
380
+ var favicon = themeOpts.favicon || undefined
381
+
382
+ return favicon
383
+ }
384
+
379
385
  // function copy
380
386
  function createDynamicStyleSheet() {
381
387
  var styleClass = themeOpts.create_style || undefined;
@@ -615,9 +621,10 @@ function buildNav(members) {
615
621
  var seenTutorials = {};
616
622
 
617
623
  var menu = (themeOpts.menu) || undefined;
624
+ var menuLocation = themeOpts.menuLocation || 'up';
618
625
 
619
626
 
620
- if (menu !== undefined) { nav += buildMenuNav(menu); }
627
+ if (menu !== undefined && menuLocation === 'up') { nav += buildMenuNav(menu); }
621
628
  nav += buildMemberNav(members.tutorials, 'Tutorials', seenTutorials, linktoTutorial, true);
622
629
  nav += buildMemberNav(members.classes, 'Classes', seen, linkto);
623
630
  nav += buildMemberNav(members.modules, 'Modules', {}, linkto);
@@ -627,7 +634,7 @@ function buildNav(members) {
627
634
  nav += buildMemberNav(members.mixins, 'Mixins', seen, linkto);
628
635
  nav += buildMemberNav(members.interfaces, 'Interfaces', seen, linkto);
629
636
  nav += buildMemberNav(members.globals, 'Global', seen, linkto);
630
-
637
+ if (menu !== undefined && menuLocation === 'down') { nav += buildMenuNav(menu); }
631
638
  nav += '</div>';
632
639
 
633
640
  return nav;
@@ -828,6 +835,7 @@ exports.publish = function(taffyData, opts, tutorials) {
828
835
  view.htmlsafe = htmlsafe;
829
836
  view.outputSourceFiles = outputSourceFiles;
830
837
  view.footer = buildFooter();
838
+ view.favicon = getFavicon();
831
839
  view.dynamicStyle = createDynamicStyleSheet();
832
840
  view.dynamicStyleSrc = returnPathOfStyleSrc();
833
841
  view.dynamicScript = createDynamicsScripts();
@@ -67,8 +67,15 @@ function copyFunction(id) {
67
67
  var copyToClipboard = '<div class="code-copy-icon-container" onclick="copyFunction(\'' + id + '\')"><div><svg class="sm-icon" alt="click to copy"><use xlink:href="#copy-icon"></use></svg>' + tooltip + '<div></div>';
68
68
 
69
69
  // extract the code language
70
- var langName = classList[classList.length - 1].split('-')[1];
70
+ var langName = classList[classList.length - 1];
71
71
 
72
+ if (typeof langName === 'string') {
73
+ langName = langName.split('-')[1];
74
+ }
75
+
76
+ /**
77
+ * By default language name is javascript.
78
+ */
72
79
  if ( langName === undefined ) { langName = 'JavaScript'; }
73
80
 
74
81
  // if(langName != undefined)
@@ -148,6 +148,11 @@ samp {
148
148
  color: #fff;
149
149
  }
150
150
 
151
+ .prettyprint,
152
+ .pre-top-bar-container {
153
+ background: #000;
154
+ }
155
+
151
156
  .member-item-container strong,
152
157
  .method-member-container strong {
153
158
  color: #fff;
@@ -114,7 +114,7 @@ ol.linenums li {
114
114
  }
115
115
 
116
116
  .name a {
117
- font-size: 28px;
117
+ font-size: 90%;
118
118
  }
119
119
 
120
120
  .details {
package/tmpl/details.tmpl CHANGED
@@ -5,22 +5,23 @@ var defaultObjectClass = '';
5
5
  var printDeatils = false
6
6
  var loopVar = 0;
7
7
  var detailsKeys = [
8
- 'version',
9
- 'since',
8
+ 'author',
9
+ 'copyright',
10
+ 'defaultvalue',
11
+ 'deprecated',
10
12
  'inherited',
11
13
  'inherits',
12
- 'overrides',
13
14
  'implementations',
14
15
  'implements',
15
- 'mixes',
16
- 'deprecated',
17
- 'author',
18
- 'copyright',
19
16
  'license',
20
- 'defaultvalue',
21
- 'tutorials',
17
+ 'meta',
18
+ 'mixes',
19
+ 'overrides',
22
20
  'see',
23
- 'todo'
21
+ 'since',
22
+ 'todo',
23
+ 'tutorials',
24
+ 'version',
24
25
  ]
25
26
 
26
27
  // Check if the default value is an object or array; if so, apply code highlighting
@@ -22,11 +22,11 @@
22
22
  var optionsString = '';
23
23
  var optionsKey = Object.keys(options)
24
24
  optionsKey.map((key, idx) => {
25
- optionsString += '"' + key +'": "' + options[key] + '"';
25
+ optionsString += '"' + key +'": "' + options[key].replace(/"/g, "&quot;").replace(/'/g, "&apos;") + '"';
26
26
  if(idx !== optionsKey.length - 1) {
27
27
  optionsString += ','
28
28
  }
29
- })
29
+ })
30
30
  ?>
31
31
  <form action="https://codepen.io/pen/define" method="POST" target="_blank" class="codepen-form">
32
32
  <input type="hidden" name="data" value='{"title": "<?js= example.caption || 'Example' ?>", "js": <?js= jsonString ?>, <?js= optionsString ?> }' />
package/tmpl/layout.tmpl CHANGED
@@ -5,6 +5,11 @@
5
5
  <meta charset="utf-8">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
7
 
8
+ <!-- Adding favicon -->
9
+ <?js if(this.favicon != undefined) { ?>
10
+ <link rel="icon" href="<?js= this.favicon?>" />
11
+ <?js } ?>
12
+
8
13
  <!-- Adding meta -->
9
14
  <?js if(this.meta != undefined) { ?>
10
15
  <?js this.meta.forEach(function(src){ ?>
@@ -66,7 +71,6 @@
66
71
  <link type="text/css" rel="stylesheet" href="styles/third-party/ionicons.min.css">
67
72
  <link type="text/css" rel="stylesheet" href="styles/third-party/prettify-tomorrow.css">
68
73
  <link type="text/css" rel="stylesheet" href="styles/reset.css">
69
- <link type="text/css" rel="stylesheet" href="styles/heading.css">
70
74
  <link type="text/css" rel="stylesheet" href="styles/clean-jsdoc-theme-base.css">
71
75
  <link type="text/css" rel="stylesheet" href="styles/<?js= this.theme ?>">
72
76
  <?js if(this.dynamicStyle != undefined ) { ?>
@@ -122,7 +126,7 @@
122
126
  <script src="scripts/linenumber.js"></script>
123
127
  <script src="scripts/fix-code-block.js"></script>
124
128
  <script src="scripts/fix-navbar.js"></script>
125
- <?js if(!Boolean(this.search.options)) { ?>
129
+ <?js if(this.search.options !== 'false') { ?>
126
130
  <script src="scripts/search.js"></script>
127
131
  <script src="scripts/third-party/fuse.js"></script>
128
132
  <script>
@@ -155,7 +159,6 @@
155
159
  <?js if(this.overlayScrollbar != undefined ) { ?>
156
160
  <script type="text/javascript">
157
161
  var option = JSON.parse('<?js=this.overlayScrollbar ?>')
158
- console.log(option)
159
162
  document.addEventListener("DOMContentLoaded", function () {
160
163
  OverlayScrollbars(document.querySelectorAll('body'), option.option || {});
161
164
  });
@@ -165,4 +168,4 @@
165
168
 
166
169
  </body>
167
170
 
168
- </html>
171
+ </html>