Complete Guide to Markdown Features

Complete guide to using all markdown features available in this blog. Learn how to use alerts, collapsible sections, code blocks, video embeds, quizzes, and more.

Written by Rafi
📅
Published January 11, 2024
⏱️
Read Time 2 min
📊
Difficulty Beginner

Complete Guide to Markdown Features

Welcome to the complete documentation for all markdown features available in this blog.

Table of Contents


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

FieldRequiredDescription
authorYesAuthor name
categoryYesCategory (e.g., AI & Machine Learning)
dateYesPublication date (ISO format)
descriptionYesBrief description for SEO
priorityYesSort order (lower = shown first)
difficultyNoBeginner/Intermediate/Advanced
draftNoSet true to hide from published posts
imageNoHero image configuration
prerequisitesNoList of prerequisites
quizNoInteractive quiz configuration
tagsNoArray of tags

Alerts

Callout boxes for highlighting important information.

Types: note, tip, warning, important, caution, info

📝 Note

This is a note alert for general information.

💡 Tip

Pro Tip

Tips share best practices with readers.

⚠️ Warning

⚠️ Warning

Warnings alert about potential issues.

Important

❗ Important

Critical information readers must not miss.

🚧 Caution

🚧 Caution

Warns about potential risks.

ℹ️ Info

ℹ️ 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:

Press on a tab to see code
# 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:

Press on a tab to see code
# 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

ParameterTypeDefaultDescription
srcstringRequiredImage URL or path
altstringRequiredAlt text for accessibility
captionstring”Image”Caption text
widthstring-Fixed width (e.g., “500px”)
heightstring-Fixed height (e.g., “300px”)
ratiostring”auto”Aspect ratio
fitstring”cover”Object-fit: cover, contain, fill
alignstring”center”Alignment: left, center, right
collapsiblebooleanfalseMake 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)

AI Technology Landscape
16:9 - Standard landscape format

4:3 (Standard)

Code on screen
4:3 - Standard photo format

1:1 (Square)

Technology square
1:1 - Square format for social media

9:16 (Portrait)

Coding portrait
9:16 - Portrait format

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

ParameterTypeDefaultDescription
srcstringRequiredYouTube or Vimeo URL
titlestring”Video”Video title
widthstring-Maximum width
ratiostring”16:9”Aspect ratio
autoplaybooleanfalseAuto-play on load
loopbooleanfalseLoop playback
mutedbooleanfalseStart muted
controlsbooleantrueShow 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:

InputOutputDescription
...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

ShortcodeOutput
:smile:😊
:smiley:😃
:grin:😄
:laughing:😆
:joy:😂
:wink:😉
:heart_eyes:😍
:thumbsup:👍
:thumbsdown:👎

Objects & Symbols

ShortcodeOutput
:rocket:🚀
:fire:🔥
:star:
:books:📚
:computer:💻
:gear:⚙️
:wrench:🔧
:bell:🔔
:link:🔗

Indicators

ShortcodeOutput
: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.


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

  1. Review existing blog posts for examples
  2. Plan your blog post structure
  3. Write content with appropriate features
  4. 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! ✍️

Markdown Features Quiz

Test your knowledge of markdown features

Discussion

0 comments
Reading Progress
4 min left 0%
Welcome back! Sign in to join the discussion.

Please verify your email to sign in.

Enter the 6-digit code from your verification email.

Didn't receive the email?

Remember your password?

Create an account to comment and join the community.
Letters, numbers, and underscores only

Check your email! We've sent a verification code.

Enter the 6-digit code to complete your registration, or click the link in your email.

Didn't receive the email?

Wrong email?

Enter your email address and we'll send you a code to reset your password.

Remember your password?

Enter the 6-digit code from your email and create a new password.

Didn't receive code?

Welcome aboard!

Your account has been created successfully.

Welcome back! Sign in to join the discussion.

Please verify your email to sign in.

Enter the 6-digit code from your verification email.

Didn't receive the email?

Remember your password?

Create an account to comment and join the community.
Letters, numbers, and underscores only

Check your email! We've sent a verification code.

Enter the 6-digit code to complete your registration, or click the link in your email.

Didn't receive the email?

Wrong email?

Enter your email address and we'll send you a code to reset your password.

Remember your password?

Enter the 6-digit code from your email and create a new password.

Didn't receive code?

Welcome aboard!

Your account has been created successfully.