JSON2TABLE
markdown 生成示例:http://xn--8ovp9s.xn--m8txu.com/typescript-interface-generate-markdown/
yarn
yarn type && yarn start
nnnnn 个版本后,ts AST 遍历实现了,更灵活快速,有空把它再抽离成独立产品吧 ╮(╯_╰)╭
const program = ts.createProgram({
rootNames: config.fileNames,
options: config.options,
});
for (const sourceFile of program.getSourceFiles()) {
if (sourceFile.fileName.includes("example.ts")) {
ts.forEachChild(sourceFile, function walk(node) {
console.log({
kind: ts.SyntaxKind[node.kind],
text: node.getText(),
});
ts.forEachChild(node, walk);
});
}
}🧙 去每家公司都是独立的 UI,有空设计一套样式,同时改为 markdown it 插件