{"id":13991961,"url":"https://github.com/hughsk/markdown-tree","last_synced_at":"2025-03-18T13:30:31.471Z","repository":{"id":12555783,"uuid":"15226079","full_name":"hughsk/markdown-tree","owner":"hughsk","description":"Convert a markdown document into a JSON tree structure.","archived":false,"fork":false,"pushed_at":"2017-08-20T08:27:49.000Z","size":3,"stargazers_count":14,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-17T16:38:06.844Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/hughsk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-16T13:11:17.000Z","updated_at":"2023-11-19T06:05:30.000Z","dependencies_parsed_at":"2022-07-21T12:48:15.478Z","dependency_job_id":null,"html_url":"https://github.com/hughsk/markdown-tree","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/hughsk%2Fmarkdown-tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughsk%2Fmarkdown-tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughsk%2Fmarkdown-tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughsk%2Fmarkdown-tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hughsk","download_url":"https://codeload.github.com/hughsk/markdown-tree/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221711834,"owners_count":16868040,"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-08-09T14:01:42.346Z","updated_at":"2024-10-27T17:38:58.844Z","avatar_url":"https://github.com/hughsk.png","language":"JavaScript","readme":"# markdown-tree [![deprecated](http://hughsk.github.io/stability-badges/dist/deprecated.svg)](http://github.com/hughsk/stability-badges) #\n\n**Deprecated: use something like [remark](https://www.npmjs.com/package/remark) instead?**\n\nConvert a markdown document into a JSON tree structure, using\n[marked](http://github.com/chjj/marked) under the hood.\n\nShould be helpful for cases where you might want to analyse the structure of\nthe document, e.g. auto-generating sites from GitHub wikis.\n\n## Usage ##\n\n[![markdown-tree](https://nodei.co/npm/markdown-tree.png?mini=true)](https://nodei.co/npm/markdown-tree)\n\n### `require('markdown-tree')(src[, options])` ###\n\n`src` should be the Markdown document you want to parse, as a string.\n\n`options` is passed on to\n[`marked.lexer`](https://github.com/chjj/marked/blob/abce5d0d6dbad0f7a19f009510a71708f539c4d6/README.md#access-to-lexer-and-parser).\n\nEach Node in the resulting tree represents either the document root or a\nheading, and should be formatted similarly to this:\n\n``` javascript\n{\n    type: \"Heading\" // or, \"Document\"\n  , text: \"The Heading Contents\"\n  , children: []\n  , depth: 2 // e.g. \"### hello\" would be 3\n  , tokens: [\n    {\n        type: 'paragraph'\n      , text: 'The tokens from each paragraph...'\n    },\n    {\n        type: 'paragraph'\n      , text: '...before the next heading go here!'\n    },\n    {\n        type: 'paragraph'\n      , text: 'This data comes directly from marked.'\n    }\n  ]\n}\n```\n\nThere's also a `parent` property, but that's hidden to make logging the tree a\nlittle cleaner.\n\nNote also that the `tokens` array is actually retrieved from the marked module\nuntouched, so you can run it through `marked.parse` with little trouble to\ncompile that section to standalone HTML.\n\n## License ##\n\nMIT. See [LICENSE.md](http://github.com/hughsk/markdown-tree/blob/master/LICENSE.md) for details.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhughsk%2Fmarkdown-tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhughsk%2Fmarkdown-tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhughsk%2Fmarkdown-tree/lists"}