docma

A powerful dev-tool to easily generate beautiful HTML documentation from Javascript (JSDoc), Markdown and HTML files.

  • docma

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
docma
3.2.25 years ago8 years agoMinified + gzip package size for docma in KB

Readme

<a href="https://onury.io/docma"><img width="200" height="200" src="https://raw.githubusercontent.com/onury/docma/master/docma-logo.png" alt="Docma" /></a>

<a href="https://www.npmjs.com/package/docma"><img src="http://img.shields.io/npm/v/docma.svg?style=flat-square" alt="npm" /></a>
<a href="https://github.com/onury/docma"><img src="https://img.shields.io/github/release/onury/docma.svg?style=flat-square" alt="release" /></a>
<a href="https://github.com/onury/docma/blob/master/LICENSE"><img src="http://img.shields.io/npm/l/docma.svg?style=flat-square" alt="license" /></a>
<a href="https://www.npmjs.com/package/docma"><img src="https://img.shields.io/npm/dt/docma.svg?style=flat-square" alt="downloads" /></a>
<a href="https://david-dm.org/onury/docma"><img src="https://david-dm.org/onury/docma.svg?style=flat-square" alt="dependencies" /></a>
<a href="https://github.com/onury/docma/graphs/commit-activity"><img src="https://img.shields.io/maintenance/yes/2019.svg?style=flat-square" alt="maintained" /></a>
<a href="https://onury.io/docma"><img src="https://img.shields.io/badge/docs%20by-docma-c27cf4.svg?docs%20by=docma&style=flat-square" alt="documentation" /></a>
<br />
<sub>© 2019, Onur Yıldırım (<b><a href="https://github.com/onury">@onury</a></b>).</sub>


A powerful tool to easily generate beautiful HTML documentation from Javascript (JSDocjsdoc), Markdownmarkdown 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 opinionszebra. :sunglasses:
  • Supports custom templates, comes with template authoring tools.
  • Works great with GitHub Pages, Amazon S3, Nginx, Apache, etc...
  • Build via APIdocma-api or CLIdocma-cli.
  • Extremely configurable and debuggable.
  • Well documented. :pointup:

...like this:

<a href="https://onury.io/docma"><img width="650" height="385" src="https://raw.github.com/onury/docma/master/docma-screen.gif" alt="Docma screen" /></a>
<br />
<br />
<sub>This is generated with the built-in template, Zebra.</sub><br />
<a href="https://onury.io/docma">click to view live</a>

Installation

npm i docma -D

Building Documentation with 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 Referencedocma-cli - Build Configurationdocma-config - F.A.Q.docma-faq

Building Documentation Programmatically

If you need to build documentation from within your code, use the API.
const Docma = require('docma');
Either by passing a configurationdocma-config object.
const config = {
    src: [
        './code/**/*.js',
        './README.md'
    ],
    dest: './output/doc'
};
Docma.create()
    .build(config)
    .then(success => console.log('Documentation is built successfully.'))
    .catch(error => console.log(error));
Or by reading configurationdocma-config from a JSON file.
Docma.create()
    .build('./path/to/docma.json')
    .catch(error => console.log(error));
See Docma API Referencedocma-api.

Parsed Output

Sometimes, the issue is with invalid JSDoc comments. See this for linting/validating your JSDoc while you type and within a build process.
To investigate the parsed JSDoc output, enable the debug option that will create a JSON output(s) within the root of the destination directory. If you have a problem with the parsed documentation data, open an issue @ jsdoc-xjsdoc-x. (I'm the author.)
For markdown output issues (that are not related with style), you can open an issue @ markedmarked.

Changelog

See CHANGELOGchangelog.

Compatibility Table

| Docma version | Node version | |---------------|--------------| | v3.0.0 | v8+ | | v2.0.0 | v6+ | | v1.0.0 | v4+ |
## Documentation Read Docma documentationdocma-docs, built with Docma, for a Docma demo... :eyes:
Also see the F.A.Q.docma-faq section.

License

MITlicense. You don't have to include any copyright notice in your documentation 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 twemojitwemoji. Graphics and icons licensed under CC-BY 4.0cc-by-4.

Related Modules

  • jsdoc-xjsdoc-x — Parser for outputting a Javascript object from documented code via JSDoc's explain (-X) command.
  • markedmarked — A full-featured markdown parser and compiler, written in JavaScript. Built for speed.
  • dustjsdustjs-github — Asynchronous Javascript templating for the browser and server.