clean-jsdoc-theme 4.1.10 → 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 +2 -2
- package/clean-jsdoc-theme-defaults.js +37 -0
- package/clean-jsdoc-theme-helper.js +167 -0
- package/package.json +54 -51
- package/publish.js +281 -431
- package/tmpl/container.tmpl +21 -10
- package/tmpl/method.tmpl +19 -0
- package/tmpl/params.tmpl +8 -1
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:
|
|
@@ -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/package.json
CHANGED
|
@@ -1,53 +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
|
-
|
|
52
|
-
|
|
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
|
+
}
|
|
53
56
|
}
|