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.
yarn global add docheat
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.
foo(b: number): Date
foo<T>(...args: T[]): T
2. And ends with marker comment below:
<!-- endcheat -->
- -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
MIT License.