Use the following command in the root directory of the project
npx jsdoc -c jsdoc.config.json
Afterwards the generated HTML files are in ./jsdoc/output_html
. You can open the index.html
to see the JSDoc documentation.
To configure JSDoc change the jsdoc.config.json
file.
The sidebar is divided into categories, if a category has been added by tag or jsdoc.conf.json
.
Use the @category categoryname
tag.
Example:
/**
* @module @proceed/core
* @category universal
*/
The module @proceed/core will be under the universal category in the sidebar.
Use the categoryByPath
option in jsdoc.conf.json
.
Example:
"opts": {
"categoryByPath": {
"universal": "modules"
},
The sidebar links for code in the modules folder will be under the universal part of the sidebar. The category is only assigned automatically if there isn't a @category tag already.
To add categories the categories
plugin has to be added in jsdoc.conf.json
"plugins": [
"./jsdoc_changes/template/plugins/categories.js"
If there are elements in the sidebar without a category they will be under the root scope part, the last part in the sidebar (if non-categorized elements exist). The title can be changed in the jsdoc.conf.json
options:
"opts": {
"noCategoryTitle": "root scope",
Class links are appended to their modules in the sidebar. For it to work classes need to reference their modules with @memberof module:modulename
Example:
/**
* @memberof module:@proceed/core
*/
class ProceedEngine {
/**
* constructor description
*/
functions, members or constants that have a JSDOC comment and are not inside a class and have no @memberof
tag will show up under Global in the sidebar.
With @memberof module:modulename
or @memberof module:modulename.classname
the information can be moved to the module or class page so the link won't show up under Global anymore. For example if the Global link was a function, you will find it under Methods on the module page if you tagged it as member of the module.
To make all functions in a file(module) a member of that module, add a separate comment to the beginning of the file with /*_ @module name _/
. This will actually add all file content as a member to the module name.
The module has to be a member of the 'parent' module. The parent module can already be a member of another module. For example:
/**
* @module rotation
* @memberof module:@proceed/machine.module:logging
*/
will show in the navigation bar as
- JS-Types link to their MDN page (example: String)
- Link names of Module Classes only contain the Class name (example: 'Management' instead of 'module:@proceed/core.Management')
Path to the changed publish.js
"opts": {
"template": "./jsdoc_changes/template"
Files to include (script and css)
"templates": {
"default": {
"layoutFile":"./jsdoc_changes/template/tmpl/mlayout.tmpl",
"staticFiles":{
"include": ["./jsdoc_changes/template/static/"]
}
},
"css": ["styles/mstyle.css"]