MDX Feature Showcase
TL;DR
This post demonstrates all custom MDX components available on the blog. Key features include: interactive callouts for warnings and tips, expandable sections for hiding details, step-by-step guides, before/after comparisons, mathematical notation with KaTeX, Mermaid diagrams, and minimal references/changelog components for documentation.
Created for technical documentation, tutorials, and detailed guides.
H2 - Headings & Structure
H3 - Subheading Example
H4 - Example
Organize your content with clear headings and subheadings.
Lists
- Bullet lists for clarity
- Numbered steps for instructions
- Nesting is supported
- First step
- Second step
- Third step
Table Example
| Feature | Supported |
|---|---|
| Markdown | ✅ |
| MDX Components | ✅ |
| Math | ✅ |
| Mermaid Diagrams | ✅ |
| Copyable Code | ✅ |
| References | ✅ |
| Changelog | ✅ |
| Executive Summary | ✅ |
Images
Inline Code & Code Blocks
Use npm run build to generate a production build.
// Example JavaScript code block
function greet(name) {
return `Hello, ${name}!`;
}Math Support
Inline math:
Block math:
MathBlock Component Demo
Password Entropy Calculation
where:
- = length of the password
- = number of possible symbols for each character
1. ZU$Xgb8
- Length (): 7
- Character set: uppercase (26), lowercase (26), digits (10), special characters (let’s assume 32 common symbols)
- Total possible symbols ():
So,
2. fishwithahat
- Length (): 12
- Character set: lowercase letters only (26)
- Total possible symbols (): 26
So,
Conclusion:
Even though fishwithahat is less “complex”, its greater length gives it higher entropy (56.4 bits vs 45.9 bits), making it mathematically more secure against brute-force attacks.
Mermaid Diagrams
V1
graph TD;
Dev[Developer] -->|writes| Blog[Blog Post]
Blog -->|published on| Web[Website]
Web -->|read by| Users[Readers]
V2
%%{init: {'flowchart': {'useMaxWidth': false, 'width': 500, 'padding': 5, 'rankSpacing': 20, 'nodeSpacing': 10}}}%%
graph TD;
Dev[Developer] -->|writes| Blog[Blog Post]
Blog -->|published on| Web[Website]
Web -->|read by| Users[Readers]
V3
%%{init: {'flowchart': {'useMaxWidth': false}}}%%
graph TD;
Dev[Developer] -->|writes| Blog[Blog Post]
Blog -->|published on| Web[Website]
Web -->|read by| Users[Readers]
Callouts
This is an informational callout. Use these to highlight key details.
Warnings can be used to draw attention to important caveats.
Tips are great for sharing best practices or shortcuts.
Use caution callouts for critical warnings or potential issues.
Expandable Sections
Step-by-Step Guide
- Install DependenciesRun `npm install` in your project directory.
- Configure ProjectEdit your `astro.config.mjs` to enable MDX and desired plugins.
- Write Your First PostCreate a new `.mdx` file in your `src/content/blog/` folder.
- Use Custom ComponentsLeverage callouts, expandable sections, and more for rich content.
console.log(Hello, world!)
Before/After Comparison
console.log(‘Hello, world!‘)console.log(‘Hello, ByteRon!’)References Component
The References component provides a minimal, collapsible way to cite sources at the end of posts.
[references] ▸
- [1.1]Astro Documentation — Official Astro framework docs
- [1.2]
- [2.1]
- [2.2]Mermaid JS — Diagrams and flowcharts from text
Changelog Component
The Changelog component tracks updates to posts in a clean, minimal format.
[changelog] ▸
- → Initial publication
- → Added MDX component examples
- → Included math and diagram support
- → Added References component demo
- → Added Changelog component demo
- → Added ExecutiveSummary component demo
- → Updated table of supported features
This is a demo post showing available components and features. Got suggestions or noticed something missing? Drop a comment.