1 | # [doxdox](https://doxdox.org/)
|
2 |
|
3 | > JSDoc to Markdown, Bootstrap, and custom Handlebars template documentation generator.
|
4 |
|
5 | [![Build Status](https://travis-ci.org/neogeek/doxdox.svg?branch=master)](https://travis-ci.org/neogeek/doxdox)
|
6 | [![AppVeyor branch](https://img.shields.io/appveyor/ci/neogeek/doxdox/master.svg)](https://ci.appveyor.com/project/neogeek/doxdox)
|
7 | [![codecov](https://img.shields.io/codecov/c/github/neogeek/doxdox/master.svg)](https://codecov.io/gh/neogeek/doxdox)
|
8 | [![Dependency Status](https://david-dm.org/neogeek/doxdox.svg)](https://david-dm.org/neogeek/doxdox)
|
9 | [![Known Vulnerabilities](https://snyk.io/test/npm/doxdox/badge.svg)](https://snyk.io/test/npm/doxdox)
|
10 | [![bitHound Overall Score](https://www.bithound.io/github/neogeek/doxdox/badges/score.svg)](https://www.bithound.io/github/neogeek/doxdox)
|
11 | [![NPM Version](http://img.shields.io/npm/v/doxdox.svg?style=flat)](https://www.npmjs.org/package/doxdox)
|
12 | [![Greenkeeper badge](https://badges.greenkeeper.io/neogeek/doxdox.svg)](https://greenkeeper.io/)
|
13 | [![Latest Documentation](https://doxdox.org/images/badge-flat.svg)](https://doxdox.org/neogeek/doxdox)
|
14 |
|
15 | doxdox is a simple to use documentation generator that takes JSDoc comment blocks and generates different documentation formats; [Markdown](http://daringfireball.net/projects/markdown/), [Bootstrap](https://v4-alpha.getbootstrap.com/), and custom [Handlebars](http://handlebarsjs.com/>) templates.
|
16 |
|
17 | doxdox also features support for extendability via custom plugins for both parsing and generating documentation.
|
18 |
|
19 | **In**
|
20 |
|
21 | ```javascript
|
22 | /**
|
23 | * Parse array of directory globs and/or files, and then render the parsed data through the defined layout plugin.
|
24 | *
|
25 | * parseInputs(['src/*.js'], {'ignore': [], 'parser': 'dox', 'layout': 'markdown'}).then(content => {});
|
26 | *
|
27 | * @param {Array} inputs Array of directory globs and/or files.
|
28 | * @param {Object} config Configuration object.
|
29 | * @param {String} config.ignore Array of paths to ignore.
|
30 | * @param {String} config.parser String representing the parser to be used.
|
31 | * @param {String} config.layout String representing the layout plugin to be used.
|
32 | * @return {Object} Promise
|
33 | * @public
|
34 | */
|
35 | ```
|
36 |
|
37 | **Out**
|
38 |
|
39 | ![screenshot](screenshot.jpg)
|
40 |
|
41 | _Bootstrap template plugin, included with doxdox_ <https://github.com/neogeek/doxdox-plugin-bootstrap>
|
42 |
|
43 | ## Getting Started
|
44 |
|
45 | The following instructions assume you have already setup JSDoc comment blocks in your codebase. If you have not and would like to learn more about how to use JSDoc, visit <http://usejsdoc.org/>.
|
46 |
|
47 | First install doxdox globally with [NPM](http://npmjs.com/).
|
48 |
|
49 | ```bash
|
50 | $ npm install doxdox -g
|
51 | ```
|
52 |
|
53 | Then, once you have doxdox installed globally (or local to your project, see below), you can start generating documentation. For this example, we will be generating a [Markdown](http://daringfireball.net/projects/markdown/) file and storing it within the project.
|
54 |
|
55 | With a directory structure similar to the example shown below, run the following command to generate a [Markdown](http://daringfireball.net/projects/markdown/) file and output the generated contents to a new file named [`DOCUMENTATION.md`](DOCUMENTATION.md).
|
56 |
|
57 | ```bash
|
58 | $ doxdox 'lib/**/*.js' --layout markdown --output DOCUMENTATION.md
|
59 | ```
|
60 |
|
61 | ```
|
62 | ├─ bin/
|
63 | ├─ coverage/
|
64 | ├─ lib/
|
65 | │ ├─ doxdox.js
|
66 | │ ├─ loaders.js
|
67 | │ └─ utils.js
|
68 | ├─ node_modules/
|
69 | └─ test/
|
70 | ├─ fixtures/
|
71 | └─ specs/
|
72 | ├─ doxdox.js
|
73 | ├─ loaders.js
|
74 | └─ utils.js
|
75 | ```
|
76 |
|
77 | ## Installation
|
78 |
|
79 | doxdox can be installed via either [NPM](http://npmjs.com/) or [Yarn](https://yarnpkg.com/).
|
80 |
|
81 | ```bash
|
82 | $ npm install doxdox -g
|
83 | ```
|
84 |
|
85 | ```bash
|
86 | $ yarn global add doxdox
|
87 | ```
|
88 |
|
89 | ## Usage
|
90 |
|
91 | ### CLI
|
92 |
|
93 | #### Layouts
|
94 |
|
95 | _Markdown_
|
96 |
|
97 | For more information on Markdown visit <http://daringfireball.net/projects/markdown/>.
|
98 |
|
99 | ```bash
|
100 | $ doxdox 'lib/**/*.js' --layout markdown --output DOCUMENTATION.md
|
101 | ```
|
102 |
|
103 | _Bootstrap_
|
104 |
|
105 | Form more information on Bootstrap visit <https://v4-alpha.getbootstrap.com/>.
|
106 |
|
107 | ```bash
|
108 | $ doxdox 'lib/**/*.js' --layout bootstrap --output docs/index.html
|
109 | ```
|
110 |
|
111 | _Custom Handlebars Template_
|
112 |
|
113 | For more information on writing Handlebars templates visit <http://handlebarsjs.com/>.
|
114 |
|
115 | ```bash
|
116 | $ doxdox 'lib/**/*.js' --layout templates/README.hbs --output README.md
|
117 | ```
|
118 |
|
119 | #### Ignore
|
120 |
|
121 | The ignore flag allows you to ignore both directories (with glob syntax) and files. Comma separated values.
|
122 |
|
123 | ```bash
|
124 | $ doxdox './**/*.js' --ignore './coverage/**/*.js'
|
125 | ```
|
126 |
|
127 | See <https://github.com/isaacs/minimatch#usage> for more information on how to use globs.
|
128 |
|
129 | #### Help
|
130 |
|
131 | ```
|
132 | Usage: doxdox <path> ... [options]
|
133 |
|
134 | Options:
|
135 |
|
136 | -h, --help Display this help message.
|
137 | -v, --version Display the current installed version.
|
138 | -d, --description Sets description.
|
139 | -i, --ignore Comma separated list of paths to ignore.
|
140 | -l, --layout Template to render the documentation with.
|
141 | -o, --output File to save documentation to. Defaults to stdout.
|
142 | -p, --package Sets location of package.json file.
|
143 | -t, --title Sets title.
|
144 |
|
145 | Included Layouts:
|
146 |
|
147 | - Markdown (default) (http://daringfireball.net/projects/markdown/)
|
148 | - Bootstrap (http://getbootstrap.com/)
|
149 | - Handlebars (http://handlebarsjs.com/)
|
150 | ```
|
151 |
|
152 | ### NPM Run Scripts
|
153 |
|
154 | For more information on NPM run scripts visit <https://docs.npmjs.com/cli/run-script>.
|
155 |
|
156 | ```bash
|
157 | $ npm install doxdox --save-dev
|
158 | ```
|
159 |
|
160 | ```json
|
161 | {
|
162 | "devDependencies": {
|
163 | "doxdox": "2.0.1"
|
164 | },
|
165 | "scripts": {
|
166 | "docs": "doxdox 'lib/**/*.js' --layout markdown --output DOCUMENTATION.md"
|
167 | }
|
168 | }
|
169 | ```
|
170 |
|
171 | ```bash
|
172 | $ npm run docs
|
173 | ```
|
174 |
|
175 | ### Via JavaScript
|
176 |
|
177 | ```javascript
|
178 | const doxdox = require('doxdox');
|
179 |
|
180 | parseInputs(['lib/**/*.js'], {
|
181 | 'parser': 'dox',
|
182 | 'layout': 'markdown'
|
183 | }).then(content => {
|
184 |
|
185 | process.stdout.write(content);
|
186 |
|
187 | });
|
188 | ```
|
189 |
|
190 | See [documentation](DOCUMENTATION.md) for more information on [`parseInputs`](DOCUMENTATION.md#parseinputsinputs-config).
|
191 |
|
192 | ## Packages
|
193 |
|
194 | ### Core Packages
|
195 |
|
196 | All core packages come pre-installed with doxdox.
|
197 |
|
198 | | Package | Version | Dependencies | Documentation |
|
199 | | ------- | ------- | ------------ | ------------- |
|
200 | | [`doxdox-parser-dox`](https://github.com/neogeek/doxdox-parser-dox) | [![NPM Version](http://img.shields.io/npm/v/doxdox-parser-dox.svg?style=flat)](https://www.npmjs.org/package/doxdox-parser-dox) | [![dependencies Status](https://david-dm.org/neogeek/doxdox-parser-dox/status.svg)](https://david-dm.org/neogeek/doxdox-parser-dox) | [![Latest Documentation](https://doxdox.org/images/badge-flat.svg)](https://doxdox.org/neogeek/doxdox-parser-dox) |
|
201 | | [`doxdox-plugin-bootstrap`](https://github.com/neogeek/doxdox-plugin-bootstrap) | [![NPM Version](http://img.shields.io/npm/v/doxdox-plugin-bootstrap.svg?style=flat)](https://www.npmjs.org/package/doxdox-plugin-bootstrap) | [![dependencies Status](https://david-dm.org/neogeek/doxdox-plugin-bootstrap/status.svg)](https://david-dm.org/neogeek/doxdox-plugin-bootstrap) | [![Latest Documentation](https://doxdox.org/images/badge-flat.svg)](https://doxdox.org/neogeek/doxdox-plugin-bootstrap) |
|
202 | | [`doxdox-plugin-handlebars`](https://github.com/neogeek/doxdox-plugin-handlebars) | [![NPM Version](http://img.shields.io/npm/v/doxdox-plugin-handlebars.svg?style=flat)](https://www.npmjs.org/package/doxdox-plugin-handlebars) | [![dependencies Status](https://david-dm.org/neogeek/doxdox-plugin-handlebars/status.svg)](https://david-dm.org/neogeek/doxdox-plugin-handlebars) | [![Latest Documentation](https://doxdox.org/images/badge-flat.svg)](https://doxdox.org/neogeek/doxdox-plugin-handlebars) |
|
203 | | [`doxdox-plugin-markdown`](https://github.com/neogeek/doxdox-plugin-markdown) | [![NPM Version](http://img.shields.io/npm/v/doxdox-plugin-markdown.svg?style=flat)](https://www.npmjs.org/package/doxdox-plugin-markdown) | [![dependencies Status](https://david-dm.org/neogeek/doxdox-plugin-markdown/status.svg)](https://david-dm.org/neogeek/doxdox-plugin-markdown) | [![Latest Documentation](https://doxdox.org/images/badge-flat.svg)](https://doxdox.org/neogeek/doxdox-plugin-markdown) |
|
204 |
|
205 | - [`doxdox-parser-dox`](https://github.com/neogeek/doxdox-parser-dox) - 🔌 Dox parser plugin for doxdox.
|
206 | - [`doxdox-plugin-bootstrap`](https://github.com/neogeek/doxdox-plugin-bootstrap) - 🔌 Bootstrap template plugin for doxdox.
|
207 | - [`doxdox-plugin-handlebars`](https://github.com/neogeek/doxdox-plugin-handlebars) - 🔌 Custom Handlebars template plugin for doxdox.
|
208 | - [`doxdox-plugin-markdown`](https://github.com/neogeek/doxdox-plugin-markdown) - 🔌 Markdown template plugin for doxdox.
|
209 |
|
210 | ### Other Packages
|
211 |
|
212 | Non-core packages must be installed separately from doxdox.
|
213 |
|
214 | ```bash
|
215 | $ npm install doxdox doxdox-plugin-dash --save-dev
|
216 | ```
|
217 |
|
218 | The, via the `--layout` flag, you specify the plugin name minus `doxdox-plugin-`.
|
219 |
|
220 | | Package | Version | Dependencies | Documentation |
|
221 | | ------- | ------- | ------------ | ------------- |
|
222 | | [`doxdox-plugin-dash`](https://github.com/neogeek/doxdox-plugin-dash) | [![NPM Version](http://img.shields.io/npm/v/doxdox-plugin-dash.svg?style=flat)](https://www.npmjs.org/package/doxdox-plugin-dash) | [![dependencies Status](https://david-dm.org/neogeek/doxdox-plugin-dash/status.svg)](https://david-dm.org/neogeek/doxdox-plugin-dash) | [![Latest Documentation](https://doxdox.org/images/badge-flat.svg)](https://doxdox.org/neogeek/doxdox-plugin-dash) |
|
223 | | [`doxdox-plugin-github-wiki`](https://github.com/neogeek/doxdox-plugin-github-wiki) | [![NPM Version](http://img.shields.io/npm/v/doxdox-plugin-github-wiki.svg?style=flat)](https://www.npmjs.org/package/doxdox-plugin-github-wiki) | [![dependencies Status](https://david-dm.org/neogeek/doxdox-plugin-github-wiki/status.svg)](https://david-dm.org/neogeek/doxdox-plugin-github-wiki) | [![Latest Documentation](https://doxdox.org/images/badge-flat.svg)](https://doxdox.org/neogeek/doxdox-plugin-github-wiki) |
|
224 | | [`grunt-doxdox`](https://github.com/neogeek/grunt-doxdox) | [![NPM Version](http://img.shields.io/npm/v/grunt-doxdox.svg?style=flat)](https://www.npmjs.org/package/grunt-doxdox) | [![dependencies Status](https://david-dm.org/neogeek/grunt-doxdox/status.svg)](https://david-dm.org/neogeek/grunt-doxdox) | |
|
225 |
|
226 | - [`doxdox-plugin-dash`](https://github.com/neogeek/doxdox-plugin-dash) - 🔌 Dash export plugin for doxdox.
|
227 | - [`doxdox-plugin-github-wiki`](https://github.com/neogeek/doxdox-plugin-github-wiki) - 🔌 GitHub wiki export plugin for doxdox.
|
228 | - [`grunt-doxdox`](https://github.com/neogeek/grunt-doxdox) - Grunt plugin for doxdox.
|
229 |
|
230 | ## Questions
|
231 |
|
232 | If you have any questions regarding the use of doxdox, please use either the [Gitter](https://gitter.im/neogeek/doxdox) chat room or [Stack Overflow](http://stackoverflow.com/questions/ask?tags=doxdox). The issue tracker is to be used for bug reports and feature requests only.
|
233 |
|
234 | ## Contributing
|
235 |
|
236 | Be sure to review the [Contributing Guidelines](CONTRIBUTING.md) before logging an issue or making a pull request.
|
237 |
|
238 | ## License
|
239 |
|
240 | [MIT](LICENSE)
|