Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 1003 Bytes

File metadata and controls

46 lines (33 loc) · 1003 Bytes

注释生成文档

JSON2TABLE
markdown 生成示例:http://xn--8ovp9s.xn--m8txu.com/typescript-interface-generate-markdown/

运行

yarn

yarn type && yarn start

配置 & 示例

TODO

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 插件