@valkyrianlabs/payload-markdown 1.3.4 → 1.4.1

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 (118) hide show
  1. package/README.md +64 -15
  2. package/dist/components/MarkdownRenderer/index.css +150 -0
  3. package/dist/components/MarkdownRenderer/index.scss +158 -0
  4. package/dist/core/plugins/rehypeResolveIcons.d.ts +4 -0
  5. package/dist/core/plugins/rehypeResolveIcons.js +27 -0
  6. package/dist/core/plugins/rehypeResolveIcons.js.map +1 -0
  7. package/dist/core/plugins/remarkButtonDirectives.d.ts +4 -0
  8. package/dist/core/plugins/remarkButtonDirectives.js +237 -0
  9. package/dist/core/plugins/remarkButtonDirectives.js.map +1 -0
  10. package/dist/core/plugins/remarkCompileLayouts.js +6 -5
  11. package/dist/core/plugins/remarkCompileLayouts.js.map +1 -1
  12. package/dist/core/plugins/remarkLayoutDirectives.js +17 -7
  13. package/dist/core/plugins/remarkLayoutDirectives.js.map +1 -1
  14. package/dist/core/plugins/remarkLiftLayoutDirectives.js +42 -4
  15. package/dist/core/plugins/remarkLiftLayoutDirectives.js.map +1 -1
  16. package/dist/core/renderMarkdown.js +27 -2
  17. package/dist/core/renderMarkdown.js.map +1 -1
  18. package/dist/directives/attributeDiagnostics.d.ts +2 -0
  19. package/dist/directives/attributeDiagnostics.js +35 -0
  20. package/dist/directives/attributeDiagnostics.js.map +1 -0
  21. package/dist/directives/attributes.d.ts +8 -0
  22. package/dist/directives/attributes.js +56 -5
  23. package/dist/directives/attributes.js.map +1 -1
  24. package/dist/directives/buttonSyntax.d.ts +7 -0
  25. package/dist/directives/buttonSyntax.js +26 -0
  26. package/dist/directives/buttonSyntax.js.map +1 -0
  27. package/dist/directives/closeLabels.d.ts +8 -0
  28. package/dist/directives/closeLabels.js +76 -0
  29. package/dist/directives/closeLabels.js.map +1 -0
  30. package/dist/directives/definitions/button.d.ts +15 -0
  31. package/dist/directives/definitions/button.js +96 -0
  32. package/dist/directives/definitions/button.js.map +1 -0
  33. package/dist/directives/definitions/buttons.d.ts +8 -0
  34. package/dist/directives/definitions/buttons.js +82 -0
  35. package/dist/directives/definitions/buttons.js.map +1 -0
  36. package/dist/directives/definitions/callout.js +20 -9
  37. package/dist/directives/definitions/callout.js.map +1 -1
  38. package/dist/directives/definitions/card.d.ts +4 -0
  39. package/dist/directives/definitions/card.js +90 -9
  40. package/dist/directives/definitions/card.js.map +1 -1
  41. package/dist/directives/definitions/cards.d.ts +4 -0
  42. package/dist/directives/definitions/cards.js +119 -4
  43. package/dist/directives/definitions/cards.js.map +1 -1
  44. package/dist/directives/definitions/details.js +4 -3
  45. package/dist/directives/definitions/details.js.map +1 -1
  46. package/dist/directives/definitions/tab.d.ts +1 -0
  47. package/dist/directives/definitions/tab.js +10 -3
  48. package/dist/directives/definitions/tab.js.map +1 -1
  49. package/dist/directives/definitions/tabs.js +3 -3
  50. package/dist/directives/definitions/tabs.js.map +1 -1
  51. package/dist/directives/definitions/toc.js +4 -3
  52. package/dist/directives/definitions/toc.js.map +1 -1
  53. package/dist/directives/diagnostics.js +97 -7
  54. package/dist/directives/diagnostics.js.map +1 -1
  55. package/dist/directives/iconPlaceholder.d.ts +12 -0
  56. package/dist/directives/iconPlaceholder.js +19 -0
  57. package/dist/directives/iconPlaceholder.js.map +1 -0
  58. package/dist/directives/labels.d.ts +3 -0
  59. package/dist/directives/labels.js +12 -0
  60. package/dist/directives/labels.js.map +1 -0
  61. package/dist/directives/registry.d.ts +1 -1
  62. package/dist/directives/registry.js +46 -6
  63. package/dist/directives/registry.js.map +1 -1
  64. package/dist/directives/renderData.d.ts +2 -2
  65. package/dist/directives/renderData.js.map +1 -1
  66. package/dist/directives/types.d.ts +6 -4
  67. package/dist/directives/types.js.map +1 -1
  68. package/dist/editor/MarkdownCodeMirror/Component.client.js +2 -0
  69. package/dist/editor/MarkdownCodeMirror/Component.client.js.map +1 -1
  70. package/dist/editor/directives/closeLabels.d.ts +2 -0
  71. package/dist/editor/directives/closeLabels.js +75 -0
  72. package/dist/editor/directives/closeLabels.js.map +1 -0
  73. package/dist/editor/directives/completions.js +49 -7
  74. package/dist/editor/directives/completions.js.map +1 -1
  75. package/dist/editor/themes/payload.js +197 -9
  76. package/dist/editor/themes/payload.js.map +1 -1
  77. package/dist/exports/advanced.d.ts +1 -0
  78. package/dist/exports/advanced.js +1 -0
  79. package/dist/exports/advanced.js.map +1 -1
  80. package/dist/icons/generateRegistry.d.ts +8 -0
  81. package/dist/icons/generateRegistry.js +36 -0
  82. package/dist/icons/generateRegistry.js.map +1 -0
  83. package/dist/icons/refs.d.ts +10 -0
  84. package/dist/icons/refs.js +42 -0
  85. package/dist/icons/refs.js.map +1 -0
  86. package/dist/icons/resolve.d.ts +9 -0
  87. package/dist/icons/resolve.js +95 -0
  88. package/dist/icons/resolve.js.map +1 -0
  89. package/dist/index.d.ts +1 -1
  90. package/dist/index.js.map +1 -1
  91. package/dist/runtime/index.d.ts +1 -0
  92. package/dist/runtime/index.js +8 -1
  93. package/dist/runtime/index.js.map +1 -1
  94. package/dist/types/core.d.ts +9 -0
  95. package/dist/types/core.js.map +1 -1
  96. package/dist/types/mdast.d.js.map +1 -1
  97. package/dist/types.d.ts +6 -2
  98. package/dist/types.js.map +1 -1
  99. package/package.json +3 -2
  100. package/skills/payload-markdown/claude/SKILL.md +56 -0
  101. package/skills/payload-markdown/claude/examples/docs-page.md +97 -0
  102. package/skills/payload-markdown/claude/examples/reference-page.md +75 -0
  103. package/skills/payload-markdown/claude/examples/release-notes.md +69 -0
  104. package/skills/payload-markdown/claude/reference/automated-docs-workflow.md +64 -0
  105. package/skills/payload-markdown/claude/reference/formatting.md +81 -0
  106. package/skills/payload-markdown/claude/reference/payload-markdown-directives.md +246 -0
  107. package/skills/payload-markdown/claude/reference/quality.md +48 -0
  108. package/skills/payload-markdown/claude/scripts/check_payload_markdown_doc.py +155 -0
  109. package/skills/payload-markdown/codex/SKILL.md +56 -0
  110. package/skills/payload-markdown/codex/agents/openai.yaml +4 -0
  111. package/skills/payload-markdown/codex/examples/docs-page.md +97 -0
  112. package/skills/payload-markdown/codex/examples/reference-page.md +75 -0
  113. package/skills/payload-markdown/codex/examples/release-notes.md +69 -0
  114. package/skills/payload-markdown/codex/reference/automated-docs-workflow.md +64 -0
  115. package/skills/payload-markdown/codex/reference/formatting.md +81 -0
  116. package/skills/payload-markdown/codex/reference/payload-markdown-directives.md +246 -0
  117. package/skills/payload-markdown/codex/reference/quality.md +48 -0
  118. package/skills/payload-markdown/codex/scripts/check_payload_markdown_doc.py +155 -0
@@ -0,0 +1,97 @@
1
+ ---
2
+ title: Installation
3
+ navTitle: Install
4
+ description: Install the package, register the plugin, and render Markdown content.
5
+ order: 20
6
+ status: published
7
+ tags:
8
+ - getting-started
9
+ - installation
10
+ ---
11
+
12
+ # Installation
13
+
14
+ Install the package, enable it for your Payload collections, and render Markdown with the server component.
15
+
16
+ :::toc[On this page]{depth="3" theme="compact"}
17
+ :::
18
+
19
+ :::callout[Before you start]{variant="info"}
20
+ This guide assumes a Payload 3 project with a working Next.js app.
21
+ :::
22
+
23
+ :::steps{
24
+ variant="cards"
25
+ layout="stack"
26
+ numbered
27
+ stepTheme="cyan"
28
+ }
29
+
30
+ ### Install The Package
31
+
32
+ ```bash
33
+ pnpm add @valkyrianlabs/payload-markdown
34
+ ```
35
+
36
+ ### Register The Plugin
37
+
38
+ Add `payloadMarkdown()` to the Payload config and enable the collections that should receive Markdown fields or blocks.
39
+
40
+ ### Render Content
41
+
42
+ Use `MarkdownRenderer` for standalone fields and `MarkdownBlockComponent` for `vlMdBlock` entries.
43
+
44
+ :::
45
+
46
+ ## Configuration Map
47
+
48
+ :::cards{
49
+ columns="3"
50
+ cardTheme="muted"
51
+ }
52
+
53
+ :::card[Fields And Blocks]{href="/getting-started/fields-and-blocks"}
54
+ Automatic install behavior and manual schema control.
55
+ :::
56
+
57
+ :::card[Rendering]{href="/getting-started/rendering"}
58
+ Server-first Markdown output, scoped config, and fallback behavior.
59
+ :::
60
+
61
+ :::card[Code Blocks]{href="/configuration/code-blocks"}
62
+ Shiki languages, themes, line numbers, and full-bleed code.
63
+ :::
64
+
65
+ :::
66
+
67
+ ## Package Manager Alternatives
68
+
69
+ :::tabs{
70
+ default="pnpm"
71
+ theme="glass"
72
+ tabTheme="muted"
73
+ }
74
+
75
+ :::tab[pnpm]{value="pnpm"}
76
+ ```bash
77
+ pnpm add @valkyrianlabs/payload-markdown
78
+ ```
79
+ :::
80
+
81
+ :::tab[npm]{value="npm"}
82
+ ```bash
83
+ npm install @valkyrianlabs/payload-markdown
84
+ ```
85
+ :::
86
+
87
+ :::tab[yarn]{value="yarn"}
88
+ ```bash
89
+ yarn add @valkyrianlabs/payload-markdown
90
+ ```
91
+ :::
92
+
93
+ :::
94
+
95
+ :::details[When to configure icons]
96
+ Configure local SVG icon packs only when authored content uses `icon="@pack/name"` on buttons, cards, or callouts.
97
+ :::
@@ -0,0 +1,75 @@
1
+ ---
2
+ title: Renderer API
3
+ navTitle: Renderer
4
+ description: Render Markdown fields and blocks with server-first components.
5
+ order: 80
6
+ status: published
7
+ tags:
8
+ - reference
9
+ - rendering
10
+ ---
11
+
12
+ # Renderer API
13
+
14
+ Use the server renderer for Markdown fields and the block component for `vlMdBlock` layout entries.
15
+
16
+ :::toc[On this page]{depth="3" theme="compact"}
17
+ :::
18
+
19
+ ## Exports
20
+
21
+ :::cards{
22
+ columns="2"
23
+ cardTheme="glass"
24
+ }
25
+
26
+ :::card[MarkdownRenderer]
27
+ Server component for Markdown strings stored in fields or loaded from another source.
28
+ :::
29
+
30
+ :::card[MarkdownBlockComponent]
31
+ Server component for Payload block data with `blockType: "vlMdBlock"`.
32
+ :::
33
+
34
+ :::
35
+
36
+ ## Field Rendering
37
+
38
+ ```tsx
39
+ import { MarkdownRenderer } from '@valkyrianlabs/payload-markdown/server'
40
+
41
+ export function PostBody({ content }: { content?: null | string }) {
42
+ return (
43
+ <MarkdownRenderer
44
+ collectionSlug="posts"
45
+ markdown={content}
46
+ scope="field"
47
+ variant="docs"
48
+ />
49
+ )
50
+ }
51
+ ```
52
+
53
+ :::callout[Collection scope]{variant="tip"}
54
+ Pass `collectionSlug` when collection-level `code`, `themes`, or `config` should apply.
55
+ :::
56
+
57
+ ## Block Rendering
58
+
59
+ ```tsx
60
+ import { MarkdownBlockComponent } from '@valkyrianlabs/payload-markdown/server'
61
+
62
+ export function RenderMarkdownBlock({ block }: { block: { blockType: 'vlMdBlock'; content: string } }) {
63
+ return <MarkdownBlockComponent {...block} collectionSlug="pages" />
64
+ }
65
+ ```
66
+
67
+ :::callout[Direct props]{variant="warning"}
68
+ Pass block fields directly with `{...block}`. Do not wrap the data in a `block` prop.
69
+ :::
70
+
71
+ ## Fallbacks
72
+
73
+ :::details[Empty and warning fallback behavior]
74
+ `emptyFallback` renders when Markdown is empty or whitespace-only. `errorFallback` renders when compilation produces warnings and you prefer not to show the compiled HTML.
75
+ :::
@@ -0,0 +1,69 @@
1
+ ---
2
+ title: Version 1.4.0
3
+ navTitle: v1.4.0
4
+ description: New authoring primitives, icon packs, and directive improvements.
5
+ order: 10
6
+ status: published
7
+ tags:
8
+ - releases
9
+ - changelog
10
+ ---
11
+
12
+ # Version 1.4.0
13
+
14
+ Version 1.4.0 improves directive authoring, local SVG icon usage, and rich docs composition.
15
+
16
+ :::toc[On this page]{depth="3" theme="compact"}
17
+ :::
18
+
19
+ ## Highlights
20
+
21
+ :::cards{
22
+ columns="3"
23
+ theme="spacious"
24
+ cardTheme="glass"
25
+ }
26
+
27
+ :::card[Readable Labels]{eyebrow="Authoring"}
28
+ Use `[Title]` directive labels for visible titles instead of dense attribute lists.
29
+ :::
30
+
31
+ :::card[Local Icons]{eyebrow="Rendering"}
32
+ Reference local SVG packs with `@pack/name` on buttons, cards, and callouts.
33
+ :::
34
+
35
+ :::card[Safer Links]{eyebrow="Cards"}
36
+ Use `linkScope="title"` when card bodies contain nested links or buttons.
37
+ :::
38
+
39
+ :::
40
+
41
+ ## Migration Notes
42
+
43
+ :::callout[No stored content migration required]{variant="success"}
44
+ Existing `title=""` directive attributes remain supported. New docs should prefer `[Label]`.
45
+ :::
46
+
47
+ :::details[Code config aliases]
48
+ Legacy `config.options` code settings still work, but new docs should use the top-level `code` namespace.
49
+ :::
50
+
51
+ ## Upgrade Steps
52
+
53
+ :::steps
54
+
55
+ ### Update The Package
56
+
57
+ ```bash
58
+ pnpm up @valkyrianlabs/payload-markdown
59
+ ```
60
+
61
+ ### Review Custom Themes
62
+
63
+ Confirm theme objects use `classes`, not `className`.
64
+
65
+ ### Refresh Examples
66
+
67
+ Prefer labels, multiline attributes, and card link scopes in new docs.
68
+
69
+ :::
@@ -0,0 +1,64 @@
1
+ # Automated Docs Workflow
2
+
3
+ Use this workflow when generating or maintaining docs with Payload Markdown.
4
+
5
+ ## 1. Build The Source Model
6
+
7
+ Before writing, inspect the real project surface:
8
+
9
+ - package metadata and exported entry points
10
+ - README and existing docs
11
+ - public types and config names
12
+ - examples, tests, fixtures, and generated types
13
+ - CLI commands, route names, environment variables, and migration notes
14
+
15
+ Do not describe a feature as implemented unless the source proves it.
16
+
17
+ ## 2. Choose The Page Type
18
+
19
+ Use the page type to decide which directives belong:
20
+
21
+ - Overview: cards for page maps, callouts for positioning, short sections.
22
+ - Installation: steps, tabs for package managers, warnings for prerequisites.
23
+ - Usage guide: steps, callouts, details for optional branches.
24
+ - API reference: TOC, dense headings, small cards for related APIs.
25
+ - Migration: danger/warning callouts, steps, details for rollback notes.
26
+ - Troubleshooting: callouts for symptoms, details for error shapes, cards for common causes.
27
+ - Release notes: cards for highlights, details for compatibility notes.
28
+
29
+ ## 3. Draft With A Clear Reading Path
30
+
31
+ Write the page in this order:
32
+
33
+ 1. H1 with the page topic.
34
+ 2. One short paragraph that says what the page helps the reader do.
35
+ 3. TOC on long pages.
36
+ 4. Main sections ordered from common workflow to advanced detail.
37
+ 5. Related links or next steps at the end.
38
+
39
+ Keep prose direct. Avoid marketing copy when the page is operational documentation.
40
+
41
+ ## 4. Add Directives For Structure
42
+
43
+ Use directives to make the document easier to scan:
44
+
45
+ - Use callouts for risk, caveats, and important context.
46
+ - Use steps for sequential procedures.
47
+ - Use cards for choice sets, related pages, or capability summaries.
48
+ - Use tabs for equivalent alternatives.
49
+ - Use details for optional information that would interrupt the main path.
50
+
51
+ Do not wrap every paragraph in a directive. The base format is still Markdown.
52
+
53
+ ## 5. Audit For Drift
54
+
55
+ During a docs audit, verify:
56
+
57
+ - option names and default values
58
+ - import paths and exported symbols
59
+ - directive names and attributes
60
+ - command names and flags
61
+ - file paths and route paths
62
+ - warnings, limitations, and migration behavior
63
+
64
+ Update docs when they differ from the implementation, even if the drift is small.
@@ -0,0 +1,81 @@
1
+ # Formatting Guidance
2
+
3
+ ## Frontmatter
4
+
5
+ When the docs system supports frontmatter, keep it simple and scalar-first:
6
+
7
+ ```yaml
8
+ ---
9
+ title: Installation
10
+ navTitle: Install
11
+ description: Install and configure the package.
12
+ order: 20
13
+ status: published
14
+ tags:
15
+ - getting-started
16
+ - installation
17
+ ---
18
+ ```
19
+
20
+ Use only fields that the target docs system supports. Do not invent navigation or publishing fields.
21
+
22
+ ## Page Structure
23
+
24
+ - Use exactly one H1.
25
+ - Start with a short summary paragraph.
26
+ - Use H2 for major tasks and H3 for subsections.
27
+ - Avoid skipping heading levels unless the surrounding docs already do.
28
+ - Put the TOC after the intro on long pages.
29
+
30
+ ## Links
31
+
32
+ - Use root-relative internal links inside a docs set, such as `/configuration/code-blocks`.
33
+ - Do not link to `.md` source paths unless documenting repository internals.
34
+ - Use external URLs only when the reader must leave the docs set.
35
+ - Prefer descriptive link text over "click here".
36
+
37
+ ## Code And Markdown Examples
38
+
39
+ Use language-tagged fences:
40
+
41
+ ````md
42
+ ```ts
43
+ payloadMarkdown({
44
+ collections: {
45
+ posts: true,
46
+ },
47
+ })
48
+ ```
49
+ ````
50
+
51
+ When documenting Markdown that contains fenced code blocks, make the outer fence longer than the inner fence:
52
+
53
+ `````md
54
+ ````md
55
+ :::steps
56
+
57
+ ### Install
58
+
59
+ ```bash
60
+ pnpm add package-name
61
+ ```
62
+
63
+ :::
64
+ ````
65
+ `````
66
+
67
+ ## Prose Style
68
+
69
+ - Prefer direct instructions.
70
+ - Use present tense for current behavior.
71
+ - Use "preferred" or "legacy" instead of implying older syntax is broken when it remains supported.
72
+ - Name defaults explicitly when users depend on them.
73
+ - Keep examples complete enough to copy.
74
+
75
+ ## What To Avoid
76
+
77
+ - MDX imports or JSX components unless the target project explicitly supports MDX.
78
+ - Raw HTML widgets for layout.
79
+ - Runtime Tailwind classes in authored Markdown.
80
+ - Unsupported directive names.
81
+ - Placeholder claims such as "fully customizable" without naming the customization surface.
@@ -0,0 +1,246 @@
1
+ # Payload Markdown Directives
2
+
3
+ Payload Markdown directives are Markdown-native structure. Use labels for visible titles and attributes for behavior.
4
+
5
+ ## Syntax Rules
6
+
7
+ - Prefer `[Label]` for visible names.
8
+ - Use multiline attributes when a directive has more than one or two attributes.
9
+ - Boolean attributes may be bare only where the directive supports them.
10
+ - Close container directives with `:::` unless a specific structural closer is clearer.
11
+
12
+ Example:
13
+
14
+ ```md
15
+ :::card[Fast Setup]{
16
+ href="/getting-started/installation"
17
+ linkScope="title"
18
+ icon="@fa-duotone/bolt"
19
+ }
20
+ Install, configure, ship.
21
+ :::
22
+ ```
23
+
24
+ ## Directive Inventory
25
+
26
+ - `:::callout`
27
+ - `:::details`
28
+ - `:::toc`
29
+ - `:::steps`
30
+ - `:::cards`
31
+ - `:::card`
32
+ - `::button`
33
+ - `:::buttons`
34
+ - `:::tabs`
35
+ - `:::tab`
36
+ - `:::section`
37
+ - `:::2col`
38
+ - `:::3col`
39
+ - `:::cell`
40
+
41
+ ## Callouts
42
+
43
+ Use callouts for information that changes how the reader should interpret or execute a task.
44
+
45
+ Attributes:
46
+
47
+ - `variant`: `note`, `info`, `tip`, `warning`, `danger`, or `success`
48
+ - `theme`: `soft`, `solid`, `glass`, or a configured theme
49
+ - `icon`: local icon reference
50
+ - `[Label]` or legacy `title`
51
+
52
+ ```md
53
+ :::callout[Production migration]{variant="danger"}
54
+ Back up production data before reconciling schema changes.
55
+ :::
56
+ ```
57
+
58
+ ## Details
59
+
60
+ Use details for optional information, caveats, error shapes, compatibility notes, or advanced paths.
61
+
62
+ Attributes:
63
+
64
+ - `[Label]` or legacy `title`
65
+ - `open`: `open="true"` for initially open
66
+ - `theme`: `default`, `muted`, `glass`, or a configured theme
67
+
68
+ ```md
69
+ :::details[Advanced notes]{theme="glass"}
70
+ These notes are useful after the basic setup is working.
71
+ :::
72
+ ```
73
+
74
+ ## Table Of Contents
75
+
76
+ Use a TOC on long pages with several H2 or H3 sections.
77
+
78
+ Attributes:
79
+
80
+ - `[Label]` or legacy `title`
81
+ - `depth`: `1` through `6`
82
+ - `theme`: `default`, `compact`, `sidebar`, or a configured theme
83
+
84
+ ```md
85
+ :::toc[On this page]{depth="3" theme="compact"}
86
+ :::
87
+ ```
88
+
89
+ ## Steps
90
+
91
+ Use steps for ordered procedures. Start each step with a heading.
92
+
93
+ Attributes:
94
+
95
+ - `variant`: `default` or `cards`
96
+ - `layout`: `stack` or `grid` for card steps
97
+ - `columns`: `1`, `2`, `3`, `4`, or `auto` for card-step grid layout
98
+ - `numbered`: generated visible numbers for card steps
99
+ - `theme`: steps wrapper theme
100
+ - `stepTheme`: card theme for individual step cards
101
+
102
+ ```md
103
+ :::steps{
104
+ variant="cards"
105
+ layout="stack"
106
+ numbered
107
+ stepTheme="cyan"
108
+ }
109
+
110
+ ### Install
111
+
112
+ Install the package.
113
+
114
+ ### Configure
115
+
116
+ Register the plugin.
117
+
118
+ :::
119
+ ```
120
+
121
+ ## Cards
122
+
123
+ Use cards for page maps, capability groups, related links, and compact summaries.
124
+
125
+ `:::cards` attributes:
126
+
127
+ - `columns`: `1`, `2`, `3`, `4`, or `auto`
128
+ - `href`: inherited or section-level link
129
+ - `linkScope`: `section`, `card`, or `title`
130
+ - `newTab`: open links in a new tab
131
+ - `theme`: cards container theme
132
+ - `cardTheme`: default child card theme
133
+
134
+ `:::card` attributes:
135
+
136
+ - `[Label]` or legacy `title`
137
+ - `eyebrow`
138
+ - `icon`
139
+ - `href`
140
+ - `linkScope`: `full` or `title`
141
+ - `newTab`
142
+ - `theme`
143
+
144
+ Use `linkScope="title"` when the card body contains buttons or links.
145
+
146
+ ```md
147
+ :::cards{
148
+ columns="3"
149
+ cardTheme="muted"
150
+ }
151
+
152
+ :::card[Configuration]{
153
+ href="/configuration"
154
+ linkScope="title"
155
+ }
156
+ Code, themes, icons, and renderer defaults.
157
+ :::
158
+
159
+ :::
160
+ ```
161
+
162
+ ## Buttons
163
+
164
+ Use button links for clear actions. Do not use snippet-only names such as `::button_icon` in source.
165
+
166
+ `::button` attributes:
167
+
168
+ - `href`: required
169
+ - `variant`: `primary`, `secondary`, `outline`, `ghost`, or `link`
170
+ - `size`: `sm`, `md`, or `lg`
171
+ - `icon`: local icon reference
172
+ - `iconPosition`: `left` or `right`
173
+ - `newTab`
174
+ - `ariaLabel` for icon-only buttons
175
+
176
+ `:::buttons` attributes:
177
+
178
+ - `align`: `left`, `center`, or `right`
179
+ - `stack`: `mobile`, `always`, or `never`
180
+ - `gap`: `sm`, `md`, or `lg`
181
+
182
+ ```md
183
+ :::buttons{align="center" stack="mobile" gap="md"}
184
+ ::button[Read Docs]{href="/getting-started" variant="primary"}
185
+ ::button[GitHub]{href="https://github.com/valkyrianlabs" variant="secondary" newTab=true}
186
+ :::
187
+ ```
188
+
189
+ ## Tabs
190
+
191
+ Use tabs for equivalent alternatives. Avoid tabs when the content is sequential.
192
+
193
+ `:::tabs` attributes:
194
+
195
+ - `default`: selected tab value on first render
196
+ - `theme`: tabs container theme
197
+ - `tabTheme`: default panel theme
198
+
199
+ `:::tab` attributes:
200
+
201
+ - `[Label]` or legacy `label`
202
+ - `value`
203
+ - `theme`
204
+ - `disabled`
205
+
206
+ ````md
207
+ :::tabs{default="pnpm" theme="glass" tabTheme="muted"}
208
+
209
+ :::tab[pnpm]{value="pnpm"}
210
+ ```bash
211
+ pnpm add package-name
212
+ ```
213
+ :::
214
+
215
+ :::tab[npm]{value="npm"}
216
+ ```bash
217
+ npm install package-name
218
+ ```
219
+ :::
220
+
221
+ :::
222
+ ````
223
+
224
+ ## Layout
225
+
226
+ Use layout directives sparingly for dense overview pages.
227
+
228
+ - `:::section` supports `theme`.
229
+ - `:::2col` and `:::3col` support `theme` and `cellTheme`.
230
+ - `:::cell` supports `theme`.
231
+ - `:::endcol` explicitly closes an active grid.
232
+ - `:::endsection` explicitly closes an active section.
233
+
234
+ ```md
235
+ :::2col{cellTheme="panel"}
236
+
237
+ ### Field Mode
238
+
239
+ Use for long-form docs, posts, and articles.
240
+
241
+ ### Block Mode
242
+
243
+ Use when Markdown is one block in a layout builder.
244
+
245
+ :::
246
+ ```
@@ -0,0 +1,48 @@
1
+ # Quality Checklist
2
+
3
+ Use this checklist before returning generated docs.
4
+
5
+ ## Accuracy
6
+
7
+ - Public names match source exactly.
8
+ - Defaults are stated only when verified.
9
+ - Deprecated features are labeled as supported legacy paths, not removed behavior.
10
+ - Examples use real import paths, config keys, and commands.
11
+ - Warnings and limitations are visible near the relevant instructions.
12
+
13
+ ## Structure
14
+
15
+ - One H1 per page.
16
+ - H2 sections follow the user's workflow.
17
+ - TOC appears on long pages.
18
+ - Cards summarize choices or related links.
19
+ - Steps are reserved for sequential work.
20
+ - Details contain optional content, not required setup.
21
+
22
+ ## Directive Hygiene
23
+
24
+ - Only supported directives are used.
25
+ - Visible titles use `[Label]`.
26
+ - Multiline attributes are used for dense directives.
27
+ - `linkScope="title"` is used for cards containing buttons or links.
28
+ - Button directives include `href`.
29
+ - Icon-only buttons include `ariaLabel`.
30
+ - Tabs have stable `value` attributes.
31
+
32
+ ## Markdown Hygiene
33
+
34
+ - Internal docs links are root-relative.
35
+ - Fenced code blocks use language tags.
36
+ - Markdown-in-Markdown examples use outer fences longer than inner fences.
37
+ - No MDX imports, JSX widgets, or arbitrary HTML layout.
38
+ - No runtime Tailwind classes in authored Markdown unless the target project explicitly allows it.
39
+
40
+ ## Automated Checks
41
+
42
+ Run:
43
+
44
+ ```bash
45
+ python3 skills/payload-markdown/codex/scripts/check_payload_markdown_doc.py path/to/docs.md
46
+ ```
47
+
48
+ If working inside a downstream docs package, run its docs validation command as well.