diff --git a/clean-jsdoc-theme-helper.js b/clean-jsdoc-theme-helper.js
index f62ca326..b7ef106a 100644
--- a/clean-jsdoc-theme-helper.js
+++ b/clean-jsdoc-theme-helper.js
@@ -1,25 +1,38 @@
+const has = require('lodash/has');
+const klawSync = require('klaw-sync');
const path = require('path')
-const fs = require('fs')
const fse = require('fs-extra')
const showdown = require('showdown');
-
const mdToHTMLConverter = new showdown.Converter();
+function lsSync(dir, opts = {}) {
+ const depth = has(opts, 'depth') ? opts.depth : -1;
+
+ const files = klawSync(dir, {
+ depthLimit: depth,
+ filter: (f) => !path.basename(f.path).startsWith('.'),
+ nodir: true,
+ });
+
+ return files.map((f) => f.path);
+};
+
function copyToOutputFolder(filePath, outdir) {
- var filePathNormalized = path.normalize(filePath);
+ const resolvedPath = path.resolve(filePath);
+ const filename = path.basename(resolvedPath);
+ const out = path.join(outdir, filename);
- fs.copyFileSync(filePathNormalized, outdir);
+ fse.copyFileSync(resolvedPath, out);
}
function copyToOutputFolderFromArray(filePathArray, outdir) {
- var i = 0;
- var outputList = [];
+ const outputList = [];
if (Array.isArray(filePathArray)) {
- for (; i < filePathArray.length; i++) {
- copyToOutputFolder(filePathArray[i], outdir);
- outputList.push(path.basename(filePathArray[i]));
+ for (const filePath of filePathArray) {
+ copyToOutputFolder(filePath, outdir);
+ outputList.push(path.basename(filePath));
}
}
@@ -119,13 +132,13 @@ function getBaseURL(themeOpts) {
}
function copyStaticFolder(themeOpts, outdir) {
- var staticDir = themeOpts.static_dir || undefined;
+ const staticDir = themeOpts.static_dir || undefined;
if (staticDir) {
- for (var i = 0; i < staticDir.length; i++) {
- var output = path.join(outdir, staticDir[i]);
+ for (const dir of staticDir) {
+ const output = path.join(outdir, dir);
- fse.copySync(staticDir[i], output);
+ fse.copySync(dir, output);
}
}
}
@@ -164,4 +177,5 @@ module.exports = {
returnPathOfStyleSrc,
copyStaticFolder,
getProcessedYield,
+ lsSync
}
\ No newline at end of file
diff --git a/demo/src/assets/png/screen-1.png b/demo/src/assets/png/screen-1.png
new file mode 100644
index 00000000..f0778471
Binary files /dev/null and b/demo/src/assets/png/screen-1.png differ
diff --git a/demo/src/assets/png/screen-2.png b/demo/src/assets/png/screen-2.png
new file mode 100644
index 00000000..06b704a8
Binary files /dev/null and b/demo/src/assets/png/screen-2.png differ
diff --git a/demo/src/assets/png/screen-3.png b/demo/src/assets/png/screen-3.png
new file mode 100644
index 00000000..7aa05214
Binary files /dev/null and b/demo/src/assets/png/screen-3.png differ
diff --git a/demo/src/assets/png/screen-4.png b/demo/src/assets/png/screen-4.png
new file mode 100644
index 00000000..a4090e92
Binary files /dev/null and b/demo/src/assets/png/screen-4.png differ
diff --git a/demo/src/assets/png/screen-5.png b/demo/src/assets/png/screen-5.png
new file mode 100644
index 00000000..ec89e8a8
Binary files /dev/null and b/demo/src/assets/png/screen-5.png differ
diff --git a/demo/src/assets/png/screen-6.png b/demo/src/assets/png/screen-6.png
new file mode 100644
index 00000000..408f3dcd
Binary files /dev/null and b/demo/src/assets/png/screen-6.png differ
diff --git a/demo/src/assets/script.js b/demo/src/assets/script.js
new file mode 100644
index 00000000..15a797dd
--- /dev/null
+++ b/demo/src/assets/script.js
@@ -0,0 +1 @@
+console.log('This is the new very new test script. If it runs then it means it is included.')
\ No newline at end of file
diff --git a/demo/src/assets/style.css b/demo/src/assets/style.css
new file mode 100644
index 00000000..e42db5f8
--- /dev/null
+++ b/demo/src/assets/style.css
@@ -0,0 +1,3 @@
+.test {
+ test-property: 'completed'
+}
\ No newline at end of file
diff --git a/jsdoc-config.json b/jsdoc-config.json
index db5d0a60..aea7450f 100644
--- a/jsdoc-config.json
+++ b/jsdoc-config.json
@@ -3,7 +3,7 @@
"allowUnknownTags": true
},
"source": {
- "include": ["./demo/src", "./README.md", "./static/scripts/core.js"]
+ "include": ["./demo/src", "./README.md"]
},
"plugins": ["plugins/markdown"],
"opts": {
@@ -17,6 +17,11 @@
"search": true,
"homepageTitle": "Clean JSDoc Theme",
"default_theme": "dark",
+ "include_css": ["./demo/src/assets/style.css"],
+ "include_js": ["./demo/src/assets/script.js"],
+ "static_dir": ["./demo/src/assets/png", "./example"],
+ "add_scripts": "function foo(){console.log('foo')} function bar() {console.log('bar')} bar(); foo();",
+ "create_style": ".test-create-style{ background: red}",
"displayModuleHeader": true,
"title": "clean-jsdoc-theme",
"footer": "
clean-jsdoc-theme
Fork: https://github.com/ankitskvmdam/clean-jsdoc-theme",
diff --git a/output/index.html b/output/index.html
deleted file mode 100644
index 8974f79b..00000000
--- a/output/index.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
- Clean jsdoc theme
-
-
-
- Redirecting...
- If fails please visit https://ankdev.me/clean-jsdoc-theme/v4/index.html
-
-
-
-
\ No newline at end of file
diff --git a/output/v4/Alive.html b/output/v4/Alive.html
index 40e8690e..f76360f3 100644
--- a/output/v4/Alive.html
+++ b/output/v4/Alive.html
@@ -1,4 +1,4 @@
-Class: Alivenew Alive()
This is a short summary of the Alive
class. These texts are just acting as filler texts for summary.
Members
NUMBER_ARRAY :Object
energy
Properties
Exampleworld = this.world
function test() {
return world
}
Methods
gameQuery()
Text
Text
code
-
Note that commands are not matched in captions or in the middle of the text.
survive(life) → {Energy}
Parameters:Name | Type | Description |
---|
life | array.<(object|function()|array|number|string|undefined|null|Symbol|boolean|Energy)> | This is an array of many things. |
Returns:the energy wasted in this surviving instance
- Type:
- Energy
\ No newline at end of file
+ new Alive()
This is a short summary of the Alive
class. These texts are just acting as filler texts for summary.
Members
NUMBER_ARRAY :Object
energy
Properties
Exampleworld = this.world
function test() {
return world
}
Methods
gameQuery()
Text
Text
code
+
Note that commands are not matched in captions or in the middle of the text.
survive(life) → {Energy}
Parameters:Name | Type | Description |
---|
life | array.<(object|function()|array|number|string|undefined|null|Symbol|boolean|Energy)> | This is an array of many things. |
Returns:the energy wasted in this surviving instance
- Type:
- Energy