一个 typescript 转 markdown table 的工具

日期 : 2021-09-13 18:08:58作者 : 熊人

https://wjkang.github.io/typescript-to-markdown/

typescript 类型转为 markdown table,可提取 jsdoc 注释,支持深层嵌套,支持自定义模板。

例子:

复制一段 typescript 类型声明,如下:

interface User {
/**
* @description 用户 id
* @type {number}
*/
id: number;
/**
* @description 昵称
* @type {string}
*/
nickname: string;
// 真实姓名
trueName: string;
// 年龄
age: string;
}

类型声明转为 markdown table 的格式,如下:

User

参数说明类型必须
id用户 idnumber
nickname昵称string
trueName真实姓名string
age年龄string

使用场景:在基于 typescript 开发库的时候,更加方便的生成文档

标签 :