Markdown Guide: Basic Syntax
Markdown is a lightweight markup language that lets you create formatted documents using plain text. It’s the most natural way to produce content on Astro-based sites like Zahit.
Headings
# H1 Heading
## H2 Heading
### H3 Heading
Text Formatting
Use double asterisks for bold text, single asterisks for italics, and double tildes for strikethrough.
Use
>for blockquotes. This is a great way to highlight important sentences you want readers to notice.
Lists
Unordered list:
- First item
- Second item
- Nested item
- Third item
Ordered list:
- Do this first
- Then this
- Finally this
Links and Images
Add links in the format Astro official site.
Code Blocks
Use backticks for inline code.
function zahit() {
return 'Simplicity is depth, not lack.';
}
Tables
| Syntax | Description |
|---|---|
**bold** |
Bold text |
*italic* |
Italic text |
[text](url) |
Link |
Charts (MDX)
In .mdx posts, you can use the <Chart /> component directly without any manual import. The chart library is lazy-loaded only on pages that include a chart and only when the reader scrolls near it:
<Chart
type="bar"
data={{
labels: ['Chrome', 'Safari', 'Edge', 'Firefox'],
datasets: [{
label: 'Browser Market Share (%)',
data: [68.5, 16.3, 5.0, 2.4],
backgroundColor: ['#4fa5d8', 'rgba(79, 165, 216, 0.35)', 'rgba(79, 165, 216, 0.35)', '#f97316']
}]
}}
options={{
scales: {
y: { beginAtZero: true, ticks: { suffix: '%' } },
x: { grid: { display: false } }
}
}}
/>
Markdown takes minutes to learn and a lifetime to appreciate.