| title | Callouts Plugin | ||||||
|---|---|---|---|---|---|---|---|
| description | Styled note, warning, tip, and info boxes with GitHub/Obsidian syntax | ||||||
| section | Plugins | ||||||
| difficulty | beginner | ||||||
| tags |
|
Styled callout boxes using GitHub/Obsidian-compatible syntax.
````tabs:callouts-config
tab: JavaScript
---
```javascript
import { calloutsPlugin } from '@goobits/docs-engine/plugins';
export default {
preprocess: [
mdsvex({
remarkPlugins: [calloutsPlugin()],
}),
],
};
```
---
tab: TypeScript
---
```typescript
import { mdsvex } from 'mdsvex';
import { calloutsPlugin } from '@goobits/docs-engine/plugins';
import type { Config } from '@sveltejs/kit';
const config: Config = {
preprocess: [
mdsvex({
remarkPlugins: [calloutsPlugin()],
}),
],
};
export default config;
```
````> [!NOTE]
> This is a note callout
> [!WARNING]
> This is a warning callout
> [!TIP]
> This is a tip calloutCallouts use blockquote syntax with [!TYPE] markers (GitHub/Obsidian style):
> [!TYPE]
> Your content here| Type | Icon | Color | Use Case |
|---|---|---|---|
[!NOTE] |
ℹ️ | Blue | General information |
[!TIP] |
💡 | Green | Helpful suggestions |
[!IMPORTANT] |
❗ | Purple | Critical information |
[!WARNING] |
Yellow | Cautions and alerts | |
[!CAUTION] |
🔥 | Red | Strong warnings |
[!SUCCESS] |
✅ | Success | Positive outcomes |
[!DANGER] |
🚨 | Danger | Critical warnings |
[!INFO] |
💬 | Info | Informational content |
[!QUESTION] |
❓ | Question | Questions and FAQs |
Add custom titles after the type marker:
> [!TIP] Pro Tip: Performance Optimization
> Enable caching to speed up builds!Note
Frontmatter is optional. If missing, values are derived from filename and content.
Tip
Use caching to speed up symbol generation from 8.2s to 1.1s.
Warning
Do not commit .env files to version control. They contain sensitive credentials.
Important
Always test your changes before committing to main.
[!DANGER] Running this command will delete all data permanently!
[!TIP] Performance Tip Binary search ($O(\log n)$) is much faster than linear search ($O(n)$) for large datasets.
[!QUESTION] Frequently Asked How do I install this plugin? See the Quick Start section above!
[!INFO] Navigation Sorting
The navigation builder sorts sections automatically:
- Links within sections are sorted by the
orderfield- Sections are sorted by the minimum
orderof their links- Missing
ordervalues default toInfinity
Callouts support rich markdown inside:
[!WARNING] Complex Example
Lists work:
- Item 1
- Item 2
- Item 3
Code blocks work:
const result = await fetchData();Even inline code works:
npm install
[!NOTE] Algorithm Complexity
The quicksort algorithm has time complexity:
$$ \text{Average: } O(n \log n), \quad \text{Worst: } O(n^2) $$
[!TIP] Documentation Tips
Always include examples!
Users learn best by seeing code in action.
Note
This is a NOTE callout for general information.
Tip
This is a TIP callout for helpful suggestions.
Important
This is an IMPORTANT callout for critical information.
Warning
This is a WARNING callout for cautions.
Caution
This is a CAUTION callout for strong warnings.
[!SUCCESS] This is a SUCCESS callout for positive outcomes!
[!DANGER] This is a DANGER callout for critical warnings!
[!INFO] This is an INFO callout for informational content.
[!QUESTION] This is a QUESTION callout for FAQs.
Callouts are rendered with semantic HTML and CSS classes:
<div class="md-callout md-callout--blue" role="note">
<div class="md-callout__header">
<span class="md-callout__icon">ℹ️</span>
<span class="md-callout__label">Note</span>
</div>
<div class="md-callout__content">
<p>Your content here</p>
</div>
</div>.md-callout- Base class.md-callout--{color}- Color variants (blue, green, purple, yellow, red, success, danger, info, question).md-callout__header- Header container.md-callout__icon- Icon element.md-callout__label- Title/label text.md-callout__content- Content container
Override default styles in your global CSS:
.md-callout {
border-radius: 8px;
padding: 1rem;
margin: 1.5rem 0;
border-left: 4px solid;
}
.md-callout--blue {
background: rgba(59, 130, 246, 0.1);
border-color: rgb(59, 130, 246);
}
.md-callout--green {
background: rgba(34, 197, 94, 0.1);
border-color: rgb(34, 197, 94);
}
.md-callout--purple {
background: rgba(168, 85, 247, 0.1);
border-color: rgb(168, 85, 247);
}[!IMPORTANT] Authentication Required
All API endpoints require a valid API key in the
Authorizationheader:curl -H "Authorization: Bearer YOUR_API_KEY" \ https://api.example.com/users
[!WARNING] Environment Variables
Never commit these files to version control:
.env.env.localcredentials.jsonAdd them to
.gitignoreinstead!
[!QUESTION] Build failing with "Module not found"?
Check these common causes:
- Run
npm installto install dependencies- Check import paths are correct
- Verify file extensions match
[!SUCCESS] Solution Found!
The issue was a missing dependency. Install it with:
npm install missing-package
- Use appropriate types - Match callout severity to content importance
- Keep concise - 1-3 sentences ideal for quick scanning
- Place strategically - Near relevant content, not at random
- Use sparingly - Too many callouts reduce their impact
- Leverage custom titles - Makes callouts more specific and helpful
- Test rendering - Preview locally to ensure styling works
Callouts include proper accessibility features:
role="note"- Identifies callout as supplementary contentaria-label- Provides accessible label (uses title or type)aria-hidden="true"- Hides decorative icons from screen readers- Semantic HTML structure
[!WARNING] Breaking Change
If you used the old
> **Note:**syntax, you need to migrate to> [!NOTE].
> **Note:** This is a note
> **Warning:** This is a warning> [!NOTE]
> This is a note
> [!WARNING]
> This is a warningMigration script:
# Find all old-style callouts
grep -r "> \*\*Note:\*\*" docs/
# Replace manually or use sed
sed -i 's/> \*\*Note:\*\* /> [!NOTE]\n> /g' your-file.mdPrerequisites: Basic markdown knowledge
Next Steps:
- Collapse Plugin - Collapsible sections
- Mermaid Plugin - Diagram rendering
Related:
- Getting Started - Quick start guide
- Plugin Order - Understanding plugin execution