一个 typescript 转 markdown table 的工具

2021-09-09 11:34:12 +08:00
 ruoxie

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 用户 id number
nickname 昵称 string
trueName 真实姓名 string
age 年龄 string

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

1527 次点击
所在节点    分享创造
2 条回复
duTop
2021-09-10 11:15:04 +08:00
赞,有用
461229187
2021-09-14 10:01:22 +08:00
推出 vscode 插件必装

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/800786

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX