@rigwild/apidoc-markdown
Generate API documentation in Markdown format from apiDoc data
Last updated 11 days ago by rigwild .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @rigwild/apidoc-markdown 
SYNC missed versions from official npm registry.

@rigwild/apidoc-markdown

npm badge

Generate API documentation in markdown from apiDoc data.

This is an up to date and maintained fork of @martinj/node-apidoc-markdown (which is not maintained). The template was updated with recent apiDoc features thanks to this fork.

Installation

# Command line utility
yarn global add @rigwild/apidoc-markdown
# or
npm i -g @rigwild/apidoc-markdown

# Programmatic usage
yarn add @rigwild/apidoc-markdown
# or
npm i @rigwild/apidoc-markdown

Then, generate your documentation using your newly added command apidoc-markdown.

Usage

Help message

Generate Markdown documentation from apiDoc data.
Usage: apidoc-markdown -p <path> -o <output_file> [-t <template_path>] [--multi] [--createPath] [--prepend <file_path>]

Options:
  --version       Show version number                                                                                                                [boolean]
  --path, -p      Path to generated apiDoc output directory. Where `api_data.json` and `api_project.json` resides.                         [string] [required]
  --output, -o    Output file or directory to write output to.                                                                             [string] [required]
  --template, -t  Path to EJS template file, if not specified default template will be used.                        [string] [default: "templates/default.md"]
  --prepend       Path to file content to add before route groups documentation.                                                                      [string]
  --multi         Output one file per group to the `output` directory.                                                              [boolean] [default: false]
  --createPath    Recursively create directory arborescence to the `output` directory.                                              [boolean] [default: false]
  -h, --help      Show help                                                                                                                          [boolean]

Examples:
  apidoc-markdown -p doc/ -o doc.md                         Generate from `doc/` apiDoc output to `./doc.md`
  apidoc-markdown -p doc -o multi/ --multi --createPath     Generate from `doc/` apiDoc output to `./multi/<group>.md`

@rigwild/apidoc-markdown - https://github.com/rigwild/apidoc-markdown

Command-line arguments

Option Alias Description
--apiDocPath <apiDoc_path> -p Path to generated apiDoc output directory. Where api_data.json and api_project.json resides.
--output <output_path> -o Output file or directory to write output to
--template <template_path> -t Path to EJS template file, if not specified default template will be used.
--prepend <file_path> Path to file content to add before route groups documentation
--multi Output one file per group to the output directory
--createPath Recursively create directory arborescence to the output directory
--help -h Show help message

Programmatic usage

This project has been fully refactored to support programmatic use. Every functions are available in the ./src/generator.ts directory and are exported.

Example Description
Basic generation Generate documentation from the included example data
Basic generation with ordering Generate documentation from the included example data with order settings
One file per group generation Generate documentation from the included example data, one file per group

Configuration

Endpoints order

You can choose the order in which the documentation endpoints will be generated by adding an order key in api_project.js. See example.

Example

Generate documentation from the included example data. View generated example.

apidoc-markdown -p examples/basic -o examples/basic/example.md

Generate documentation from the included example data with ordering setting. View generated example.

apidoc-markdown -p examples/ordered -o examples/ordered/example.md

Generate documentation from the included example data, one file per group. View generated example.

apidoc-markdown -p examples/multi -o examples/multi/output --multi --createPath

Todo

  • [x] Refactor project code
  • [x] Update and clean dependencies
  • [x] Refactor command-line tool
  • [x] Update Markdown default template to working EJS (Update breaking changes)
  • [x] Update default template for new apiDoc features.
  • [x] CLI option : Export documentation to 1 file per group
  • [x] Programmatic use
  • [x] Automated tests
  • [x] Asynchronous code
  • [x] TypeScript rewrite
  • [ ] One file per route feature

Don't hesitate to suggest any feature you would like by creating an issue or a pull request.

License

The MIT license

Current Tags

  • 3.1.0                                ...           latest (11 days ago)

12 Versions

  • 3.1.0                                ...           11 days ago
  • 3.0.0                                ...           2 months ago
  • 2.1.0                                ...           6 months ago
  • 2.0.2                                ...           7 months ago
  • 2.0.1                                ...           7 months ago
  • 2.0.0                                ...           7 months ago
  • 1.2.0                                ...           7 months ago
  • 1.1.0                                ...           7 months ago
  • 1.0.1                                ...           8 months ago
  • 1.0.0                                ...           8 months ago
  • 0.3.1                                ...           8 months ago
  • 0.3.0                                ...           8 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 32
Last Day 0
Last Week 14
Last Month 15
Dependencies (3)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |