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 via NPM.

npm i docma -D

Under the Hood

Docma v2 is written in ES2015 and requires Node.js v8 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 file docma.json in your project root, it's quite simple.

docma

You can even serve the docs locally and test.

docma serve

See Docma CLI Reference, Build Configuration and Docma F.A.Q. 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, Build Configuration and Docma F.A.Q. 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.