Back to Articles
Markdown Features Showcase: Admonitions & Code Blocks
Markdown Features Showcase: Admonitions & Code Blocks

Explore the latest Markdown enhancements including GitHub-style admonitions and Mac-style code blocks for a premium reading experience.

Markdown Features Showcase

Welcome to this comprehensive showcase of our industry-standard Markdown rendering features! This article demonstrates GitHub-style admonitions and Mac-style code blocks that elevate your technical content.

GitHub-style Admonitions

Admonitions are special callout boxes that draw attention to important information. Let's explore all five types:

â„šī¸ Note
Notes provide helpful contextual information that enhances understanding without being critical to the main content flow.
💡 Tip
Pro tips offer insider knowledge and best practices that can significantly improve your workflow and efficiency!
âš ī¸ Warning
Warnings alert readers to potential pitfalls or common mistakes that should be avoided when following instructions.
❗ Important
Important callouts highlight critical information that readers absolutely must not overlook or skip.
đŸ”Ĩ Caution
Caution boxes indicate dangerous operations or actions that could have serious consequences if performed incorrectly.

Mac-style Code Blocks

Our code blocks now feature beautiful macOS window chrome with traffic lights and professional JetBrains Mono font.

TypeScript Example

// Angular 21 Signals - Modern State Management
import { Component, signal, computed, effect } from '@angular/core';

interface User {
  id: string;
  name: string;
  email: string;
}

@Component({
  selector: 'app-user-profile',
  standalone: true,
  template: `
    <div class="profile">
      <h2>{{ fullName() }}</h2>
      <p>{{ user().email }}</p>
    </div>
  `
})
export class UserProfileComponent {
  // Signal-based reactive state
  user = signal<User>({
    id: '1',
    name: 'John Doe',
    email: 'john@example.com'
  });

  // Computed signal - automatically updates
  fullName = computed(() => {
    const currentUser = this.user();
    return `${currentUser.name} (${currentUser.id})`;
  });

  constructor() {
    // Side effects that run when signals change
    effect(() => {
      console.log('User changed:', this.user());
    });
  }
}
💡 Tip
The code blocks above feature Mac-style traffic lights (red, yellow, green) and use the beautiful JetBrains Mono font for optimal readability!

JavaScript Modern Patterns

// Async/await with error handling
async function fetchUserData(userId) {
  try {
    const response = await fetch(`/api/users/${userId}`);

    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }

    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Failed to fetch user:', error);
    throw error;
  }
}

// Array methods chaining
const users = [
  { name: 'Alice', age: 28 },
  { name: 'Bob', age: 32 },
  { name: 'Charlie', age: 25 }
];

const adultNames = users
  .filter(user => user.age >= 18)
  .map(user => user.name)
  .sort();

console.log(adultNames); // ['Alice', 'Bob', 'Charlie']
❗ Important
Always handle errors properly in async operations to prevent unhandled promise rejections!

CSS Modern Techniques

/* Glassmorphism with backdrop-filter */
.glass-card {
  background: color-mix(in srgb, white 70%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* CSS Grid with auto-fit */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

/* Custom properties for theming */
:root {
  --primary-color: #2196f3;
  --surface-color: #ffffff;
  --text-color: #212121;
}

html.dark {
  --surface-color: #121212;
  --text-color: #ffffff;
}
â„šī¸ Note
The `color-mix()` function is a modern CSS feature that allows you to blend colors directly in CSS without preprocessors!

Python Code Example

# Python async/await pattern
import asyncio
from typing import List, Dict

async def fetch_data(url: str) -> Dict:
    """Asynchronously fetch data from a URL."""
    # Simulated async operation
    await asyncio.sleep(1)
    return {"url": url, "status": "success"}

async def main():
    urls = [
        "https://api.example.com/users",
        "https://api.example.com/posts",
        "https://api.example.com/comments"
    ]

    # Concurrent execution
    tasks = [fetch_data(url) for url in urls]
    results = await asyncio.gather(*tasks)

    for result in results:
        print(f"✓ {result['url']}: {result['status']}")

if __name__ == "__main__":
    asyncio.run(main())
âš ī¸ Warning
Be cautious when running multiple concurrent tasks - ensure your system has sufficient resources to handle the load!

Bash/Shell Commands

# Angular CLI commands
ng new my-app --standalone --routing --style=scss

# Install dependencies
bun add @angular/material @angular/cdk

# Run development server
bun start

# Build for production
ng build --configuration production

# Run tests
ng test --watch=false --code-coverage
đŸ”Ĩ Caution
Always backup your project before running destructive commands like `rm -rf node_modules` or `git reset --hard`!

JSON Configuration

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ES2022",
    "lib": ["ES2022", "DOM"],
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "moduleResolution": "bundler",
    "resolveJsonModule": true
  },
  "angularCompilerOptions": {
    "enableI18nLegacyMessageIdFormat": false,
    "strictInjectionParameters": true,
    "strictInputAccessModifiers": true,
    "strictTemplates": true
  }
}

Combining Features

Here's how to effectively use admonitions with code examples:

💡 Tip
When writing async code, always use try-catch blocks to handle potential errors gracefully.
// ✅ Good - With error handling
async function saveUser(user: User): Promise<void> {
  try {
    await api.post('/users', user);
    console.log('User saved successfully');
  } catch (error) {
    console.error('Failed to save user:', error);
    throw new Error('Save operation failed');
  }
}

// ❌ Bad - Without error handling
async function saveUserBad(user: User): Promise<void> {
  await api.post('/users', user); // Unhandled promise rejection!
}
❗ Important
The difference between these two approaches is critical for production applications. Always handle errors!

Markdown Best Practices

â„šī¸ Note
Use the right admonition type for the right context: - **NOTE** for supplementary information - **TIP** for helpful suggestions - **WARNING** for potential issues - **IMPORTANT** for critical information - **CAUTION** for dangerous operations

Conclusion

These enhanced Markdown features bring your technical documentation to life with:

✨ Professional Code Blocks - Mac-style window chrome with JetBrains Mono font
đŸŽ¯ Clear Callouts - GitHub-style admonitions for better information hierarchy
🎨 Beautiful Design - Material Design 3 theming with dark mode support
⚡ Better UX - Improved readability and visual organization

💡 Tip
Try using these features in your own articles! Simply use the syntax shown above in any Markdown file.

Happy writing! 🚀

Loading comments...