{"id":28732394,"url":"https://github.com/kgar/ts-markdown","last_synced_at":"2025-09-02T06:35:08.222Z","repository":{"id":48092136,"uuid":"513217300","full_name":"kgar/ts-markdown","owner":"kgar","description":"An extensible TypeScript markdown generator that takes JSON and creates a markdown document","archived":false,"fork":false,"pushed_at":"2025-04-12T04:29:23.000Z","size":960,"stargazers_count":15,"open_issues_count":6,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-16T12:43:33.398Z","etag":null,"topics":["data-conversion","data-converter","extensible","json","json-to-markdown","markdown","markdown-writer","open-source","test-driven-development","typescript","typescript-library"],"latest_commit_sha":null,"homepage":"https://kgar.github.io/ts-markdown/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kgar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2022-07-12T16:34:06.000Z","updated_at":"2025-07-15T15:17:13.000Z","dependencies_parsed_at":"2022-08-20T02:01:20.425Z","dependency_job_id":"60b8b845-7a79-4a93-9ba1-0ff13e547a15","html_url":"https://github.com/kgar/ts-markdown","commit_stats":{"total_commits":142,"total_committers":5,"mean_commits":28.4,"dds":"0.38732394366197187","last_synced_commit":"672f5a1a6124280343bce17a77bb1db44392e93b"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/kgar/ts-markdown","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgar%2Fts-markdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgar%2Fts-markdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgar%2Fts-markdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgar%2Fts-markdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kgar","download_url":"https://codeload.github.com/kgar/ts-markdown/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgar%2Fts-markdown/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273244304,"owners_count":25070958,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["data-conversion","data-converter","extensible","json","json-to-markdown","markdown","markdown-writer","open-source","test-driven-development","typescript","typescript-library"],"created_at":"2025-06-15T21:00:43.440Z","updated_at":"2025-09-02T06:35:08.213Z","avatar_url":"https://github.com/kgar.png","language":"TypeScript","readme":"# ts-markdown \u003c!-- omit in toc --\u003e\n\nAn extensible TypeScript markdown generator that takes JSON and creates a markdown document.\n\n[📖 Docs](https://kgar.github.io/ts-markdown/) | [🎮 Playground (Live Demo)](https://kgar.github.io/ts-markdown/playground.html)\n\n---\n\n- [Quick Start](#quick-start)\n- [Extensibility](#extensibility)\n- [Compatibility](#compatibility)\n- [Why This Project?](#why-this-project)\n- [🙌 Credit](#-credit)\n  - [Credit to json2md](#credit-to-json2md)\n  - [Credit to Markdown Guide](#credit-to-markdown-guide)\n- [🌏 Contribution Guidelines](#-contribution-guidelines)\n- [License](#license)\n\n## Quick Start\n\nInstall **ts-markdown**:\n\n```sh\nnpm install ts-markdown\n# or \"yarn add ts-markdown\"\n```\n\nGenerate some markdown:\n\n```ts\nimport { tsMarkdown } from 'ts-markdown';\n\n// Make markdown entries\nconst entries = [\n  {\n    h4: 'Hello, world!',\n  },\n  {\n    blockquote: \"Let's generate markdown!\",\n  },\n  { p: 'Generating markdown from data can be simple. All you need are:' },\n  {\n    ol: [\n      'objects',\n      'a function',\n      {\n        text: ['and a place to run ', { emoji: 'checkered_flag' }],\n      },\n    ],\n  },\n];\n\nreturn tsMarkdown(entries); // returns the markdown document as a string\n```\n\nAnd the result is:\n\n```md\n#### Hello, world!\n\n\u003e Let's generate markdown!\n\nGenerating markdown from data can be simple. All you need are:\n\n1. objects\n2. a function\n3. and a place to run :checkered_flag:\n```\n\nFor more information about supported markdown elements, view the [type docs](https://kgar.github.io/ts-markdown/modules.html). All support markdown elements end with `Entry`, such as `LinkEntry`, `ImageEntry`, `UnorderedListEntry`, and so on.\n\nFor more examples of **generating markdown**, check out the [cookbook](https://kgar.github.io/ts-markdown/pages/cookbook.html).\n\n## Extensibility\n\nYou can extend **ts-markdown** to render your own custom elements or even override existing renderers.\n\nFor more information on extending **ts-markdown**, see [Extending ts-markdown](https://kgar.github.io/ts-markdown/pages/extending-ts-markdown.html).\n\n## Compatibility\n\n**ts-markdown** is written in TypeScript and node JS. It works with node JS v16.x and higher. Earlier versions may also work, but it is not guaranteed.\n\n## Why This Project?\n\nI am an avid user of [Obsidian.md](https://www.obsidian.md), and as I build my vaults of information, I sometimes need to convert JSON into markdown in a programmatic way. I may be working on a project to crunch some JSON and build articles, and having the ability to offload the complexity of rendering markdown to a library would be ideal. Additionally, having TypeScript typing support sweetens the deal for me.\n\nBecause I could not find an active / monitored library that handled the level of complexity I need when building my Obsidian markdown documents, I decided to make it myself.\n\n## 🙌 Credit\n\n### Credit to [json2md](https://github.com/IonicaBizau/json2md)\n\nThis library is heavily inspired by [Ionică Bizău's](https://github.com/IonicaBizau) [json2md](https://github.com/IonicaBizau/json2md) library, which was the only highly starred repo I could find that offered the kind of functionality I wanted. I also like the modeling the author chose, so I have patterned mine after theirs, adding and expanding in ways that make sense to me.\n\n### Credit to [Markdown Guide](https://www.markdownguide.org/)\n\nThe unit tests in this library cover almost all cases defined in [Markdown Guide](https://www.markdownguide.org/), an excellent website for getting exactly the details needed for writing good markdown. Any best practices that I've applied are most likely based on this website.\n\n## 🌏 Contribution Guidelines\n\nHave an idea? Found a bug? See [how to contribute](https://github.com/kgar/data-driven-markdown/blob/main/CONTRIBUTING.md).\n\n## License\n\n[MIT](https://github.com/kgar/data-driven-markdown/blob/main/LICENSE) © [KGar](https://github.com/kgar)\n","funding_links":[],"categories":["Convert to Markdown Tools"],"sub_categories":["JSON to Markdown"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgar%2Fts-markdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkgar%2Fts-markdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgar%2Fts-markdown/lists"}