@kubb/parser-md 5.0.0-beta.52 → 5.0.0-beta.53

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.
Files changed (2) hide show
  1. package/package.json +2 -3
  2. package/extension.yaml +0 -92
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/parser-md",
3
- "version": "5.0.0-beta.52",
3
+ "version": "5.0.0-beta.53",
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",
@@ -20,7 +20,6 @@
20
20
  "files": [
21
21
  "src",
22
22
  "dist",
23
- "extension.yaml",
24
23
  "!/**/**.test.**",
25
24
  "!/**/__tests__/**",
26
25
  "!/**/__snapshots__/**"
@@ -43,7 +42,7 @@
43
42
  },
44
43
  "dependencies": {
45
44
  "yaml": "^2.9.0",
46
- "@kubb/core": "5.0.0-beta.52"
45
+ "@kubb/core": "5.0.0-beta.53"
47
46
  },
48
47
  "devDependencies": {
49
48
  "@internals/utils": "0.0.0"
package/extension.yaml DELETED
@@ -1,92 +0,0 @@
1
- $schema: https://kubb.dev/schemas/extension.json
2
- kind: parser
3
- id: parser-md
4
- name: Markdown
5
- description: Markdown file parser for Kubb. Joins source blocks as plain markdown and renders YAML frontmatter via `parserMd.print`.
6
- category: docs
7
- type: official
8
- npmPackage: '@kubb/parser-md'
9
- docsPath: /parsers/parser-md
10
- repo: https://github.com/kubb-labs/kubb
11
- maintainers:
12
- - name: Stijn Van Hulle
13
- github: stijnvanhulle
14
- compatibility:
15
- kubb: '>=5.0.0'
16
- node: '>=22'
17
- tags:
18
- - markdown
19
- - frontmatter
20
- - parser
21
- - docs
22
- - yaml
23
- resources:
24
- documentation: https://kubb.dev/parsers/parser-md
25
- repository: https://github.com/kubb-labs/kubb
26
- issues: https://github.com/kubb-labs/kubb/issues
27
- changelog: https://github.com/kubb-labs/kubb/blob/main/packages/parser-md/CHANGELOG.md
28
- featured: false
29
- intro: |-
30
- `@kubb/parser-md` lets Kubb emit `.md` and `.markdown` files. Register it alongside `parserTs` and any plugin that writes a markdown source will have its output serialized automatically.
31
-
32
- The parser joins source blocks with blank lines. When `file.meta.frontmatter` is set, it prepends the YAML envelope — no separate `yaml` dependency needed. Pair it with `parserTs` when a generator emits both TypeScript and documentation files side by side.
33
- options:
34
- - name: frontmatter
35
- type: 'Record<string, unknown> | null'
36
- required: false
37
- default: 'undefined'
38
- description: |-
39
- Set `frontmatter` on `file.meta` inside a plugin to have the parser prepend a YAML frontmatter block. Any serializable key-value object works.
40
- codeBlock:
41
- lang: typescript
42
- title: plugin example
43
- twoslash: false
44
- code: |-
45
- createFile({
46
- baseName: 'README.md',
47
- path: `${config.output.path}/README.md`,
48
- meta: {
49
- frontmatter: { title: 'API Reference', layout: 'doc' },
50
- },
51
- sources: [...],
52
- })
53
- examples:
54
- - name: Standalone markdown
55
- files:
56
- - name: kubb.config.ts
57
- lang: typescript
58
- twoslash: false
59
- code: |-
60
- import { defineConfig } from 'kubb'
61
- import { adapterOas } from '@kubb/adapter-oas'
62
- import { parserMd } from '@kubb/parser-md'
63
-
64
- export default defineConfig({
65
- input: { path: './petStore.yaml' },
66
- output: { path: './src/gen' },
67
- adapter: adapterOas(),
68
- parsers: [parserMd],
69
- plugins: [],
70
- })
71
- - name: Markdown alongside TypeScript
72
- files:
73
- - name: kubb.config.ts
74
- lang: typescript
75
- twoslash: false
76
- code: |-
77
- import { defineConfig } from 'kubb'
78
- import { adapterOas } from '@kubb/adapter-oas'
79
- import { parserMd } from '@kubb/parser-md'
80
- import { parserTs } from '@kubb/parser-ts'
81
-
82
- export default defineConfig({
83
- input: { path: './petStore.yaml' },
84
- output: { path: './src/gen' },
85
- adapter: adapterOas(),
86
- parsers: [parserTs, parserMd],
87
- plugins: [],
88
- })
89
- notes:
90
- - type: tip
91
- body: |-
92
- `parserMd.print({ title: 'Pets', layout: 'doc' })` returns `---\ntitle: Pets\nlayout: doc\n---`. Render it from a plugin to inject frontmatter into a generated page without depending on `yaml` directly.