npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

api-toc

0.3.2

@jonschlinkert

npmHomeRepoSnykSocket
Downloads:39
$ npm install api-toc
DailyWeeklyMonthlyYearly

api-toc NPM version Build Status

Pass a dirname, get a markdown-formatted Table of Contents for your API.

Currently this is pretty opinionated, but I may add a reduce or filter function to allow customizing the output. PR or suggestions welcome.

Install with npm

$ npm i api-toc --save

Usage

var toc = require('api-toc');

Example

Using the pseudo-code in fixtures/:

toc('fixtures/');

Results in:

  • config

    • .disable
    • .enable
    • .option
  • storage

    • .extend
    • .get
    • .set
  • utils

    • .bar
    • .baz
    • .foo

The generated markdown looks like this:

+ **[config](fixtures/config.js)**
  - [.disable](fixtures/config.js#L10)
  - [.enable](fixtures/config.js#L6)
  - [.option](fixtures/config.js#L2)
+ **[storage](fixtures/storage.js)**
  - [.extend](fixtures/storage.js#L10)
  - [.get](fixtures/storage.js#L2)
  - [.set](fixtures/storage.js#L6)
+ **[utils](fixtures/utils.js)**
  - [.bar](fixtures/utils.js#L6)
  - [.baz](fixtures/utils.js#L10)
  - [.foo](fixtures/utils.js#L2)

Related projects

  • helper-apidocs: Template helper for automatically generating API docs from code comments. The sync version works with… more
  • markdown-toc: Generate a markdown TOC (table of contents) with Remarkable.

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

  • github/jonschlinkert
  • twitter/jonschlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on August 01, 2015.