https://github.com/prtksxna/jsdoc-class-hierarchy
JSDoc plugin to add class hierarchy data
https://github.com/prtksxna/jsdoc-class-hierarchy
jsdoc jsdoc-plugin jsdoc3
Last synced: 4 months ago
JSON representation
JSDoc plugin to add class hierarchy data
- Host: GitHub
- URL: https://github.com/prtksxna/jsdoc-class-hierarchy
- Owner: prtksxna
- License: mit
- Created: 2018-07-11T06:50:05.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-04-25T11:57:50.000Z (about 2 years ago)
- Last Synced: 2025-02-12T14:15:15.923Z (over 1 year ago)
- Topics: jsdoc, jsdoc-plugin, jsdoc3
- Language: JavaScript
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jsdoc-class-hierarchy
[JSDoc](http://usejsdoc.org/) plugin to add class hierarchy data, and optionally
an HTML list representation of the same.
It uses the `newDoclet` and `processingComplete` events given by JSDoc, and
reads the `augments` property in the doclets. This is added when the `@extends`
tag is used.
## Install
Install using [npm](https://www.npmjs.com/package/jsdoc-class-hierarchy):
```
npm install jsdoc-class-hierarchy --save-dev
```
Add to the plugins in your JSDoc config:
```json
{
"plugins": [
"node_modules/jsdoc-class-hierarchy"
]
}
```
## Configuration
Name|Type|Description
--|--|--
`showList` | **boolean** | Whether or not to show an HTML list of the children classes and hierarchy.
Defaults to `false`.
## Usage
If you use the plugin with `showList` enabled you automatically get a styled
HTML list in your class description. This is is the easiest way of using the
plugin:
```json
{
"plugins": [
"node_modules/jsdoc-class-hierarchy"
],
"opts": {
"class-hierarchy": { "showList": true }
}
}
```
It will result in something like this:

If you don't like this display you can update your theme to show this data
however you like. Doclets of classes that have subclasses will have a
`children` key. All classes that are subclasses of another class will have the
`hierarchy` key. Both are arrays of strings, with the class on top of the
hierarchy being the first one.
For example:
```javascript
doclet.children = [ 'OO.ui.ToolGroup', 'OO.ui.Tool' ];
doclet.hierarchy = [ 'OO.ui.Element', 'OO.ui.Widget' ];
```