@metarhia/doc

0.7.0 • Public • Published

Metarhia Documentation Generator

CI Status Badge

Installation

$ npm install -g @metarhia/doc

Cli usage

metadoc [options] file.js [file.js...]

Options:
  --help                 Show help                                     [boolean]
  --version              Show version number                           [boolean]
  --header               header for the resulting doc file              [string]
  --footer               footer for the resulting doc file              [string]
  --header-file          file with header for the resulting doc file    [string]
  --footer-file          file with footer for the resulting doc file    [string]
  --write-to-stdout, -o  write output to stdout instead of files       [boolean]
  --output-dir, -d       output directory for separate doc files        [string]
  --output-file, -f      output directory for merged doc file           [string]
  --config, -c           custom config file                             [string]

API

Table of Contents

introspect(namespace, text)

  • namespace: <Map> hash of interfaces
  • text: <string> data to parse

Returns: <Map> hash of hash of records, { title, description, parameters, comments }

Introspect interface

parseSignature(fn, text, start)

Returns: <Object> function signature

  • title: <string> short function description
  • description: <string> extended function description
  • argsSignature: <string> custom function signature
  • parameters: <Object[]> function parameters, { name, types, nonStandardTypes, comment, offset }
  • comments: <Object[]> comments about returned value, thrown errors, deprecation and usage, { name, types, nonStandardTypes, comment }

Parse function signature

generateMd(inventory, options)

  • inventory: <Map> hash of map of records, { method, title, parameters }
  • options: <Object>

Returns: <string> md document

Generate md from interfaces inventory

Contributors

See GitHub for a full list of contributors

License

Licesed under MIT license. Copyright (c) 2018 Metarhia contributors

Package Sidebar

Install

npm i @metarhia/doc

Weekly Downloads

13

Version

0.7.0

License

MIT

Unpacked Size

52.7 kB

Total Files

9

Last publish

Collaborators

  • aqrln
  • belochub
  • lundibundi
  • nechaido
  • timur.shemsedinov