All Projects → heavenshell → ts-lehre

heavenshell / ts-lehre

Licence: MIT License
Generate document block(JsDoc, EsDoc, TsDoc) from source code

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ts-lehre

docgen
The docs.json generator for discord.js and its related projects
Stars: ✭ 59 (+321.43%)
Mutual labels:  generator, jsdoc
jsdast
JSDoc Abstract Syntax Tree
Stars: ✭ 20 (+42.86%)
Mutual labels:  jsdoc, tsdoc
Compodoc
📔 The missing documentation tool for your Angular, Nest & Stencil application
Stars: ✭ 3,567 (+25378.57%)
Mutual labels:  generator, jsdoc
Esdoc
ESDoc - Good Documentation for JavaScript
Stars: ✭ 2,706 (+19228.57%)
Mutual labels:  jsdoc, esdoc
Jsdoc To Markdown
Generate markdown documentation from jsdoc-annotated javascript
Stars: ✭ 1,199 (+8464.29%)
Mutual labels:  generator, jsdoc
metagraf
metaGraf is a opinionated specification for describing a software component and what its requirements are from the runtime environment. The mg command, turns metaGraf specifications into Kubernetes resources, supporting CI, CD and GitOps software delivery.
Stars: ✭ 15 (+7.14%)
Mutual labels:  generator
simpleflakes
Fast and test-driven distributed 64-bit ID generation, using pure JavaScript, for Node.js.
Stars: ✭ 32 (+128.57%)
Mutual labels:  generator
yang-schematics
Yet Another Angular Generator - based on @schematics/angular
Stars: ✭ 16 (+14.29%)
Mutual labels:  generator
username-generation-guide
A definitive guide to generating usernames for OSINT purposes
Stars: ✭ 38 (+171.43%)
Mutual labels:  generator
git-conventional-commits
Git Conventional Commits Util to generate Semantic Version and Markdown Change Log and Validate Commit Messag
Stars: ✭ 58 (+314.29%)
Mutual labels:  generator
wodle
Static site generator using next and tachyons
Stars: ✭ 29 (+107.14%)
Mutual labels:  generator
crafting
Website for generating Minecraft crafting recipe JSON files
Stars: ✭ 31 (+121.43%)
Mutual labels:  generator
combustor
MVC code generator for the Codeigniter framework.
Stars: ✭ 31 (+121.43%)
Mutual labels:  generator
codice fiscale
A Ruby gem that calculates the Italian Tax ID (Codice Fiscale)
Stars: ✭ 17 (+21.43%)
Mutual labels:  generator
mosaic-node-generator
Generate mosaic images in Node.
Stars: ✭ 25 (+78.57%)
Mutual labels:  generator
tidy-jsdoc
A clean JSDoc3 template
Stars: ✭ 16 (+14.29%)
Mutual labels:  jsdoc
yii2-rest-doc
Yii2 REST doc generator
Stars: ✭ 35 (+150%)
Mutual labels:  generator
wolmo-bootstrap-react-native
Bootstrap generator for React Native projects
Stars: ✭ 20 (+42.86%)
Mutual labels:  generator
express-mvc-generator
Express' Model View Controller Application Generator.
Stars: ✭ 46 (+228.57%)
Mutual labels:  generator
justgo
Skeleton for jump-starting a Go-powered microservice project with Docker and Go best-practices + easy code hot-reloading (for dev environments)!
Stars: ✭ 29 (+107.14%)
Mutual labels:  generator

Lehre

build

Lehre is document block generator.

Generate JsDoc style document from source code.

Install

yarn add -D lehre

Usage

cat src/app.ts | lehre --stdin

Specify directory and ignore patterns.

lehre --target-dir=./src --ignore-patterns="spec.ts"

Specify file.

lehre --target-file=./src/app.ts

Use babel parser(default parser is TypeScript compiler api and recommend to use)

lehre --target-file=./src/app.ts --parser=babel
$ ./lehre --help
Usage: lehre [options]

Options:
  -v, --version                 output the version number
  -t, --target-file [path]      Path to target file.
  -d, --target-dir [path]       Path to target directory.
  --stdin                       Force reading input from STDIN
  --write                       Edit files in-place
  --template-path [path]        Custom formatter path
  --ignores [path]              Ignore directory names
  --ignore-patterns [patterns]  Ignore patterns
  --parser [target]             Parser (default: "ts")
  --style [style]               Output style(string | json) (default: "string")
  --nest                        Enable to generate inner document(only
                                parser=ts available)
  --scriptTarget [target]       [ES3 | ES5 | ES2015 | ES2016 | ES2017 | ES2018
                                | ES2019 | ESNext] (default: "ESNext")
  --scriptKind [kind]           [JS | JSX | TS | TSX] (default: "TS")
  --formatter [formatter]       Document formatter(jsdoc | esdoc | tsdoc)
                                (default: "jsdoc")
  -h, --help                    display help for command

Formatters

You can choose document block formatter from JsDoc, ESDoc, TSDoc and your custom formatter.

JsDoc(default)

cat src/app.ts | lehre --stdin

EsDoc

cat src/app.ts | lehre --stdin --formatter=esdoc

TsDoc

cat src/app.ts | lehre --stdin --formatter=tsdoc

Coustom formatter

cat src/app/ts | lehre --stdin --template-path=./examples/template.js

Custom formatter

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.

Formatter api

generateClassDoc

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

generateInterfaceDoc

generateInterfaceDoc: ({
  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

generatePropertyDoc

generatePropertyDoc: ({
  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,
}) => string

generateFunctionDoc

generateFunctionDoc: ({
  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,
}) => string

LICENSE

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].