[{"data":1,"prerenderedAt":424},["ShallowReactive",2],{"page:\u002Fextensions\u002Fkubb-labs\u002Fparser-md":3},{"id":4,"frontmatter":5,"title":6,"heading":6,"body":7,"path":423,"source":4},"extensions\u002Fkubb-labs\u002Fparser-md\u002Findex.md",{},"Markdown",{"type":8,"value":9,"toc":414},"minimark",[10,19,24,110,131,135,158,162,168,176,180,186],[11,12,13,14,18],"p",{},"The Markdown parser joins a file's source blocks as plain Markdown, separated by blank lines. When a file sets ",[15,16,17],"code",{},"meta.frontmatter",", the parser writes that object as YAML frontmatter above the content, after the file banner if one is set.",[20,21,23],"h2",{"id":22},"installation","Installation",[25,26,28,57,75,93],"code-group",{"sync":27},"package-manager",[29,30,35],"pre",{"language":31,"filename":32,"code":33,"class":34},"shell","bun","bun add -d @kubb\u002Fparser-md","highlights",[15,36,38],{"class":37},"language-shell",[39,40,43,47,51,54],"span",{"class":41,"style":42},"line","display: inline",[39,44,46],{"style":45},"color:#6f42c1;--hls-dark:#b392f0","bun ",[39,48,50],{"style":49},"color:#24292e;--hls-dark:#e1e4e8","add -d ",[39,52,53],{"style":49},"@",[39,55,56],{"style":49},"kubb\u002Fparser-md",[29,58,61],{"language":31,"filename":59,"code":60,"class":34},"pnpm","pnpm add -D @kubb\u002Fparser-md",[15,62,63],{"class":37},[39,64,65,68,71,73],{"class":41,"style":42},[39,66,67],{"style":45},"pnpm ",[39,69,70],{"style":49},"add -D ",[39,72,53],{"style":49},[39,74,56],{"style":49},[29,76,79],{"language":31,"filename":77,"code":78,"class":34},"npm","npm install --save-dev @kubb\u002Fparser-md",[15,80,81],{"class":37},[39,82,83,86,89,91],{"class":41,"style":42},[39,84,85],{"style":45},"npm ",[39,87,88],{"style":49},"install --save-dev ",[39,90,53],{"style":49},[39,92,56],{"style":49},[29,94,97],{"language":31,"filename":95,"code":96,"class":34},"yarn","yarn add -D @kubb\u002Fparser-md",[15,98,99],{"class":37},[39,100,101,104,106,108],{"class":41,"style":42},[39,102,103],{"style":45},"yarn ",[39,105,70],{"style":49},[39,107,53],{"style":49},[39,109,56],{"style":49},[11,111,112,113,116,117,122,123,126,127,130],{},"Or run ",[15,114,115],{},"kubb add parser-md"," to install the version the ",[118,119,121],"a",{"href":120},"\u002Fregistry","Kubb registry"," pins and add ",[15,124,125],{},"parserMd()"," to ",[15,128,129],{},"kubb.config.ts",".",[20,132,134],{"id":133},"setup","Setup",[11,136,137,138,141,142,145,146,149,150,153,154,157],{},"With ",[15,139,140],{},"defineConfig"," from ",[15,143,144],{},"kubb\u002Fconfig",", Kubb registers the parser by default, next to ",[15,147,148],{},"parserTs"," and ",[15,151,152],{},"parserTsx",", so no setup is needed. Bundler integrations leave it out. Add it yourself only when you set a custom ",[15,155,156],{},"parsers"," array, because that array replaces the default set. List every parser your plugins need. Files that no parser claims are written as their source text only, without imports, exports, banner, or footer.",[20,159,161],{"id":160},"options-worth-knowing","Options worth knowing",[11,163,164,165,167],{},"The parser takes no options. Plugins control the output through ",[15,166,17],{}," on each file, and an empty object writes none.",[11,169,170,171,175],{},"See ",[118,172,174],{"href":173},"https:\u002F\u002Fkubb.dev\u002Fextensions\u002Fkubb-labs\u002Fparser-md\u002Foptions","Options"," for how a plugin sets frontmatter.",[20,177,179],{"id":178},"example","Example",[11,181,182,183,185],{},"The config below sets a custom ",[15,184,156],{}," array and keeps the Markdown parser in it.",[29,187,190],{"language":188,"filename":129,"code":189,"class":34},"typescript","import { defineConfig } from 'kubb\u002Fconfig'\nimport { parserMd } from '@kubb\u002Fparser-md'\nimport { parserTs, parserTsx } from '@kubb\u002Fparser-ts'\nimport { pluginTs } from '@kubb\u002Fplugin-ts'\n\nexport default defineConfig({\n  input: '.\u002FpetStore.yaml',\n  output: { path: '.\u002Fsrc\u002Fgen' },\n  parsers: [\n    parserTs(),\n    parserTsx(),\n    parserMd(),\n  ],\n  plugins: [\n    pluginTs(),\n  ],\n})",[15,191,193,216,217,216,233,216,254,216,270,216,272,216,285,216,302,216,326,216,337,216,349,216,359,216,370,216,379,216,390,216,401,216,409],{"class":192},"language-typescript",[39,194,195,199,203,206,209,212],{"class":41,"style":42},[39,196,198],{"style":197},"color:#d73a49;--hls-dark:#f97583","import ",[39,200,202],{"style":201},"color:#005cc5;--hls-dark:#79b8ff","{ ",[39,204,205],{"style":49},"defineConfig ",[39,207,208],{"style":201},"} ",[39,210,211],{"style":197},"from ",[39,213,215],{"style":214},"color:#032f62;--hls-dark:#9ecbff","'kubb\u002Fconfig'","\n",[39,218,219,221,223,226,228,230],{"class":41,"style":42},[39,220,198],{"style":197},[39,222,202],{"style":201},[39,224,225],{"style":49},"parserMd ",[39,227,208],{"style":201},[39,229,211],{"style":197},[39,231,232],{"style":214},"'@kubb\u002Fparser-md'",[39,234,235,237,239,241,244,247,249,251],{"class":41,"style":42},[39,236,198],{"style":197},[39,238,202],{"style":201},[39,240,148],{"style":49},[39,242,243],{"style":197},", ",[39,245,246],{"style":49},"parserTsx ",[39,248,208],{"style":201},[39,250,211],{"style":197},[39,252,253],{"style":214},"'@kubb\u002Fparser-ts'",[39,255,256,258,260,263,265,267],{"class":41,"style":42},[39,257,198],{"style":197},[39,259,202],{"style":201},[39,261,262],{"style":49},"pluginTs ",[39,264,208],{"style":201},[39,266,211],{"style":197},[39,268,269],{"style":214},"'@kubb\u002Fplugin-ts'",[39,271],{"class":41,"style":42},[39,273,274,277,280,282],{"class":41,"style":42},[39,275,276],{"style":197},"export ",[39,278,279],{"style":197},"default ",[39,281,140],{"style":45},[39,283,284],{"style":201},"({",[39,286,287,290,293,296,299],{"class":41,"style":42},[39,288,289],{"style":201},"  ",[39,291,292],{"style":201},"input",[39,294,295],{"style":197},": ",[39,297,298],{"style":214},"'.\u002FpetStore.yaml'",[39,300,301],{"style":197},",",[39,303,304,306,309,311,313,316,318,321,324],{"class":41,"style":42},[39,305,289],{"style":197},[39,307,308],{"style":201},"output",[39,310,295],{"style":197},[39,312,202],{"style":201},[39,314,315],{"style":201},"path",[39,317,295],{"style":197},[39,319,320],{"style":214},"'.\u002Fsrc\u002Fgen' ",[39,322,323],{"style":201},"}",[39,325,301],{"style":197},[39,327,328,330,332,334],{"class":41,"style":42},[39,329,289],{"style":197},[39,331,156],{"style":201},[39,333,295],{"style":197},[39,335,336],{"style":201},"[",[39,338,339,342,344,347],{"class":41,"style":42},[39,340,341],{"style":201},"    ",[39,343,148],{"style":45},[39,345,346],{"style":201},"()",[39,348,301],{"style":197},[39,350,351,353,355,357],{"class":41,"style":42},[39,352,341],{"style":197},[39,354,152],{"style":45},[39,356,346],{"style":201},[39,358,301],{"style":197},[39,360,361,363,366,368],{"class":41,"style":42},[39,362,341],{"style":197},[39,364,365],{"style":45},"parserMd",[39,367,346],{"style":201},[39,369,301],{"style":197},[39,371,372,374,377],{"class":41,"style":42},[39,373,289],{"style":197},[39,375,376],{"style":201},"]",[39,378,301],{"style":197},[39,380,381,383,386,388],{"class":41,"style":42},[39,382,289],{"style":197},[39,384,385],{"style":201},"plugins",[39,387,295],{"style":197},[39,389,336],{"style":201},[39,391,392,394,397,399],{"class":41,"style":42},[39,393,341],{"style":201},[39,395,396],{"style":45},"pluginTs",[39,398,346],{"style":201},[39,400,301],{"style":197},[39,402,403,405,407],{"class":41,"style":42},[39,404,289],{"style":197},[39,406,376],{"style":201},[39,408,301],{"style":197},[39,410,411],{"class":41,"style":42},[39,412,413],{"style":201},"})",{"title":415,"searchDepth":416,"depth":416,"links":417},"",5,[418,420,421,422],{"id":22,"depth":419,"text":23},2,{"id":133,"depth":419,"text":134},{"id":160,"depth":419,"text":161},{"id":178,"depth":419,"text":179},"\u002Fextensions\u002Fkubb-labs\u002Fparser-md",1793615942381]