{"id":15594341,"url":"https://github.com/orta/md-type-tables","last_synced_at":"2026-02-24T15:38:26.296Z","repository":{"id":66647140,"uuid":"351575120","full_name":"orta/md-type-tables","owner":"orta","description":null,"archived":false,"fork":false,"pushed_at":"2021-03-25T21:11:48.000Z","size":16,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-06T22:57:32.750Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-25T21:02:43.000Z","updated_at":"2021-11-25T10:37:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"2abf5c0a-bd09-4c40-9e3c-61de6e3e7d8e","html_url":"https://github.com/orta/md-type-tables","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orta%2Fmd-type-tables","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orta%2Fmd-type-tables/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orta%2Fmd-type-tables/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orta%2Fmd-type-tables/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orta","download_url":"https://codeload.github.com/orta/md-type-tables/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252782482,"owners_count":21803383,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T00:38:30.476Z","updated_at":"2026-02-24T15:38:21.276Z","avatar_url":"https://github.com/orta.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"We take this type:\n\n\u003c!-- AUTO-GENERATED-CONTENT:START (CODE:src=./types.ts) --\u003e\n\u003c!-- The below code snippet is automatically added from ./types.ts --\u003e\n\n```ts\ntype SomeType = {\n  /**\n   * Client ID of your GitHub/OAuth App. Find it on your app's settings page.\n   *  @required\n   */\n  clientId: string;\n  /**\n   * Client Secret for your GitHub/OAuth App. Create one on your app's settings page.\n   *  @required\n   */\n  clientSecret: string;\n  /**\n   * Either \"oauth-app\" or \"github-app\". Defaults to \"oauth-app\".\n   */\n  clientType: string;\n};\n```\n\n\u003c!-- AUTO-GENERATED-CONTENT:END --\u003e\n\nAnd use it to generate this table:\n\n\u003c!-- AUTO-GENERATED-CONTENT:START (TYPES:src=./types.ts\u0026symbol=SomeType) --\u003e\n\u003ctable width=\"100%\"\u003e\n\u003cthead align=left\u003e\n  \u003ctr\u003e\n    \u003cth width=150\u003e\n      name\n    \u003c/th\u003e\n    \u003cth width=70\u003e\n      type\n    \u003c/th\u003e\n    \u003cth\u003e\n      description\n    \u003c/th\u003e\n  \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody align=left valign=top\u003e\n\n\u003ctr\u003e\n  \u003cth\u003e\n    \u003ccode\u003eclientId\u003c/code\u003e\n  \u003c/th\u003e\n  \u003cth\u003e\n    \u003ccode\u003estring\u003c/code\u003e\n  \u003c/th\u003e\n  \u003ctd\u003e\n\n**Required**\nClient ID of your GitHub/OAuth App. Find it on your app's settings page.\n\n  \u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003cth\u003e\n    \u003ccode\u003eclientSecret\u003c/code\u003e\n  \u003c/th\u003e\n  \u003cth\u003e\n    \u003ccode\u003estring\u003c/code\u003e\n  \u003c/th\u003e\n  \u003ctd\u003e\n\n**Required**\nClient Secret for your GitHub/OAuth App. Create one on your app's settings page.\n\n  \u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003cth\u003e\n    \u003ccode\u003eclientType\u003c/code\u003e\n  \u003c/th\u003e\n  \u003cth\u003e\n    \u003ccode\u003estring\u003c/code\u003e\n  \u003c/th\u003e\n  \u003ctd\u003e\n\nEither \"oauth-app\" or \"github-app\". Defaults to \"oauth-app\".\n\n  \u003c/td\u003e\n\u003c/tr\u003e\n\n   \u003c/tbody\u003e\n \u003c/table\u003e\n\n\u003c!-- AUTO-GENERATED-CONTENT:END --\u003e\n\nUsing this code:\n\n\u003c!-- AUTO-GENERATED-CONTENT:START (CODE:src=./index.js) --\u003e\n\u003c!-- The below code snippet is automatically added from ./index.js --\u003e\n\n```js\nconst ts = require(\"typescript\");\n\nmodule.exports = {\n  transforms: {\n    /* Match \u003c!-- AUTO-GENERATED-CONTENT:START (TYPES:src=filepath\u0026symbol=Type) --\u003e */\n    TYPES(_content, options) {\n      const mds = [];\n      let program = ts.createProgram([options.src], {});\n      const sourceFile = program.getSourceFile(options.src);\n\n      /** @type {import(\"typescript\").TypeAliasDeclaration} */\n      let typeNode = undefined;\n      const findSymbol = (node) =\u003e {\n        if (\n          node \u0026\u0026\n          node.name \u0026\u0026\n          node.name.escapedText \u0026\u0026\n          node.name.escapedText === options.symbol\n        ) {\n          typeNode = node;\n        }\n        if (!typeNode) ts.forEachChild(node, findSymbol);\n      };\n\n      findSymbol(sourceFile);\n      if (!typeNode)\n        throw new Error(`Could not find ${options.symbol} in ${options.src}`);\n\n      mds.push(prefix);\n      typeNode.type.members.forEach((member) =\u003e {\n        const name = member.name.escapedText;\n        const type = sourceFile.text.slice(\n          member.type.pos + 1,\n          member.type.end\n        );\n\n        const required =\n          member.jsDoc \u0026\u0026\n          !!member.jsDoc.find(\n            (d) =\u003e d.tags \u0026\u0026 d.tags.find((t) =\u003e t.tagName.escapedText)\n          );\n        const info =\n          member.jsDoc \u0026\u0026 member.jsDoc.map((jd) =\u003e jd.comment).join(\"\\n\\n\");\n\n        mds.push(`\u003ctr\u003e\n  \u003cth\u003e\n    \u003ccode\u003e${name}\u003c/code\u003e\n  \u003c/th\u003e\n  \u003cth\u003e\n    \u003ccode\u003e${type}\u003c/code\u003e\n  \u003c/th\u003e\n  \u003ctd\u003e\n\n${required ? \"**Required**\" : \"\"}\n${info}\n\n  \u003c/td\u003e\n\u003c/tr\u003e`);\n      });\n\n      mds.push(suffix);\n      return mds.join(\"\\n\\n\");\n    },\n  },\n};\n\nconst prefix = `\u003ctable width=\"100%\"\u003e\n\u003cthead align=left\u003e\n  \u003ctr\u003e\n    \u003cth width=150\u003e\n      name\n    \u003c/th\u003e\n    \u003cth width=70\u003e\n      type\n    \u003c/th\u003e\n    \u003cth\u003e\n      description\n    \u003c/th\u003e\n  \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody align=left valign=top\u003e`;\n\nconst suffix = `\n   \u003c/tbody\u003e\n \u003c/table\u003e\n`;\n```\n\n\u003c!-- AUTO-GENERATED-CONTENT:END --\u003e\n\nYou can run it locally:\n\n```sh\ngit clone https://github.com/orta/md-type-tables\ncd md-type-tables\nyarn\nyarn readme\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forta%2Fmd-type-tables","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forta%2Fmd-type-tables","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forta%2Fmd-type-tables/lists"}