{"library":"mdast-builder","title":"MDAST Builder","description":"mdast-builder provides a set of composable functions designed to programmatically construct Markdown Abstract Syntax Tree (MDAST) structures. It simplifies the creation of complex MDAST nodes like headings, paragraphs, lists, and text, offering a more declarative way to build ASTs compared to direct object manipulation. The current stable version is 1.1.1, released in July 2019. The package appears to have an inactive release cadence, with no updates since mid-2019, suggesting it is no longer actively maintained. Its key differentiator is its functional, builder-pattern approach to MDAST generation, which can be particularly useful for generating Markdown content dynamically or within content management systems that utilize MDAST.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install mdast-builder"],"cli":null},"imports":["import { root } from 'mdast-builder';","import { paragraph } from 'mdast-builder';","import { heading, text } from 'mdast-builder';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import {\n  root,\n  paragraph,\n  text,\n  heading,\n  list,\n  listItem,\n  brk\n} from 'mdast-builder';\nimport * as stringify from 'remark-stringify';\nimport * as unified from 'unified';\n\nconst processor = unified().use(stringify, {\n  bullet: '-',\n  fence: '`',\n  fences: true,\n  incrementListMarker: false\n});\n\nconst output = processor.stringify(\n  root([\n    heading(2, text('Begin')),\n    paragraph([\n      paragraph(text('these are the starting instructions')),\n      brk,\n      brk,\n      list('unordered', [\n        listItem(text('one')),\n        listItem(text('two')),\n        listItem(text('three'))\n      ])\n    ])\n  ])\n);\n\nconsole.log(output);\n/* Expected output:\n## Begin\n\nthese are the starting instructions\n\n- one\n- two\n- three\n*/\n","lang":"typescript","description":"Demonstrates building a simple MDAST tree with a heading, paragraph, and unordered list, then converting it to a Markdown string using `unified` and `remark-stringify`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}