@metarhia/doc

Metarhia Documentation Generator

Usage no npm install needed!

<script type="module">
  import metarhiaDoc from 'https://cdn.skypack.dev/@metarhia/doc';
</script>

README

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