• Stars
    star
    330
  • Rank 123,325 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Docma

npm release license downloads dependencies maintained documentation
© 2019, Onur Yıldırım (@onury).

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. ☝️

...like this:

Docma screen

This is generated with the built-in template, Zebra.
click to view live

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

Building Documentation Programmatically

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/doc'
};
Docma.create()
    .build(config)
    .then(success => console.log('Documentation is built successfully.'))
    .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.

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-x. (I'm the author.)

For markdown output issues (that are not related with style), you can open an issue @ marked.

Changelog

See CHANGELOG.

Compatibility Table

Docma version Node version
v3.0.0 v8+
v2.0.0 v6+
v1.0.0 v4+

Documentation

Read Docma documentation, built with Docma, for a Docma demo... 👀
Also see the F.A.Q. section.

License

MIT. 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 twemoji. Graphics and icons licensed under CC-BY 4.0.

Related Modules

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

More Repositories

1

accesscontrol

Role and Attribute based Access Control for Node.js
TypeScript
2,132
star
2

geolocator

A utility for getting geo-location information via HTML5 and IP look-ups, geocoding, address look-ups, distance and durations, timezone information and more...
JavaScript
641
star
3

invert-color

Generates inverted (opposite) version of the given color. (<1KB)
TypeScript
288
star
4

tasktimer

An accurate timer utility for running periodic tasks on the given interval ticks or dates. (Node and Browser)
TypeScript
121
star
5

perfy

A simple, light-weight NodeJS utility for measuring code execution in high-resolution real times.
JavaScript
55
star
6

jsonc

Everything you need in JSON land.
TypeScript
38
star
7

grunt-jasmine-nodejs

[DEPRECATED] Jasmine (v2.x) Grunt multi-task for NodeJS with built-in reporters such as Default (Console) Reporter, JUnit XML, NUnit XML, Terminal Reporter, TeamCity, TAP Reporter. Supports the latest Jasmine features: fdescribe, fit, beforeAll, afterAll, etc...
JavaScript
35
star
8

custom-error-test

Compare and test various custom error implementations.
JavaScript
33
star
9

alfred-video-downloader

Video Downloader is an Alfred workflow written in Bash/Shell for easily downloading videos (and/or extracting audio) from various websites such as YouTube, Vimeo, DailyMotion and more...
Shell
32
star
10

jasmine-console-reporter

Progressive Console Reporter for Jasmine. Outputs detailed test results to the console, with beautiful layout and colors.
JavaScript
32
star
11

notation

Utility for modifying / processing the contents of Javascript objects via object notation strings or globs.
JavaScript
28
star
12

jsdoc-x

Parser for outputting a Javascript object from documented code via JSDoc's explain (-X) command.
JavaScript
13
star
13

re

RegExp API for Humans!
JavaScript
4
star
14

json-more

Deprecated. Use jsonc instead.
JavaScript
3
star
15

grunt-docma

DEPRECATED! Instead use Docma in your npm scripts.
JavaScript
2
star
16

ocli

CLI tools for most used operations and development workflows.
JavaScript
1
star
17

onury.github.io

Documentation for my libraries, apps...
HTML
1
star
18

tilo

Tiny logger with styles and levels for Node/TypeScript.
TypeScript
1
star