Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vilicvane/docheat

A "cheating" tool that generates brief API references for TypeScript libraries with links to source code.
https://github.com/vilicvane/docheat

Last synced: 20 days ago
JSON representation

A "cheating" tool that generates brief API references for TypeScript libraries with links to source code.

Awesome Lists containing this project

README

        

[![NPM Package](https://badge.fury.io/js/docheat.svg)](https://www.npmjs.com/package/docheat)

# Docheat

Docheat is a "cheating" tool for libraries written in TypeScript, it generates
API references inside a markdown file with brief descriptions and links to
source code, i.e., cheating.

This tool is developed for [villa](https://github.com/vilic/villa), a set
of promise utilities for `async`-`await`-ready environment. And currently it
supports **ONLY** exported **functions**, please check out the issue list to
see what might be coming next.

Please understand it is **NOT** meant to generate detailed and well-organized
documentations.

## Installation

```sh
yarn global add docheat
```

## Usage and Example

**Note:** to understand the example, please read in the order suggested by step
numbers.

> **1.** A docheat entry list starts with marker comment below:

> ``

> **3.** And the following content is generated using docheat under
> current project folder with command `docheat demo/tsconfig.json`:

#### [[+]](demo/bar.ts#L4) `bar(a: string, b: number): Promise`

A useless function for demonstration.

#### [[+]](demo/foo.ts#L4) `foo(a: string): Promise`+2

Another useless function with overloads for demonstration.

##### Overloads:

- `foo(b: number): Date`
- `foo(...args: T[]): T`

> **2.** And ends with marker comment below:

> ``

## Command Options

- **-t, --target:** Glob patterns of target markdown files, defaults to
`README,README.*`.
- **-l, --level:** Heading level of generated entries, defaults to `4`.
- **-b, --base-url:** Base url of source code links

## License

MIT License.