@kubb/parser-md 5.8.3 → 5.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -4,12 +4,12 @@ let _kubb_kit = require("@kubb/kit");
4
4
  let yaml = require("yaml");
5
5
  //#region kubb-extension.json
6
6
  var compatibility = {
7
- "kubb": ">=5.8.0",
7
+ "kubb": ">=5.8.3",
8
8
  "node": ">=22"
9
9
  };
10
10
  //#endregion
11
11
  //#region package.json
12
- var version = "5.8.3";
12
+ var version = "5.9.0";
13
13
  //#endregion
14
14
  //#region src/utils.ts
15
15
  /**
package/dist/index.js CHANGED
@@ -3,12 +3,12 @@ import { ast, defineExtension } from "@kubb/kit";
3
3
  import { stringify } from "yaml";
4
4
  //#region kubb-extension.json
5
5
  var compatibility = {
6
- "kubb": ">=5.8.0",
6
+ "kubb": ">=5.8.3",
7
7
  "node": ">=22"
8
8
  };
9
9
  //#endregion
10
10
  //#region package.json
11
- var version = "5.8.3";
11
+ var version = "5.9.0";
12
12
  //#endregion
13
13
  //#region src/utils.ts
14
14
  /**
package/docs/options.md CHANGED
@@ -25,7 +25,7 @@ const file = ast.factory.createFile({
25
25
  meta: {
26
26
  frontmatter: { title: 'API Reference', layout: 'doc' },
27
27
  },
28
- sources: [ast.factory.createSource({ nodes: [ast.factory.createText('# API Reference')] })],
28
+ sources: [ast.factory.createSource({ nodes: [ast.factory.createText('Endpoints generated from the OpenAPI spec.')] })],
29
29
  })
30
30
  ```
31
31
 
@@ -35,7 +35,7 @@ title: API Reference
35
35
  layout: doc
36
36
  ---
37
37
 
38
- # API Reference
38
+ Endpoints generated from the OpenAPI spec.
39
39
  ```
40
40
 
41
41
  ::
package/docs/overview.md CHANGED
@@ -1,24 +1,37 @@
1
- # Markdown parser
1
+ # Markdown
2
2
 
3
- The Markdown parser writes `.md` and `.markdown` files. It joins a file's source blocks as plain Markdown, separated by blank lines. When the file sets [`meta.frontmatter`](https://kubb.dev/extensions/kubb-labs/parser-md/options#frontmatter), it adds that object as YAML frontmatter at the top.
4
-
5
- It takes no options. Kubb registers it by default with the TypeScript parsers.
3
+ The Markdown parser joins a file's source blocks as plain Markdown, separated by blank lines. When a file sets `meta.frontmatter`, the parser writes that object as YAML frontmatter above the content, after the file banner if one is set.
6
4
 
7
5
  ## Setup
8
6
 
9
- Add it yourself only when you set a custom `parsers` array, since that array replaces the default set. List every parser your plugins need. Files no parser claims are written as their source text.
7
+ With `defineConfig` from `kubb/config`, Kubb registers the parser by default, next to `parserTs` and `parserTsx`, so no setup is needed. Bundler integrations leave it out. Add it yourself only when you set a custom `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.
8
+
9
+ ## Options worth knowing
10
+
11
+ The parser takes no options. Plugins control the output through `meta.frontmatter` on each file, and an empty object writes none.
12
+
13
+ See [Options](https://kubb.dev/extensions/kubb-labs/parser-md/options) for how a plugin sets frontmatter.
10
14
 
11
15
  ## Example
12
16
 
17
+ The config below sets a custom `parsers` array and keeps the Markdown parser in it.
18
+
13
19
  ```typescript [kubb.config.ts]
14
20
  import { defineConfig } from 'kubb/config'
15
21
  import { parserMd } from '@kubb/parser-md'
16
22
  import { parserTs, parserTsx } from '@kubb/parser-ts'
23
+ import { pluginTs } from '@kubb/plugin-ts'
17
24
 
18
25
  export default defineConfig({
19
26
  input: './petStore.yaml',
20
27
  output: { path: './src/gen' },
21
- parsers: [parserTs(), parserTsx(), parserMd()],
22
- plugins: [],
28
+ parsers: [
29
+ parserTs(),
30
+ parserTsx(),
31
+ parserMd(),
32
+ ],
33
+ plugins: [
34
+ pluginTs(),
35
+ ],
23
36
  })
24
37
  ```
@@ -13,7 +13,7 @@
13
13
  "docs": "https://kubb.dev/extensions/kubb-labs/parser-md",
14
14
  "maintainers": [{ "name": "Stijn Van Hulle", "github": "stijnvanhulle" }],
15
15
  "compatibility": {
16
- "kubb": ">=5.8.0",
16
+ "kubb": ">=5.8.3",
17
17
  "node": ">=22"
18
18
  }
19
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/parser-md",
3
- "version": "5.8.3",
3
+ "version": "5.9.0",
4
4
  "description": "Markdown source file parser for Kubb. Converts the universal AST to `.md` source and renders YAML frontmatter via the `print` helper.",
5
5
  "keywords": [
6
6
  "codegen",
@@ -60,7 +60,7 @@
60
60
  "registry": "https://registry.npmjs.org/"
61
61
  },
62
62
  "dependencies": {
63
- "@kubb/kit": "5.8.3",
63
+ "@kubb/kit": "5.9.0",
64
64
  "yaml": "^2.9.1"
65
65
  },
66
66
  "engines": {