docheat
v0.1.8
Published
A "cheating" tool that generates brief API references for TypeScript libraries with links to source code.
Downloads
14
Maintainers
Readme
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, 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
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:
<!-- docheat:functions -->
3. And the following content is generated using docheat under current project folder with command
docheat demo/tsconfig.json
:
[+] bar(a: string, b: number): Promise<void>
A useless function for demonstration.
[+] foo(a: string): Promise<void>
+2
Another useless function with overloads for demonstration.
Overloads:
foo(b: number): Date
foo<T>(...args: T[]): T
2. And ends with marker comment below:
<!-- endcheat -->
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.