Lehre is document block generator.
Generate JsDoc style document from source code.
yarn add -D -E lehre
cat src/app.ts | lehre --stdin
Specify directory and ignore patterns.
lehre --target-dir=./src --ignore-patterns="spec.ts"
You can choose document block formatter from JsDoc,ESDoc,TSDoc and your custom formatter.
cat src/app.ts | lehre --stdin
cat src/app.ts | lehre --stdin --formatter=esdoc
cat src/app.ts | lehre --stdin --formatter=tsdoc
cat src/app/ts | lehre --template-path=./examples/template.js
You can create your own cutom document block formatter.
Return string value and it insert above to signature automatically.
examples/template.js
is sample formatter.
generateClassDoc: (
name: string,
type: string,
start: { line: number, charactor: number },
end: { line: number, charactor: number },
methods: [
name: string,
type: string,
start: { line: number, charactor: number },
end: { line: number, charactor: number },
params: ParamProps[
name: string,
type: string,
default: string,
alias: string,
],
returnType: string,
],
heritageClauses: [{ type: string, value: string }],
) => string