clean-jsdoc-theme 3.2.8 → 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/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.8-%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:
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "clean-jsdoc-theme",
3
- "version": "3.2.8",
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;
@@ -829,6 +835,7 @@ exports.publish = function(taffyData, opts, tutorials) {
829
835
  view.htmlsafe = htmlsafe;
830
836
  view.outputSourceFiles = outputSourceFiles;
831
837
  view.footer = buildFooter();
838
+ view.favicon = getFavicon();
832
839
  view.dynamicStyle = createDynamicStyleSheet();
833
840
  view.dynamicStyleSrc = returnPathOfStyleSrc();
834
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)
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){ ?>
@@ -154,7 +159,6 @@
154
159
  <?js if(this.overlayScrollbar != undefined ) { ?>
155
160
  <script type="text/javascript">
156
161
  var option = JSON.parse('<?js=this.overlayScrollbar ?>')
157
- console.log(option)
158
162
  document.addEventListener("DOMContentLoaded", function () {
159
163
  OverlayScrollbars(document.querySelectorAll('body'), option.option || {});
160
164
  });