Skip to content

Commit 45745fb

Browse files
authored
docs: align callout names with GitHub alerts (#242)
Rename `info` → `note` and `error` → `caution`, add `important` (uses accent color). Move `askai` to secondary. Migrate 11 pages from `[!INFO]` to `[!NOTE]`.
1 parent aa4233a commit 45745fb

18 files changed

Lines changed: 48 additions & 29 deletions

File tree

.claude/rules/docs.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,10 @@ Real worked examples on master:
273273
| `::: code-group` | Tabbed code blocks |
274274
| `::: faq` | FAQ section with `???` questions |
275275
| `> [!TIP]` | Informational callout (empty tip surfaces a random tip from curated pool) [intent:340, intent:341] |
276+
| `> [!NOTE]` | Neutral informational callout |
276277
| `> [!WARNING]` | Cautionary callout |
277-
| `> [!ERROR]` | Error/danger callout |
278+
| `> [!CAUTION]` | Danger/severe callout |
279+
| `> [!IMPORTANT]` | Critical-emphasis callout |
278280
| `[^name]` | Footnote anchor — see [Footnotes](#footnotes) |
279281
| `` ```vue Anatomy playground `` `` | Live anatomy preview |
280282
| `` ```ts collapse `` `` | Collapsible code block |

apps/docs/CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ build/
139139

140140
| Component | Purpose |
141141
|-----------|---------|
142-
| `DocsCallout` | GitHub-style callouts (`> [!TIP]`, `> [!WARNING]`, `> [!ERROR]`, `> [!ASKAI]`) |
142+
| `DocsCallout` | GitHub-style callouts (`> [!TIP]`, `> [!NOTE]`, `> [!WARNING]`, `> [!CAUTION]`, `> [!IMPORTANT]`, `> [!ASKAI]`) |
143143
| `DocsExample` | Live examples from `examples/` with code |
144144
| `DocsMarkup` | Syntax-highlighted code blocks |
145145
| `DocsApi` | Auto-generated API tables with inline/links toggle |
@@ -194,7 +194,7 @@ import BasicExampleRaw from '@/examples/components/tabs/basic.vue?raw'
194194
- UnoCSS utilities for all styling
195195
- Prefer markdown for documentation pages
196196
- **Examples**: Use `::: example` blocks in `.md` pages for live demos; use `<DocsExample>` directly only in `.vue` pages
197-
- **Callouts**: Use `> [!TIP]`, `> [!WARNING]`, `> [!ERROR]` for alerts. Use `> [!ASKAI] question` to prompt Ask AI—phrase as a question the user would ask (e.g., "How do I add validation?"), not a question to the user. Use `> [!TOUR] tour-id` to embed a clickable tour callout—the tour name and description are pulled from the discovery registry automatically.
197+
- **Callouts**: Use `> [!TIP]`, `> [!NOTE]`, `> [!WARNING]`, `> [!CAUTION]`, `> [!IMPORTANT]` for alerts (GitHub-aligned). Use `> [!ASKAI] question` to prompt Ask AI—phrase as a question the user would ask (e.g., "How do I add validation?"), not a question to the user. Use `> [!TOUR] tour-id` to embed a clickable tour callout—the tour name and description are pulled from the discovery registry automatically.
198198
- **Vue code in markdown fences**: Indent `<script>` and `<style>` content by 2 spaces for visual alignment with `<template>`
199199
- Examples: `src/examples/components/{component}/` or `src/examples/composables/{composable}/`
200200
- Component docs: `pages/components/{category}/{component}.md`

apps/docs/build/markdown.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,15 @@ export function applyMarkdownPlugins (md: MarkdownIt, highlighter: DocsHighlight
270270
: '</p>'
271271
}
272272

273-
// GitHub-style callouts: > [!TIP], > [!INFO], > [!WARNING], > [!ERROR], > [!ASKAI], > [!DISCORD], > [!TOUR]
273+
// GitHub-style callouts: > [!TIP], > [!NOTE], > [!WARNING], > [!CAUTION], > [!IMPORTANT], > [!ASKAI], > [!DISCORD], > [!TOUR]
274274
const defaultBlockquoteOpen = md.renderer.rules.blockquote_open
275275
const defaultBlockquoteClose = md.renderer.rules.blockquote_close
276276

277277
md.renderer.rules.blockquote_open = (tokens, index, options, env, self) => {
278278
// Look ahead: blockquote_open -> paragraph_open -> inline
279279
const inlineToken = tokens[index + 2]
280280
if (inlineToken?.type === 'inline' && inlineToken.content) {
281-
const match = inlineToken.content.match(/^\[!(TIP|INFO|WARNING|ERROR|ASKAI|DISCORD|TOUR)\]\s*(.*)/)
281+
const match = inlineToken.content.match(/^\[!(TIP|NOTE|WARNING|CAUTION|IMPORTANT|ASKAI|DISCORD|TOUR)\]\s*(.*)/)
282282
if (match) {
283283
const type = match[1].toLowerCase()
284284
env._calloutType = type
@@ -314,8 +314,8 @@ export function applyMarkdownPlugins (md: MarkdownIt, highlighter: DocsHighlight
314314
if (inlineToken.children?.length) {
315315
const firstChild = inlineToken.children[0]
316316
if (firstChild?.type === 'text') {
317-
// Only TIP|INFO|WARNING|ERROR reach here - ASKAI, DISCORD, TOUR return early with cleared content
318-
firstChild.content = firstChild.content.replace(/^\[!(TIP|INFO|WARNING|ERROR)\]\s*/, '')
317+
// Only TIP|NOTE|WARNING|CAUTION|IMPORTANT reach here - ASKAI, DISCORD, TOUR return early with cleared content
318+
firstChild.content = firstChild.content.replace(/^\[!(TIP|NOTE|WARNING|CAUTION|IMPORTANT)\]\s*/, '')
319319
}
320320
}
321321

apps/docs/src/components/docs/DocsAskMessage.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
import { decodeBase64 } from '@/utilities/decodeBase64'
1313
import { getCurrentInstance, h, nextTick, onBeforeUnmount, render, toRef, useTemplateRef, watch } from 'vue'
1414
15+
// Types
16+
import type { CalloutType } from './calloutConfig'
17+
1518
const props = defineProps<{
1619
role: 'user' | 'assistant'
1720
content: string
@@ -88,7 +91,7 @@
8891
8992
function mountAlertComponents () {
9093
mountTo('[data-alert]', el => {
91-
const type = el.dataset.type as 'tip' | 'info' | 'warning' | 'error'
94+
const type = el.dataset.type as CalloutType
9295
const encoded = el.dataset.content
9396
if (!type || !encoded) return null
9497
return h(DocsCallout, { type }, {

apps/docs/src/components/docs/DocsCallout.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* Callout props - certain props are required based on type:
3232
* - type: 'askai' requires `question`
3333
* - type: 'tour' requires `tourId`
34-
* - type: 'tip' | 'info' | 'warning' | 'error' | 'discord' have no additional required props
34+
* - type: 'tip' | 'note' | 'warning' | 'caution' | 'important' | 'discord' have no additional required props
3535
*/
3636
export interface DocsCalloutProps {
3737
type: CalloutType

apps/docs/src/components/docs/calloutConfig.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,38 @@ export interface CalloutConfig {
99
classes: string
1010
}
1111

12-
export type CalloutType = 'tip' | 'info' | 'warning' | 'error' | 'askai' | 'discord' | 'tour'
12+
export type CalloutType = 'tip' | 'note' | 'warning' | 'caution' | 'important' | 'askai' | 'discord' | 'tour'
1313

1414
const CALLOUT_CONFIG: Record<CalloutType, CalloutConfig> = {
1515
tip: {
1616
icon: 'lightbulb',
1717
title: 'Tip',
1818
classes: 'bg-success-10 border-success-50 text-success',
1919
},
20-
info: {
20+
note: {
2121
icon: 'info',
22-
title: 'Info',
22+
title: 'Note',
2323
classes: 'bg-info-10 border-info-50 text-info',
2424
},
2525
warning: {
2626
icon: 'alert',
2727
title: 'Warning',
2828
classes: 'bg-warning-10 border-warning-50 text-warning',
2929
},
30-
error: {
30+
caution: {
3131
icon: 'error',
32-
title: 'Error',
32+
title: 'Caution',
3333
classes: 'bg-error-10 border-error-50 text-error',
3434
},
35+
important: {
36+
icon: 'alert-circle',
37+
title: 'Important',
38+
classes: 'bg-accent-10 border-accent-50 text-accent',
39+
},
3540
askai: {
3641
icon: 'create',
3742
title: 'Ask AI',
38-
classes: 'bg-accent-10 border-accent-50 text-accent cursor-pointer hover:bg-accent-20 transition-colors',
43+
classes: 'bg-secondary-10 border-secondary-50 text-secondary cursor-pointer hover:bg-secondary-20 transition-colors',
3944
},
4045
discord: {
4146
icon: 'discord',

apps/docs/src/composables/useMarkdown.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* TODO: Dedupe with build/markdown.ts - shared logic includes:
99
* - Table wrapping (overflow-x-auto)
10-
* - Callout detection ([!TIP], [!INFO], etc.)
10+
* - Callout detection ([!TIP], [!NOTE], etc.)
1111
* - Mermaid code block handling
1212
* - VUE_API_NAMES inline code detection
1313
* - Shiki themes and createApiTransformer()
@@ -66,14 +66,14 @@ function getMarked (hl: Highlighter): Marked {
6666
return `<div class="overflow-x-auto mb-4"><table>${thead}${tbody}</table></div>`
6767
},
6868
blockquote ({ raw }) {
69-
// GitHub-style callouts: > [!TIP], > [!INFO], > [!WARNING], > [!ERROR], > [!TRY], > [!TOUR]
69+
// GitHub-style callouts: > [!TIP], > [!NOTE], > [!WARNING], > [!CAUTION], > [!IMPORTANT], > [!TRY], > [!TOUR]
7070
const innerContent = raw
7171
.split('\n')
7272
.map(line => line.replace(/^>\s?/, ''))
7373
.join('\n')
7474
.trim()
7575

76-
const match = innerContent.match(/^\[!(TIP|INFO|WARNING|ERROR|TRY|TOUR)\]\s*([\s\S]*)/)
76+
const match = innerContent.match(/^\[!(TIP|NOTE|WARNING|CAUTION|IMPORTANT|TRY|TOUR)\]\s*([\s\S]*)/)
7777
if (match) {
7878
const type = match[1].toLowerCase()
7979
const rest = match[2].trim()

apps/docs/src/pages/components/semantic/image.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Headless image component with state-driven placeholder and error fallback. Track
4949
</template>
5050
```
5151

52-
> [!INFO]
52+
> [!NOTE]
5353
> `src` is the only native image attribute that doesn't live on `Image.Img` because it drives the load state machine — the `idle → loading → loaded | error` lifecycle can't function without knowing the URL to track, so `Image.Root` owns it. Every other image attribute (`alt`, `width`, `height`, `srcset`, `sizes`, `crossorigin`, `referrerpolicy`, `decoding`, `loading`, `fetchpriority`) is a pure rendering concern and lives on `Image.Img`, where it describes the element that actually renders it.
5454
5555
## Architecture

apps/docs/src/pages/composables/plugins/use-date.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ app.use(
6262
)
6363
```
6464

65-
> [!INFO]
65+
> [!NOTE]
6666
> The `adapter` option is **required**. The `V0DateAdapter` is exported from a separate subpath (`@vuetify/v0/date`) to avoid bundling the Temporal polyfill unless explicitly used. If you don't need date functionality, simply don't install the plugin—no polyfill will be loaded.
6767
6868
## Usage

apps/docs/src/pages/guide/essentials/using-the-docs.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,10 +436,14 @@ The documentation uses callout boxes to highlight important information:
436436

437437
> [!TIP] Best practices and helpful hints you can apply immediately.
438438
439-
> [!INFO] Additional context and notes for deeper understanding.
439+
> [!NOTE] Additional context and notes for deeper understanding.
440+
441+
> [!IMPORTANT] Critical information you should not miss.
440442
441443
> [!WARNING] Cautions and common mistakes to avoid.
442444
445+
> [!CAUTION] Severe issues or destructive operations to watch out for.
446+
443447
> [!ASKAI] How do I find the right composable for what I'm building?
444448
445449
> [!TOUR] using-the-docs

0 commit comments

Comments
 (0)