JSPM

  • Created
  • Published
  • Downloads 292205
  • Score
    100M100P100Q168653F

Render JSdoc documentation as markdown

Package Exports

  • jsdoc-to-markdown

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jsdoc-to-markdown) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

view on npm npm module downloads per month Dependency Status Analytics

work in progress, unstable, draft documentation

#jsdoc-to-markdown Documented source code in, markdown out.. In development, any feedback welcome.

##Install Ensure node.js is installed first. Linux/Mac users may need to run the following commands with sudo.

###Globally

$ npm install -g jsdoc-to-markdown

###Bundled with your project

$ npm install jsdoc-to-markdown --save-dev

Then add an docs build task to your package.json scripts, e.g.:

{
  "name": "my-web-app",
  "version": "1.0.0",
  "scripts": {
    "docs": "jsdoc2md --index lib/*.js"
  }
}

This approach abstracts implementation details away, saving collaborators the hassle of installing / learning jsdoc-to-markdown. Docs are generated like so:

$ npm run docs

##Usage Document your source code using correct jsdoc syntax, then run it through jsdoc2md.

$ jsdoc2md <options> <source_files>

-t, --template <string>  A custom handlebars template to insert the rendered documentation into,
                         overriding the default
-p, --preset <string>    Use a preset template ('default', 'global' or 'modules')
-j, --json               Output the template data only
-h, --help               Print usage information
--src <array>            The javascript source files. The default option.
--index                  Include an index for each module and class, linking to members
--skip-heading           Skip the module heading, useful if you already have the heading elsewhere
                         in your template.

##examples These projects have readme files rendered by jsdoc2md:

#API Reference

Example

var jsdoc2md = require("jsdoc-to-markdown");

###jsdoc2md.render(options) Params

  • options object - The render options
    • [template] string - A handlebars template to insert your documentation into.
    • [preset] string - Choose from one of the built-in templates
    • [json] boolean - Return the JSON template data only
    • [src] Array.<string> - The javascript source files
    • [index] boolean - Include an index for each module and class, linking to members
    • [skip-heading] boolean - Skip the module heading, useful if you already have the heading elsewhere in your template.
  • onRender - a callback invoked on completion

###callback: onRender Called by jsdoc2md.render() on completion.

Params

  • err object - An error instance if applicable, else null
  • result string - the rendered markdown

Scope: inner typedef of jsdoc-to-markdown
Type: function