clean-jsdoc-theme
Advanced tools
Comparing version 2.2.15 to 3.0.0
@@ -26,4 +26,6 @@ { | ||
"meta": [ | ||
"<meta name=\"author\" content=\"Ankit Kumar\">", | ||
"<meta name=\"description\" content=\"A beautifully crafted theme/template for JSDoc 3.\">" | ||
{ | ||
"name": "Author", | ||
"content": "Ankit Kumar" | ||
} | ||
] | ||
@@ -30,0 +32,0 @@ } |
{ | ||
"name": "clean-jsdoc-theme", | ||
"version": "2.2.15", | ||
"version": "3.0.0", | ||
"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.", | ||
@@ -42,3 +42,7 @@ "main": "publish.js", | ||
"stylelint-scss": "^3.18.0" | ||
}, | ||
"dependencies": { | ||
"copy-dir": "^1.3.0", | ||
"fs-extra": "^9.0.1" | ||
} | ||
} |
@@ -11,2 +11,3 @@ /* global env: true */ | ||
var util = require('util'); | ||
var fse = require('fs-extra'); | ||
@@ -25,2 +26,39 @@ var htmlsafe = helper.htmlsafe; | ||
function copyStaticFolder() { | ||
/* prettier-ignore-start */ | ||
// eslint-disable-next-line | ||
var staticDir = env && env.opts && env.opts['theme_opts'] && env.opts['theme_opts']['static_dir'] || undefined; | ||
/* prettier-ignore-end */ | ||
if (staticDir) { | ||
for (var i = 0; i < staticDir.length; i++) { | ||
var output = path.join(outdir, staticDir[i]); | ||
fse.copySync(staticDir[i], output); | ||
} | ||
} | ||
} | ||
copyStaticFolder(); | ||
function copyToOutputFolder(filePath) { | ||
var filePathNormalized = path.normalize(filePath); | ||
fs.copyFileSync(filePathNormalized, outdir); | ||
} | ||
function copyToOutputFolderFromArray(filePathArray) { | ||
var i = 0; | ||
var outputList = []; | ||
if (Array.isArray(filePathArray)) { | ||
for (; i < filePathArray.length; i++) { | ||
copyToOutputFolder(filePathArray[i]); | ||
outputList.push(path.basename(filePathArray[i])); | ||
} | ||
} | ||
return outputList; | ||
} | ||
function find(spec) { | ||
@@ -333,2 +371,3 @@ return helper.find(data, spec); | ||
// function copy | ||
function createDynamicStyleSheet() { | ||
@@ -356,4 +395,4 @@ /* prettier-ignore-start */ | ||
var scriptPath = env && env.opts && env.opts['theme_opts'] && env.opts['theme_opts']['add_script_path'] || undefined; | ||
/* prettier-ignore-end */ | ||
return scriptPath; | ||
@@ -366,7 +405,46 @@ } | ||
var stylePath = env && env.opts && env.opts['theme_opts'] && env.opts['theme_opts']['add_style_path'] || undefined; | ||
/* prettier-ignore-end */ | ||
return stylePath; | ||
} | ||
function includeCss() { | ||
/* prettier-ignore-start */ | ||
// eslint-disable-next-line | ||
var stylePath = env && env.opts && env.opts['theme_opts'] && env.opts['theme_opts']['include_css'] || undefined; | ||
if (stylePath) { | ||
stylePath = copyToOutputFolderFromArray(stylePath); | ||
} | ||
/* prettier-ignore-end */ | ||
return stylePath; | ||
} | ||
function overlayScrollbarOptions() { | ||
/* prettier-ignore-start */ | ||
// eslint-disable-next-line | ||
var overlayOptions = env && env.opts && env.opts['theme_opts'] && env.opts['theme_opts']['overlay_scrollbar'] || undefined; | ||
if (overlayOptions) { | ||
return JSON.stringify(overlayOptions); | ||
} | ||
/* prettier-ignore-end */ | ||
return undefined; | ||
} | ||
function includeScript() { | ||
/* prettier-ignore-start */ | ||
// eslint-disable-next-line | ||
var scriptPath = env && env.opts && env.opts['theme_opts'] && env.opts['theme_opts']['include_js'] || undefined; | ||
if (scriptPath) { | ||
scriptPath = copyToOutputFolderFromArray(scriptPath); | ||
} | ||
/* prettier-ignore-end */ | ||
return scriptPath; | ||
} | ||
function getMetaTagData() { | ||
@@ -744,3 +822,6 @@ /* prettier-ignore-start */ | ||
view.dynamicScriptSrc = returnPathOfScriptScr(); | ||
view.includeScript = includeScript(); | ||
view.includeCss = includeCss(); | ||
view.meta = getMetaTagData(); | ||
view.overlayScrollbar = overlayScrollbarOptions(); | ||
view.theme = getTheme(); | ||
@@ -747,0 +828,0 @@ // once for all |
# clean-jsdoc-theme | ||
[![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-2.2.15-%23007bff) [![Issues Open](https://img.shields.io/github/issues/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/issues) [![Isses Closed](https://img.shields.io/github/issues-closed/ankitskvmdam/clean-jsdoc-theme?color=%234caf50)](https://github.com/ankitskvmdam/clean-jsdoc-theme/issues?q=is%3Aissue+is%3Aclosed) [![Contributors](https://img.shields.io/github/contributors/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/graphs/contributors) [![npm downloads](https://img.shields.io/npm/dt/clean-jsdoc-theme)](https://www.npmjs.com/package/clean-jsdoc-theme) [![Build Status](https://travis-ci.org/ankitskvmdam/clean-jsdoc-theme.svg?branch=production)](https://travis-ci.org/ankitskvmdam/clean-jsdoc-theme) [![lisence](https://img.shields.io/github/license/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/master/LICENSE) [![Website Of/ficial](https://img.shields.io/website?up_message=official&url=https%3A%2F%2Fankdev.me%2Fclean-jsdoc-theme)](https://ankdev.me/clean-jsdoc-theme/index.html) [![Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-hindi-%23007bff)](https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/master/CODE_OF_CONDUCT_HINDI.md) [![Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-english-%234caf50)](https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/master/CODE_OF_CONDUCT.md) | ||
[![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.0.0-%23007bff) [![Issues Open](https://img.shields.io/github/issues/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/issues) [![Isses Closed](https://img.shields.io/github/issues-closed/ankitskvmdam/clean-jsdoc-theme?color=%234caf50)](https://github.com/ankitskvmdam/clean-jsdoc-theme/issues?q=is%3Aissue+is%3Aclosed) [![Contributors](https://img.shields.io/github/contributors/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/graphs/contributors) [![npm downloads](https://img.shields.io/npm/dt/clean-jsdoc-theme)](https://www.npmjs.com/package/clean-jsdoc-theme) [![Build Status](https://travis-ci.org/ankitskvmdam/clean-jsdoc-theme.svg?branch=production)](https://travis-ci.org/ankitskvmdam/clean-jsdoc-theme) [![lisence](https://img.shields.io/github/license/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/master/LICENSE) [![Website Of/ficial](https://img.shields.io/website?up_message=official&url=https%3A%2F%2Fankdev.me%2Fclean-jsdoc-theme)](https://ankdev.me/clean-jsdoc-theme/index.html) [![Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-hindi-%23007bff)](https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/master/CODE_OF_CONDUCT_HINDI.md) [![Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-english-%234caf50)](https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/master/CODE_OF_CONDUCT.md) | ||
<br> | ||
@@ -132,4 +132,10 @@ 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 (for more look below in <a href="#features">feature section</a>).<br> | ||
"meta": [ | ||
"<meta name=\"author\" content=\"Ankit Kumar\">", | ||
"<meta name=\"description\" content=\"Best Clean and minimal JSDoc 3 Template / Theme\">" | ||
{ | ||
"name": "author", | ||
"content": "Ankit Kumar" | ||
}, | ||
{ | ||
"name": "description", | ||
"content": "Best Clean and minimal JSDoc 3 Template/Theme" | ||
} | ||
], | ||
@@ -141,4 +147,12 @@ | ||
"create_style": "nav{background: yellow}", // This will change the background color of sidebar. | ||
//You can add path of your style file. Note it must be relative to your output file. (relative to generated html files.) | ||
"add_style_path": ["../custom.css"], // Pass array of path or url | ||
// Use this option to add third party css library | ||
// Note: You have to pass an array of object, and object keys are actually the attributes which you want | ||
// in you link tag. | ||
"add_style_path": [ | ||
{ | ||
"href": "https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css", | ||
"integrity": "sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1", | ||
"crossorigin": "anonymous" | ||
} | ||
], | ||
@@ -148,10 +162,53 @@ // You can add custom script to html | ||
// You can add path of your script file. Note it must be relative to your output file. (relative to generated html files.) | ||
"add_script_path": ["../custom.js"], // Pass array of path or url | ||
// Use this option to add third party js library | ||
// Note: You have to pass an array of object, and object keys are actually the attributes which you want | ||
// in you script tag. | ||
"add_script_path": [ | ||
{ | ||
"src": "https://code.jquery.com/jquery-3.5.1.js", | ||
"integrity": "sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc=", | ||
"crossorigin": "anonymous" | ||
} | ||
], | ||
"footer": "This is footer", // Here again you can pass html element | ||
// Path should be relative to jsdoc configuration file. | ||
// Path to static dir which you want to copy to output dir | ||
"static_dir": ["./static"], | ||
// Include css files | ||
// Note: You are not required to manually copy file to output dir | ||
"include_css_files": ["./static/index.css", "./src/docs/index.css"], | ||
// Include js files | ||
// Note: You are not required to manually copy file to output dir | ||
"include_js_files": ["./static/main.js", "./third-party/test/index.js"], | ||
// Include overlay scrollbar | ||
"overlay_scrollbar": { | ||
"options": { | ||
// ...overlay options | ||
// If you want default then pass empty object | ||
} | ||
} | ||
} | ||
``` | ||
## In version 3.0.0 | ||
### New | ||
1. Add an option to include css files. | ||
1. Add an option to add js. | ||
1. Add an option to include static folder. | ||
1. OverlayScrollbar are now supported by default. If you don't want to use it pass an option to disable it. | ||
### Breaking changes | ||
1. `add_script_path` previously you have to pass an string of array but now you have to pass an object where keys are the attributes of the script tag | ||
1. `add_style_path` previously you have to pass an string of array but now you have to pass an object where keys are the attributes of the link tag | ||
1. `meta` previously you have to pass an string of array but now you have to pass an object where keys are the attributes of the meta tag | ||
## In version 2.2.15 | ||
@@ -158,0 +215,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
638258
56
2548
267
3
1
+ Addedcopy-dir@^1.3.0
+ Addedfs-extra@^9.0.1
+ Addedat-least-node@1.0.0(transitive)
+ Addedcopy-dir@1.3.0(transitive)
+ Addedfs-extra@9.1.0(transitive)
+ Addedjsonfile@6.1.0(transitive)
+ Addeduniversalify@2.0.1(transitive)