documentation
Version:
a documentation generator
33 lines (26 loc) • 1.19 kB
Markdown
Documentation.js supports customizable themes for HTML output. A theme is a Node.js
module that exports a single function with the following signature:
```
/**
* @function
* @param {Array<Object>} comments - an array of comments to be output
* @param {Object} options - theme options
* @param {ThemeCallback} callback - see below
*/
/**
* @callback ThemeCallback
* @param {?Error} error
* @param {?Array<vinyl.File>} output
*/
```
The theme function should call the callback with either an error, if one occurs,
or an array of [vinyl](https://github.com/gulpjs/vinyl) `File` objects.
The theme is free to implement HTML generation however it chooses. See
[the default theme](https://github.com/documentationjs/documentation/tree/master/src/default_theme)
for some ideas.
### Theming Markdown
The default Markdown generator for documentation.js isn't customizable - instead
of a plain-text theme, it's generated by creating an AST and then rendering
it with [remark](http://remark.js.org/). If you need something extra in Markdown,
you can either rally for that thing to be included in the default theme,
or you can hack around it by using an HTML theme that outputs Markdown.