• Stars
    star
    101
  • Rank 338,166 (Top 7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 13 years ago
  • Updated 10 months ago

Reviews

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

Repository Details

js port of pdoc, with extentions

NDoc - JavaScript documentation generator

CI

NDoc is an inline comment parser and JavaScript documentation generator written in Node.JS. This project was inspired by PDoc. It tries to keep compatibility, but has some differences:

  • NDoc is primarily a CLI tool, so you don't need to code your documentor, although it can be easily used as library.
  • Clarified EBNF syntax. Definitions now MUST be separated with an empty line from the following comments.
  • Added options for deprecated tag: you can set versions, when tag was deprecated and when method/property will be removed.
  • Added new tags: read-only, internal, chainable
  • Events support.

How to Install

We suppose that you already have Node and npm installed. If not - try nvm.

npm install -g ndoc

Usage

usage: ndoc [-h] [-v] [--exclude PATTERN] [-o PATH] [--use PLUGIN]
            [--alias MAPPING] [-r RENDERER] [--link-format FORMAT]
            [-t TEMPLATE] [--show-all] [--package PACKAGE] [--index FILE]
            [--gh-ribbon URL] [--broken-links ACTION] [--noenv]
            PATH[PATH ...]

Positional arguments:
  PATH                            Source files location

Optional arguments:
  -h, --help                      Show this help message and exit.
  -v, --version                   Show program's version number and exit.
  --exclude PATTERN               Glob patterns of filenames to exclude (you
                                  can use wildcards: ?, *, **).
  -o PATH, --output PATH          Resulting file(s) location.
  --use PLUGIN                    Load custom plugin.
  --alias MAPPING                 Registers extensions alias. For example
                                  `cc:js` will register `cc` extension as an
                                  alias of `js`
  -r RENDERER, --render RENDERER  Documentation renderer (html, json). More
                                  can be added by custom plugins.
  --link-format FORMAT            View sources link (no links by default)
                                  format. You can use `{file}` and `{line}`
                                  and any of `{package.*}` variables for
                                  interpolation.
  -t TEMPLATE, --title TEMPLATE   Documentation title template. You can use
                                  any of `{package.*}` variables for
                                  interpolation. DEFAULT: `{package.name}
                                  {package.version} API documentation`
  --show-all                      By default `internal` methods/properties
                                  are not shown. This trigger makes ndoc show
                                  all methods/properties
  --package PACKAGE               Read specified package.json FILE. When not
                                  specified, read ./package.json if such file
                                  exists.
  --index FILE                    Index file (with introduction text), e.g.
                                  README.md file.
  --gh-ribbon URL                 Add "Fork me on GitHub" ribbon with given
                                  URL. You can use any of `{package.*}`
                                  variables for interpolation.
  --broken-links ACTION           What to do if broken link occurred (show,
                                  hide, throw). DEFAULT: `show`.
  --noenv                         Ignore .ndocrc

Syntax

NDoc Syntax. It is similar to PDoc one, with some extensions (see start of this doc for details).

For developers

You can generate prototype documentation for test:

make test

Then open ./tests/prototype-doc/index.html.

Custom parsers and renderers

You can create and use your own parser/renderer via --use option. Get one of the parsers or renderers as a base template, copy it into separate folder. Create package.json and modify it to fit your needs. Then attach it with --use my-module argument.

Using NDoc as module

You can use NDoc as module, for example, to override default options processing.

var NDoc = require('ndoc');


var options = {
  linkFormat  : 'http://example.com/{file}#{line}',
  output:     : 'doc'
};

var ast;

try {
  ast = NDoc.parse(['lib/my-module.js'], options);
} catch (err) {
  console.error(err);
  process.exit(1);
}

try {
  NDoc.render('html', ast, options);
} catch (err) {
  console.error(err);
  process.exit(1);
}

License

This project is distributed under MIT license.

More Repositories

1

js-yaml

JavaScript YAML parser and dumper. Very fast.
JavaScript
6,289
star
2

pako

high speed zlib port to javascript, works in browser & node.js
JavaScript
5,550
star
3

pica

Resize image in browser with high quality and high speed
JavaScript
3,759
star
4

probe-image-size

Get image size without full download. Supported image types: JPG, GIF, PNG, WebP, BMP, TIFF, SVG, PSD, ICO.
JavaScript
984
star
5

argparse

CLI arguments parser for node.js. JS port of python's argparse module.
JavaScript
489
star
6

image-blob-reduce

Resize image blobs with high quality. Pica's wrapper to work with file inputs.
JavaScript
272
star
7

babelfish

human friendly i18n for javascript (node.js + browser)
JavaScript
255
star
8

tabex

Cross-tab message bus for browsers.
JavaScript
219
star
9

url-unshort

Short links expander for node.js
JavaScript
115
star
10

charlatan

Fake identities generator for node.js (names, addresses, phones, IPs and others). Supports multiple languages.
JavaScript
96
star
11

nodeca

Forums / Blogs / Groups / Classfields / ... platform. Fork this to make your own config.
JavaScript
96
star
12

bag.js

JS / CSS / files loader + key/value storage
JavaScript
90
star
13

idoit

Redis-backed task queue engine with advanced task control and eventual consistency
JavaScript
74
star
14

glur

Fast gaussian blur in pure JavaScript via IIR filer
JavaScript
72
star
15

multimath

WebAssembly wrapper to simplify fast math coding
JavaScript
70
star
16

embedza

Create HTML snippets/embeds from URLs using info from oEmbed, Open Graph, meta tags.
JavaScript
64
star
17

promise-memoize

Memoize promise-returning functions. Includes cache expire and prefetch.
JavaScript
59
star
18

navit

Simple client testing from your scripts
JavaScript
48
star
19

unhomoglyph

Replace all homoglyphs with base characters. Useful to detect similar strings.
JavaScript
39
star
20

nntp-server

NNTP server for readers
JavaScript
27
star
21

puncher

Library to set timestamps in your application requests & genegate profiling tree.
JavaScript
14
star
22

eslint-plugin-nodeca

Indentation check rule for ESLint
JavaScript
13
star
23

nodeca.core

Nodeca core app (admin panel, loader, bundler)
JavaScript
12
star
24

types

Collection of extra types (structures, classes) for JavaScript.
JavaScript
12
star
25

nodeca.users

Nodeca user app (login / register / albums / profiles)
JavaScript
11
star
26

event-wire

Mediator with dynamic responsibility chains
JavaScript
10
star
27

hike-js

Javascript port of Hike (Ruby) - a library for finding files in a set of paths
JavaScript
10
star
28

plurals-cldr

Plurals suport for JS, autogenerated from CLDR.
JavaScript
9
star
29

relimit

Rate limiter with tuneable scheduler and distributed run support
JavaScript
9
star
30

js-yaml-js-types

Extra js types for js-yaml
JavaScript
8
star
31

mimoza

Simple mime-type tools library
JavaScript
8
star
32

pointer

router for node.js / client
JavaScript
7
star
33

nodeca.forum

Nodeca forum app
JavaScript
4
star
34

redis-if

JavaScript
4
star
35

nodeca-design

Nodeca interface mockups
HTML
4
star
36

fontomas

3
star
37

nodeca.blogs

Blogs component for Nodeca
JavaScript
3
star
38

nodeca.market

Market component for Nodeca
JavaScript
2
star
39

nodeca.clubs

Clubs component for Nodeca
JavaScript
2
star
40

charcount

Count visual length of javascript string
JavaScript
2
star
41

bkv

JavaScript
1
star
42

nodeca.nntp

JavaScript
1
star
43

nodeca.vbconvert

vBulletin -> Nodeca convertor
JavaScript
1
star
44

nodeca-doc

Nodeca internals documentation
CSS
1
star
45

nodeca.search

JavaScript
1
star
46

.github

1
star
47

nodeca.site

Custom configuration for nodeca
JavaScript
1
star