Metarhia Documentation Generator
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)
Returns: <Map>
hash of hash of records,
{ title, description, parameters, comments }
Introspect interface
parseSignature(fn, text, start)
-
fn
:<Function>
|<RegExp>
to be searched -
text
:<string>
to be searched in -
start
:<number>
position to start searching from
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>
-
header
:<string>
text before api documentation -
footer
:<string>
text after api documentation -
customTypes
:<string[]>
custom types -
customLinks
:<Array[]>
custom types links
-
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