Great code deserves great documentation...

What's Docma?

Docma is a powerful tool to easily generate beautiful HTML documentation from Javascript (JSDoc), Markdown and HTML files.

Features

  • Parse JSDoc documentation, Markdown and HTML files.
  • Build a cool SPA (Single Page Application) from parsed files.
  • Generate multiple/separate API documentations by grouping JS files.
  • Path or Query-string based app routing.
  • Non-opinionated engine, built-in template with cool opinions. 😎
  • Supports custom templates, comes with template authoring tools.
  • Works great with GitHub Pages, Amazon S3, Nginx, Apache, etc...
  • Build via API or CLI.
  • Extremely configurable and debuggable.
  • Well documented. ☝️

Installation

Install Docma globally via NPM.

npm i docma -g

Under the Hood

Docma v2 is written in ES2015 and requires Node.js v6 or newer. Docma's own documentation is, of course; built with Docma using the default template, Zebra.

Building Documentation via CLI

You can use Docma CLI to build documentations directly from your console. Once you create the configuration (JSON) file, it's quite simple.

docma -c path/to/docma.json

You can even serve the docs locally and test.

docma serve path/to/docs

See Docma CLI Reference and Build Configuration for more information.

Building Documentation via API

If you need to build documentation from within your code, use the API.

const Docma = require('docma');

Either by passing a configuration object.

const config = {
    src: [
        './code/**/*.js',
        './README.md'
    ],
    dest: './output/docs'
};
Docma.create()
    .build(config)
    .catch(error => {
        console.log(error);
    });

Or by reading configuration from a JSON file.

Docma.create()
    .build('./path/to/docma.json')
    .catch(error => {
        console.log(error);
    });

See Docma API Reference and Build Configuration for more information.

Docma Templates

Docma includes a built-in template: Zebra, with a side-bar symbols menu, search and navigation features; and a beautiful layout. Actually you're viewing it right now ;}

You can also build your own template! See Creating Docma Templates.

License

MIT. You don't have to include any copyright notice in your docs output or templates but I'd appreciate if you let people know about this tool so we can read better documentations.

Emoji shortcuts used in source markdown files are parsed into twemoji. Graphics and icons are licensed under CC-BY 4.0.