Complete Guide to Markdown Features
Welcome to the complete documentation for all markdown features available in this blog.
Table of Contents
- Frontmatter
- Alerts
- Collapsible Sections
- Code Blocks
- Tabbed Code Examples
- Images and Figures
- Video Embeds
- Quiz System
- Smart Typography
- Emoji Shortcodes
- Anchor Links
Frontmatter
Every blog post starts with YAML frontmatter:
📖 Frontmatter Template
---
author: Your Name
category: Category Name
date: 2024-01-11T00:00:00Z
description: A brief description of your post
priority: 10
difficulty: Beginner | Intermediate | Advanced
draft: false
image:
alt: "Image description"
src: "/images/path/to/image.webp"
layout: ../../../layouts/BlogPostLayout.astro
prerequisites:
- Prerequisite 1
- Prerequisite 2
quiz:
description: "Test your knowledge"
questions:
- o:
- "Option A"
- "Correct Answer*"
- "Option C"
- "Option D"
q: "Your question here?"
title: "Quiz Title"
tags:
- Tag1
- Tag2
title: 'Your Post Title'
---
Frontmatter Fields
| Field | Required | Description |
|---|---|---|
author | Yes | Author name |
category | Yes | Category (e.g., AI & Machine Learning) |
date | Yes | Publication date (ISO format) |
description | Yes | Brief description for SEO |
priority | Yes | Sort order (lower = shown first) |
difficulty | No | Beginner/Intermediate/Advanced |
draft | No | Set true to hide from published posts |
image | No | Hero image configuration |
prerequisites | No | List of prerequisites |
quiz | No | Interactive quiz configuration |
tags | No | Array of tags |
Alerts
Callout boxes for highlighting important information.
Types: note, tip, warning, important, caution, info
This is a note alert for general information.
Pro Tip
Tips share best practices with readers.
⚠️ Warning
Warnings alert about potential issues.
❗ Important
Critical information readers must not miss.
🚧 Caution
Warns about potential risks.
ℹ️ Information
Provides additional context or details.
Alert Usage
<Alert type="note" title="Optional Title">
Your content here...
</Alert>
<Alert type="tip">
<h4>Custom Title</h4>
<p>You can customize the title.</p>
</Alert>
Collapsible Sections
Hide/show content on demand.
📖 Click to reveal hidden content
This content is hidden by default. Use for:
- Prerequisites
- Extended code examples
- Detailed explanations
- Step-by-step instructions
📖 Expanded by Default
This section is open by default.
Collapsible Usage
<Collapsible title="Section Title">
Hidden content goes here...
</Collapsible>
<Collapsible title="Expanded" defaultCollapsed={false}>
Open by default...
</Collapsible>
Code Blocks
Standard markdown code blocks with syntax highlighting and copy buttons:
def example_function():
data = {"key": "value"}
return data
const greeting = "Hello, World!";
console.log(greeting);
npm install package-name
npm run dev
fn main() {
println!("Hello, World!");
}
Inline Code
Use backticks for inline code: const variable = value;
Tabbed Code Examples
Compare code in multiple languages:
# API Request Example
import httpx
async def fetch_data(url: str) -> dict:
async with httpx.AsyncClient() as client:
response = await client.get(url)
return response.json()
# Usage
import asyncio
data = asyncio.run(fetch_data("https://api.example.com/data"))
// API Request Example
async function fetchData(url) {
const response = await fetch(url);
return response.json();
}
// Usage
fetchData('https://api.example.com/data')
.then(data => console.log(data));
# cURL Example
curl -X GET https://api.example.com/data \
-H "Accept: application/json"
Compare code in multiple languages:
# First tab - click to reveal
def hello():
return "Hello, World!"
// Click another tab to switch
function hello() {
return "Hello, World!";
}
Images and Figures
Display images with captions and aspect ratios.
<Figure
src="/path/to/image.jpg"
alt="Image description"
caption="Image caption"
width="500px"
height="300px"
ratio="16:9"
fit="cover"
align="center"
/>
Parameter Reference
| Parameter | Type | Default | Description |
|---|---|---|---|
src | string | Required | Image URL or path |
alt | string | Required | Alt text for accessibility |
caption | string | ”Image” | Caption text |
width | string | - | Fixed width (e.g., “500px”) |
height | string | - | Fixed height (e.g., “300px”) |
ratio | string | ”auto” | Aspect ratio |
fit | string | ”cover” | Object-fit: cover, contain, fill |
align | string | ”center” | Alignment: left, center, right |
collapsible | boolean | false | Make expandable |
Aspect Ratio Examples
📸 Supported Ratios
16:9 (landscape), 4:3 (standard), 3:2 (photo), 1:1 (square), 9:16 (portrait), auto
16:9 (Landscape)
4:3 (Standard)
1:1 (Square)
9:16 (Portrait)
Alignment Examples
📖 Left/Center/Right Alignment
💡 Alignment Tip
Left and right aligned images float beside the text, perfect for inline illustrations.
Video Embeds
Embed YouTube and Vimeo videos.
Usage
<VideoEmbed
src="https://youtube.com/watch?v=..."
title="Video Title"
width="800px"
ratio="16:9"
autoplay={false}
loop={false}
muted={false}
controls={true}
/>
Parameter Reference
| Parameter | Type | Default | Description |
|---|---|---|---|
src | string | Required | YouTube or Vimeo URL |
title | string | ”Video” | Video title |
width | string | - | Maximum width |
ratio | string | ”16:9” | Aspect ratio |
autoplay | boolean | false | Auto-play on load |
loop | boolean | false | Loop playback |
muted | boolean | false | Start muted |
controls | boolean | true | Show controls |
Video Ratio Examples
16:9 (Standard)
21:9 (Ultrawide)
4:3 (Standard)
Quiz System
Add interactive quizzes to test reader knowledge. Configure in frontmatter:
Quiz Structure
quiz:
description: "Test your knowledge"
questions:
- o:
- "Option A"
- "Correct Answer*" # Asterisk marks correct answer
- "Option C"
- "Option D"
q: "Question text here?"
- o:
- "A"
- "B*"
- "C"
- "D"
q: "Another question?"
title: "Quiz Title"
Quiz Question Format
- o:
- "First option"
- "Correct answer*"
- "Third option"
- "Fourth option"
q: "Your question goes here?"
✅ Quiz Features
- Multiple choice questions
- Auto-grading with correct answers
- Results displayed to readers
- Supports any number of questions
📖 Quiz Example Frontmatter
quiz:
description: "Test your understanding of the topic"
questions:
- o:
- "Basic programming"
- "Advanced AI systems*"
- "Database management"
- "Network security"
q: "What is the primary focus of this guide?"
- o:
- "Use alerts sparingly"
- "Use them for all content"
- "Highlight important information*"
- "Replace all headings"
q: "When should you use alerts?"
title: "Section Quiz"
Smart Typography
Automatic transformations applied to text:
| Input | Output | Description |
|---|---|---|
... | … | Ellipsis |
-- | – | En dash |
--- | — | Em dash |
'' | ”curly quotes” | Smart quotes |
Examples
- Three dots… become an ellipsis…
- Double dashes—create proper en dashes---
- Triple dashes---render as em dashes
- Smart quotes” for proper typography
✒️ Smart Typography
Transformations happen automatically in paragraph text, list items, and content areas.
Emoji Shortcodes
Use :emoji: for consistent emoji display across devices.
Faces & Emotions
| Shortcode | Output |
|---|---|
:smile: | 😊 |
:smiley: | 😃 |
:grin: | 😄 |
:laughing: | 😆 |
:joy: | 😂 |
:wink: | 😉 |
:heart_eyes: | 😍 |
:thumbsup: | 👍 |
:thumbsdown: | 👎 |
Objects & Symbols
| Shortcode | Output |
|---|---|
:rocket: | 🚀 |
:fire: | 🔥 |
:star: | ⭐ |
:books: | 📚 |
:computer: | 💻 |
:gear: | ⚙️ |
:wrench: | 🔧 |
:bell: | 🔔 |
:link: | 🔗 |
Indicators
| Shortcode | Output |
|---|---|
:check: | ✅ |
:x: | ❌ |
:warning: | ⚠️ |
:question: | ❓ |
:idea: | 💡 |
:flag: | 🚩 |
:trophy: | 🏆 |
:medal: | 🏅 |
:party: | 🎉 |
Usage Example
Welcome to the guide :rocket: Check your configuration :warning:
Use the check mark :check: when done, or the X :x: to cancel.
💡 Emoji Tip
Emoji shortcodes ensure consistent rendering across different devices and platforms.
Anchor Links
Heading links are automatically generated.
Usage
Simply use standard markdown headings:
## Section Title
### Subsection
#### Deep Dive
Hover over any heading to see a link icon. Click to copy the anchor link.
🔗 Auto-Generated
Anchor links work for all headings (h1-h6) automatically.
Quick Reference
✅ Component Summary
- Alerts:
<Alert type=“info”>…</Alert> - Collapsible:
<Collapsible title=”…”>…</Collapsible> - Code:
python code - Tabs:
<TabbedCode tabs=AB>…</TabbedCode> - Images:
<Figure src=”…” ratio=“16:9” /> - Videos:
<VideoEmbed src=”…” ratio=“16:9” /> - Quiz: Configure in frontmatter
📚 Next Steps
- Review existing blog posts for examples
- Plan your blog post structure
- Write content with appropriate features
- Test locally before publishing
All Supported Features Checklist
📋 Feature Checklist
📖 Core Features
- YAML Frontmatter
- Markdown headings (h1-h6)
- Paragraphs and text formatting
- Lists (ordered and unordered)
- Links and images
- Code blocks with syntax highlighting
- Tables
- Blockquotes
📖 Custom Components
- Alert callouts (6 types)
- Collapsible sections
- Tabbed code examples
- Figure images with ratios
- Video embeds
- Interactive quizzes
- Copy-to-clipboard buttons
📖 Text Enhancements
- Smart typography (… → …)
- Emoji shortcodes
- Auto-generated anchor links
- Syntax highlighting (Shiki)
Happy writing! ✍️
Discussion
0 commentsJoin the Discussion
Sign in to post comments and join the conversation.
No comments yet. Be the first to share your thoughts!