clean-jsdoc-theme 4.1.9 → 4.1.11
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 +23 -22
- package/clean-jsdoc-theme-defaults.js +37 -0
- package/clean-jsdoc-theme-helper.js +167 -0
- package/jsdoc-config.json +1 -0
- package/package.json +54 -50
- package/publish.js +295 -421
- package/static/scripts/core.min.js +22 -22
- package/tmpl/container.tmpl +26 -10
- package/tmpl/method.tmpl +19 -0
- package/tmpl/params.tmpl +8 -1
- package/tmpl/type.tmpl +5 -4
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# clean-jsdoc-theme
|
|
2
2
|
|
|
3
|
-
[](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)
|
|
4
4
|
<br>
|
|
5
5
|
|
|
6
|
-
`clean-jsdoc-theme` is a beautifully crafted theme for JSDoc 3. It is a clean and fully responsive theme with loads of
|
|
6
|
+
`clean-jsdoc-theme` is a beautifully crafted theme for JSDoc 3/JSDoc 4. It is a clean and fully responsive theme with loads of
|
|
7
7
|
customisation features.
|
|
8
8
|
|
|
9
9
|
Some salient features:
|
|
@@ -424,26 +424,27 @@ This will remove all symbols (members, methods ...) that come from inherited par
|
|
|
424
424
|
|
|
425
425
|
## Cheat sheet
|
|
426
426
|
|
|
427
|
-
| name
|
|
428
|
-
|
|
|
429
|
-
| `default_theme`
|
|
430
|
-
| `homepageTitle`
|
|
431
|
-
| `title`
|
|
432
|
-
| `base_url`
|
|
433
|
-
| `menu`
|
|
434
|
-
| `meta`
|
|
435
|
-
| `search`
|
|
436
|
-
| `codepen`
|
|
437
|
-
| `static_dir`
|
|
438
|
-
| `create_style`
|
|
439
|
-
| `add_style_path`
|
|
440
|
-
| `include_css`
|
|
441
|
-
| `add_scripts`
|
|
442
|
-
| `add_script_path`
|
|
443
|
-
| `include_js`
|
|
444
|
-
| `footer`
|
|
445
|
-
| `exclude_inherited`
|
|
446
|
-
| `sections`
|
|
427
|
+
| name | default | use case | expected value(s) |
|
|
428
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- | --------------------- |
|
|
429
|
+
| `default_theme` | `"dark"` | To set the default theme | `"light" or "dark"` |
|
|
430
|
+
| `homepageTitle` | "Home" | To set the title of homepage | `string` |
|
|
431
|
+
| `title` | `null` | To set the title | `HTML` or `string` |
|
|
432
|
+
| `base_url` | `/` | To set the base URL | `string` |
|
|
433
|
+
| `menu` | `null` | To render extra link in navbar | Array of Object(s) |
|
|
434
|
+
| `meta` | `null` | Meta tag attributes | Array of Object(s) |
|
|
435
|
+
| `search` | `true` | To render search or not | `true` or `false` |
|
|
436
|
+
| `codepen` | `{}` | To open code in codepen | `Object` |
|
|
437
|
+
| `static_dir` | `null` | To include static dir | Array of string |
|
|
438
|
+
| `create_style` | `null` | To create custom style rules | `string` |
|
|
439
|
+
| `add_style_path` | `null` | To add external css libraries/files | Array of Object(s) |
|
|
440
|
+
| `include_css` | `null` | To include css files | Array of string |
|
|
441
|
+
| `add_scripts` | `null` | To create custom script | `string` |
|
|
442
|
+
| `add_script_path` | `null` | To add external js libraries/files | Array of Object(s) |
|
|
443
|
+
| `include_js` | `null` | To include js files | `string` |
|
|
444
|
+
| `footer` | `null` | To render footer | `HTML` or `string` |
|
|
445
|
+
| `exclude_inherited` | `false` | To exclude inherited symbols | `boolean` |
|
|
446
|
+
| `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>` |
|
|
447
|
+
| `displayModuleHeader` | `false` | If you want the module name to appear on its page | `boolean` |
|
|
447
448
|
|
|
448
449
|
Don't forget to add the following in your jsdoc config file, otherwise toc will not work on some pages.
|
|
449
450
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const SECTION_TYPE = {
|
|
2
|
+
Classes: 'Classes',
|
|
3
|
+
Modules: 'Modules',
|
|
4
|
+
Externals: 'Externals',
|
|
5
|
+
Events: 'Events',
|
|
6
|
+
Namespaces: 'Namespaces',
|
|
7
|
+
Mixins: 'Mixins',
|
|
8
|
+
Tutorials: 'Tutorials',
|
|
9
|
+
Interfaces: 'Interfaces',
|
|
10
|
+
Global: 'Global',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const defaultSections = [
|
|
14
|
+
SECTION_TYPE.Modules,
|
|
15
|
+
SECTION_TYPE.Classes,
|
|
16
|
+
SECTION_TYPE.Externals,
|
|
17
|
+
SECTION_TYPE.Events,
|
|
18
|
+
SECTION_TYPE.Namespaces,
|
|
19
|
+
SECTION_TYPE.Mixins,
|
|
20
|
+
SECTION_TYPE.Tutorials,
|
|
21
|
+
SECTION_TYPE.Interfaces,
|
|
22
|
+
SECTION_TYPE.Global,
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
const HTML_MINIFY_OPTIONS = {
|
|
26
|
+
collapseWhitespace: true,
|
|
27
|
+
removeComments: true,
|
|
28
|
+
html5: true,
|
|
29
|
+
minifyJS: true,
|
|
30
|
+
minifyCSS: true,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
module.exports = {
|
|
34
|
+
HTML_MINIFY_OPTIONS,
|
|
35
|
+
SECTION_TYPE,
|
|
36
|
+
defaultSections
|
|
37
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
const path = require('path')
|
|
2
|
+
const fs = require('fs')
|
|
3
|
+
const fse = require('fs-extra')
|
|
4
|
+
const showdown = require('showdown');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const mdToHTMLConverter = new showdown.Converter();
|
|
8
|
+
|
|
9
|
+
function copyToOutputFolder(filePath, outdir) {
|
|
10
|
+
var filePathNormalized = path.normalize(filePath);
|
|
11
|
+
|
|
12
|
+
fs.copyFileSync(filePathNormalized, outdir);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function copyToOutputFolderFromArray(filePathArray, outdir) {
|
|
16
|
+
var i = 0;
|
|
17
|
+
var outputList = [];
|
|
18
|
+
|
|
19
|
+
if (Array.isArray(filePathArray)) {
|
|
20
|
+
for (; i < filePathArray.length; i++) {
|
|
21
|
+
copyToOutputFolder(filePathArray[i], outdir);
|
|
22
|
+
outputList.push(path.basename(filePathArray[i]));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return outputList;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function buildFooter(themeOpts) {
|
|
30
|
+
var footer = themeOpts.footer;
|
|
31
|
+
|
|
32
|
+
return footer;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function moduleHeader(themeOpts) {
|
|
36
|
+
var displayModuleHeader = themeOpts.displayModuleHeader || false;
|
|
37
|
+
|
|
38
|
+
return displayModuleHeader;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function getFavicon(themeOpts) {
|
|
42
|
+
var favicon = themeOpts.favicon || undefined;
|
|
43
|
+
|
|
44
|
+
return favicon;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// function copy
|
|
48
|
+
function createDynamicStyleSheet(themeOpts) {
|
|
49
|
+
var styleClass = themeOpts.create_style || undefined;
|
|
50
|
+
/* prettier-ignore-start */
|
|
51
|
+
|
|
52
|
+
return styleClass;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function createDynamicsScripts(themeOpts) {
|
|
56
|
+
var scripts = themeOpts.add_scripts || undefined;
|
|
57
|
+
|
|
58
|
+
return scripts;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function returnPathOfScriptScr(themeOpts) {
|
|
62
|
+
var scriptPath = themeOpts.add_script_path || undefined;
|
|
63
|
+
|
|
64
|
+
return scriptPath;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function returnPathOfStyleSrc(themeOpts) {
|
|
68
|
+
var stylePath = themeOpts.add_style_path || undefined;
|
|
69
|
+
|
|
70
|
+
return stylePath;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function includeCss(themeOpts, outdir) {
|
|
74
|
+
var stylePath = themeOpts.include_css || undefined;
|
|
75
|
+
|
|
76
|
+
if (stylePath) {
|
|
77
|
+
stylePath = copyToOutputFolderFromArray(stylePath, outdir);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return stylePath;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function resizeable(themeOpts) {
|
|
84
|
+
var resizeOpts = themeOpts.resizeable || {};
|
|
85
|
+
|
|
86
|
+
return resizeOpts;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function codepen(themeOpts) {
|
|
90
|
+
var codepenOpts = themeOpts.codepen || {};
|
|
91
|
+
|
|
92
|
+
return codepenOpts;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function includeScript(themeOpts, outdir) {
|
|
96
|
+
var scriptPath = themeOpts.include_js || undefined;
|
|
97
|
+
|
|
98
|
+
if (scriptPath) {
|
|
99
|
+
scriptPath = copyToOutputFolderFromArray(scriptPath, outdir);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return scriptPath;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function getMetaTagData(themeOpts) {
|
|
106
|
+
var meta = themeOpts.meta || undefined;
|
|
107
|
+
|
|
108
|
+
return meta;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function getTheme(themeOpts) {
|
|
112
|
+
var theme = themeOpts.default_theme || 'dark';
|
|
113
|
+
|
|
114
|
+
return theme;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function getBaseURL(themeOpts) {
|
|
118
|
+
return themeOpts.base_url;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function copyStaticFolder(themeOpts, outdir) {
|
|
122
|
+
var staticDir = themeOpts.static_dir || undefined;
|
|
123
|
+
|
|
124
|
+
if (staticDir) {
|
|
125
|
+
for (var i = 0; i < staticDir.length; i++) {
|
|
126
|
+
var output = path.join(outdir, staticDir[i]);
|
|
127
|
+
|
|
128
|
+
fse.copySync(staticDir[i], output);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Currently for some reason yields markdown is
|
|
135
|
+
* not processed by jsdoc. So, we are processing it here
|
|
136
|
+
*
|
|
137
|
+
* @param {Array<{type: string, description: string}>} yields
|
|
138
|
+
*/
|
|
139
|
+
function getProcessedYield(yields) {
|
|
140
|
+
if (!Array.isArray(yields)) return [];
|
|
141
|
+
|
|
142
|
+
return yields.map((y) => ({
|
|
143
|
+
...y,
|
|
144
|
+
description: mdToHTMLConverter.makeHtml(y.description),
|
|
145
|
+
}));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
module.exports = {
|
|
151
|
+
buildFooter,
|
|
152
|
+
moduleHeader,
|
|
153
|
+
codepen,
|
|
154
|
+
createDynamicStyleSheet,
|
|
155
|
+
createDynamicsScripts,
|
|
156
|
+
getBaseURL,
|
|
157
|
+
getFavicon,
|
|
158
|
+
getMetaTagData,
|
|
159
|
+
getTheme,
|
|
160
|
+
includeCss,
|
|
161
|
+
includeScript,
|
|
162
|
+
resizeable,
|
|
163
|
+
returnPathOfScriptScr,
|
|
164
|
+
returnPathOfStyleSrc,
|
|
165
|
+
copyStaticFolder,
|
|
166
|
+
getProcessedYield,
|
|
167
|
+
}
|
package/jsdoc-config.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"search": true,
|
|
17
17
|
"homepageTitle": "Clean JSDoc Theme",
|
|
18
18
|
"default_theme": "dark",
|
|
19
|
+
"displayModuleHeader": true,
|
|
19
20
|
"title": "clean-jsdoc-theme",
|
|
20
21
|
"footer": "<div style='margin-bottom: 0.5rem;'>clean-jsdoc-theme</div> Fork: <a href='https://github.com/ankitskvmdam/clean-jsdoc-theme'>https://github.com/ankitskvmdam/clean-jsdoc-theme</a>",
|
|
21
22
|
"meta": [
|
package/package.json
CHANGED
|
@@ -1,52 +1,56 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
2
|
+
"name": "clean-jsdoc-theme",
|
|
3
|
+
"version": "4.1.11",
|
|
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
|
+
"main": "publish.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "node minify.js && node node_modules/jsdoc/jsdoc.js -c jsdoc-config.json",
|
|
8
|
+
"lint:js": "eslint . --ext .js --fix",
|
|
9
|
+
"lint:style": "stylelint-config-prettier-check && stylelint static/styles/",
|
|
10
|
+
"lint": "npm run lint:js && npm run lint:style"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/ankitskvmdam/clean-jsdoc-theme.git"
|
|
15
|
+
},
|
|
16
|
+
"author": "Ank",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/ankitskvmdam/clean-jsdoc-theme/issues"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://ankdev.me/clean-jsdoc-theme/v4/index.html",
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"jsdoc": "[3, 4]"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"jsdoc",
|
|
27
|
+
"template",
|
|
28
|
+
"jsdoc-template",
|
|
29
|
+
"javascript documentation",
|
|
30
|
+
"customizable jsdoc theme / template"
|
|
31
|
+
],
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@jsdoc/eslint-config": "^1.1.6",
|
|
34
|
+
"concurrently": "^7.2.2",
|
|
35
|
+
"csso": "^5.0.3",
|
|
36
|
+
"eslint": "^8.19.0",
|
|
37
|
+
"eslint-config-prettier": "^8.5.0",
|
|
38
|
+
"prettier": "^2.2.1",
|
|
39
|
+
"stylelint": "^14.9.1",
|
|
40
|
+
"stylelint-config-prettier": "^9.0.3",
|
|
41
|
+
"stylelint-config-sass-guidelines": "^9.0.0",
|
|
42
|
+
"stylelint-config-standard": "^26.0.0",
|
|
43
|
+
"stylelint-order": "^5.0.0",
|
|
44
|
+
"stylelint-scss": "^4.2.0",
|
|
45
|
+
"uglify-js": "^3.16.0"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@jsdoc/salty": "^0.2.2",
|
|
49
|
+
"common-path-prefix": "^3.0.0",
|
|
50
|
+
"fs-extra": "^10.1.0",
|
|
51
|
+
"html-minifier": "^4.0.0",
|
|
52
|
+
"lodash": "^4.17.21",
|
|
53
|
+
"nanoid": "^3.3.4",
|
|
54
|
+
"showdown": "^2.1.0"
|
|
55
|
+
}
|
|
52
56
|
}
|