Quick reference post to verify markdown code highlighting.
This post exists as a syntax-highlighting check for future technical writing.
TypeScript
export function formatBytes(bytes: number): string {
if (bytes === 0) return '0 B';
const units = ['B', 'KB', 'MB', 'GB'];
const index = Math.min(Math.floor(Math.log(bytes) / Math.log(1024)), units.length - 1);
const value = bytes / 1024 ** index;
return `${value.toFixed(value >= 10 ? 0 : 1)} ${units[index]}`;
}
Bash
#!/usr/bin/env bash
set -euo pipefail
bun install
bun run build
bun run dev -- --host
JSON
{
"site": "vilemjelen.dev",
"stack": ["astro", "bun"],
"features": {
"contentCollections": true,
"syntaxHighlighting": true
}
}