Code Monkey home page Code Monkey logo

doxdox's Introduction

doxdox

JSDoc to Markdown, Bootstrap, and custom Handlebars template documentation generator.

Build Status AppVeyor branch codecov Dependency Status Known Vulnerabilities bitHound Overall Score NPM Version Greenkeeper badge Latest Documentation

doxdox is a simple to use documentation generator that takes JSDoc comment blocks and generates different documentation formats; Markdown, Bootstrap, and custom Handlebars templates.

doxdox also features support for extendability via custom plugins for both parsing and generating documentation.

In

/**
 * Parse array of directory globs and/or files, and then render the parsed data through the defined layout plugin.
 *
 *     parseInputs(['src/*.js'], {'ignore': [], 'parser': 'dox', 'layout': 'markdown'}).then(content => {});
 *
 * @param {Array} inputs Array of directory globs and/or files.
 * @param {Object} config Configuration object.
 * @param {String} config.ignore Array of paths to ignore.
 * @param {String} config.parser String representing the parser to be used.
 * @param {String} config.layout String representing the layout plugin to be used.
 * @return {Object} Promise
 * @public
 */

Out

screenshot

Bootstrap template plugin, included with doxdox https://github.com/neogeek/doxdox-plugin-bootstrap

Getting Started

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/.

First install doxdox globally with NPM.

$ npm install doxdox -g

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 file and storing it within the project.

With a directory structure similar to the example shown below, run the following command to generate a Markdown file and output the generated contents to a new file named DOCUMENTATION.md.

$ doxdox 'lib/**/*.js' --layout markdown --output DOCUMENTATION.md
โ”œโ”€ bin/
โ”œโ”€ coverage/
โ”œโ”€ lib/
โ”‚   โ”œโ”€ doxdox.js
โ”‚   โ”œโ”€ loaders.js
โ”‚   โ””โ”€ utils.js
โ”œโ”€ node_modules/
โ””โ”€ test/
     โ”œโ”€ fixtures/
     โ””โ”€ specs/
          โ”œโ”€ doxdox.js
          โ”œโ”€ loaders.js
          โ””โ”€ utils.js

Installation

doxdox can be installed via either NPM or Yarn.

$ npm install doxdox -g
$ yarn global add doxdox

Usage

CLI

Layouts

Markdown

For more information on Markdown visit http://daringfireball.net/projects/markdown/.

$ doxdox 'lib/**/*.js' --layout markdown --output DOCUMENTATION.md

Bootstrap

Form more information on Bootstrap visit https://v4-alpha.getbootstrap.com/.

$ doxdox 'lib/**/*.js' --layout bootstrap --output docs/index.html

Custom Handlebars Template

For more information on writing Handlebars templates visit http://handlebarsjs.com/.

$ doxdox 'lib/**/*.js' --layout templates/README.hbs --output README.md

Ignore

The ignore flag allows you to ignore both directories (with glob syntax) and files. Comma separated values.

$ doxdox './**/*.js' --ignore './coverage/**/*.js'

See https://github.com/isaacs/minimatch#usage for more information on how to use globs.

Help

Usage: doxdox <path> ... [options]

Options:

 -h, --help             Display this help message.
 -v, --version          Display the current installed version.
 -d, --description      Sets description.
 -i, --ignore           Comma separated list of paths to ignore.
 -l, --layout           Template to render the documentation with.
 -o, --output           File to save documentation to. Defaults to stdout.
 -p, --package          Sets location of package.json file.
 -t, --title            Sets title.

Included Layouts:

 - Markdown (default)    (http://daringfireball.net/projects/markdown/)
 - Bootstrap             (http://getbootstrap.com/)
 - Handlebars            (http://handlebarsjs.com/)

NPM Run Scripts

For more information on NPM run scripts visit https://docs.npmjs.com/cli/run-script.

$ npm install doxdox --save-dev
{
  "devDependencies": {
    "doxdox": "2.0.1"
  },
  "scripts": {
    "docs": "doxdox 'lib/**/*.js' --layout markdown --output DOCUMENTATION.md"
  }
}
$ npm run docs

Via JavaScript

const doxdox = require('doxdox');

parseInputs(['lib/**/*.js'], {
    'parser': 'dox',
    'layout': 'markdown'
}).then(content => {

    process.stdout.write(content);

});

See documentation for more information on parseInputs.

Packages

Core Packages

All core packages come pre-installed with doxdox.

Package Version Dependencies Documentation
doxdox-parser-dox NPM Version dependencies Status Latest Documentation
doxdox-plugin-bootstrap NPM Version dependencies Status Latest Documentation
doxdox-plugin-handlebars NPM Version dependencies Status Latest Documentation
doxdox-plugin-markdown NPM Version dependencies Status Latest Documentation

Other Packages

Non-core packages must be installed separately from doxdox.

$ npm install doxdox doxdox-plugin-dash --save-dev

The, via the --layout flag, you specify the plugin name minus doxdox-plugin-.

Package Version Dependencies Documentation
doxdox-plugin-dash NPM Version dependencies Status Latest Documentation
doxdox-plugin-github-wiki NPM Version dependencies Status Latest Documentation
grunt-doxdox NPM Version dependencies Status

Questions

If you have any questions regarding the use of doxdox, please use either the Gitter chat room or Stack Overflow. The issue tracker is to be used for bug reports and feature requests only.

Contributing

Be sure to review the Contributing Guidelines before logging an issue or making a pull request.

License

MIT

doxdox's People

Contributors

greenkeeper[bot] avatar greenkeeperio-bot avatar kapeli avatar neogeek avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.