Giter Club home page Giter Club logo

ndoc's Introduction

NDoc - JavaScript documentation generator

Build Status

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

  • NDoc is a CLI tool, not library. It doesn't require additional programming to execute.
  • 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 it will be removed.
  • Added new tags: read-only, internal, chainable
  • Events support.

How to Install

We suppose that you already have node.js and npm installed. If not - try nvm. Then install NDoc globally

npm install -g ndoc

Usage

ndoc [options] <path>...

path PATH                   Source files location

Options:

  -h, --help                Output usage information
  -o, --output PATH         Resulting file(s) location [doc]
  -e, --extension STRING    Source files extension [js]
  -f, --format <html|js>    Documentation format [html]
  -i, --index PATH          Index file [README.md]
  -t, --title TITLE         Documentation title
                            Supports interpolation. See notes for --link-format.
  -l, --link-format         FMT String format for link to source file [{file}#L{line}]
                            {url} is substituted with the URL of repository read from manifest file
                            {file} is substituted with the name of the source file
                            {line} is substituted with the line number within the source file
                            E.g. http://github.com/nodeca/ndoc/{file}#L{line}
                            {package.XXX} is substituted with XXX key of package.json, if any
  --view-source-label TXT   Text for "View source" link
  --skin PATH               Custom templates
  -b, --broken-links ACTION What to do if broken link occured. Can be one of 'show', 'hide', 'throw'.
                            Default is 'hide'

NDoc uses data from package.json in current folder, if found one. This helps to minimize number of options when building documentation for node.js projects. For example, you can just run:

ndoc ./lib

Syntax

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

For developers

If you like to make patches or develop skins - install NDoc in developer mode:

git clone [your_fork_url]
cd ndoc
npm install --dev

After installation is done you can generate prototype documentation for test:

make test

Then open ./test/proto-doc/index.html. Here is hosted doc example. There are also some shortcuts in Makefile, if you make skin changes and need to constantly rebuild samples.

License

This project is distributed under MIT license.

ndoc's People

Contributors

dvv avatar ixti avatar gordlea avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.