Skip to content

JevonsCode/typescript-interface-generate-markdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

注释生成文档

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

About

⬇️ get interface to generate markdown

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published