[{"data":1,"prerenderedAt":206},["ShallowReactive",2],{"markdown-doc:\u002Fen\u002Fguide\u002Fextensions":3},{"id":4,"title":5,"body":6,"description":194,"extension":195,"keywords":196,"locale":197,"meta":198,"navigation":199,"order":200,"path":201,"section":202,"seo":203,"stem":204,"__hash__":205},"docs\u002Fguide\u002Fextensions.en.md","Custom syntax and nodes",{"type":7,"value":8,"toc":186},"minimark",[9,18,23,46,50,76,84,88,115,119,163,167],[10,11,12,13,17],"p",{},"To display ",[14,15,16],"code",{},"[[done]]"," as “Done”, first recognize the syntax and read its status, then render that status. A parsing extension handles recognition; a reading contribution handles presentation.",[19,20,22],"h2",{"id":21},"_1-reuse-a-parsing-extension","1. Reuse a parsing extension",[10,24,25,26,29,30,33,34,37,38,41,42,45],{},"Install existing MSFE ",[14,27,28],{},"Node"," \u002F ",[14,31,32],{},"Mark"," definitions through ",[14,35,36],{},"options.extensions",".\n",[14,39,40],{},"withMarkdownReading(extension, { render, load?, cacheKey? })"," adds reading to the same source codec.\nFields keep their ",[14,43,44],{},"addAttributes"," defaults and validation; invalid values and incomplete\nsyntax retain source. Configure or extend the extension before wrapping its reading contribution.",[19,47,49],{"id":48},"_2-display-the-status","2. Display the status",[10,51,52,53,56,57,60,61,64,65,68,69,72,73,75],{},"The example's ",[14,54,55],{},"status\u002Freading.ts"," passes ",[14,58,59],{},"Status"," to ",[14,62,63],{},"withMarkdownReading()"," and returns “To do” or “Done” from ",[14,66,67],{},"attrs.value",". Readers see a label while the saved source remains ",[14,70,71],{},"[[todo]]"," or ",[14,74,16],{},".",[10,77,78,79,29,81,83],{},"This example defines ",[14,80,71],{},[14,82,16],{}," grammar, replaces links and enables\nHTML. Stream characters to observe incomplete nodes, HTML and late reference updates together.",[85,86],"docs-demo",{"name":87},"reading\u002Fcustom",[10,89,90,91,94,95,98,99,101,102,105,106,109,110,75],{},"Read the complete example by file: ",[14,92,93],{},"status\u002Fstatus.ts"," defines syntax and fields, ",[14,96,97],{},"status\u002Ftypes.ts"," defines the status value type, ",[14,100,55],{}," defines reading output, and ",[14,103,104],{},"reading\u002Fcustom.vue"," supplies the reader configuration. A separate ",[14,107,108],{},"reading\u002Flink.vue"," replaces links, as explained in ",[111,112,114],"a",{"href":113},"\u002Fen\u002Fguide\u002Fcomponents","Custom components",[19,116,118],{"id":117},"_3-handle-children-and-asynchronous-resources","3. Handle children and asynchronous resources",[10,120,121,124,125,128,129,128,132,128,135,138,139,29,142,145,146,149,150,153,154,158,159,162],{},[14,122,123],{},"render"," receives read-only ",[14,126,127],{},"document",", ",[14,130,131],{},"node",[14,133,134],{},"attrs",[14,136,137],{},"locale"," and range-checked\n",[14,140,141],{},"renderInline()",[14,143,144],{},"renderBlocks()"," helpers. Custom blocks can recursively render their\nparsed children. ",[14,147,148],{},"load(context, signal)"," returns ",[14,151,152],{},"{ value, release? }"," or a Promise for it.\nReplacing the snapshot\u002Fmessage or unmounting cancels old work; late results are released too.\nUnchanged blocks retain resources when they satisfy the ",[111,155,157],{"href":156},"\u002Fen\u002Fguide\u002Fperformance","cache dependency contract",".\nReading, rendering and loading failures emit ",[14,160,161],{},"error"," and preserve that node's source.",[19,164,166],{"id":165},"more-complex-syntax","More complex syntax",[10,168,169,170,173,174,177,178,181,182,185],{},"For more complex grammar, install native Lezer ",[14,171,172],{},"MarkdownExtension"," values, including block\nand inline parsers, through ",[14,175,176],{},"options.syntax",", then interpret fields with a source codec.\nFor direct read-only projection, ",[14,179,180],{},"renderNode(context, node)"," can handle named syntax nodes;\nreturn ",[14,183,184],{},"undefined"," to use built-in dispatch. Grammar and fields belong to source extensions;\npresentation belongs to reading contributions, without regex replacements on rendered HTML.",{"title":187,"searchDepth":188,"depth":188,"links":189},"",2,[190,191,192,193],{"id":21,"depth":188,"text":22},{"id":48,"depth":188,"text":49},{"id":117,"depth":188,"text":118},{"id":165,"depth":188,"text":166},"Add parsing and reading support for application syntax, using task status markers.","md",null,"en",{},true,5,"\u002Fen\u002Fguide\u002Fextensions","Extensions and rendering",{"title":5,"description":194},"guide\u002Fextensions.en","U1uoJOWYEhtjdcR3hlnwkCi8m7DlPZAbVzxcrnRj2dg",1793045320730]