Sample article: Markdown and code
Sample content for local development. This demonstration is not an article by Arnas. Remove it before launching the blog with an approved article.
Writing in Markdown
An article starts as a plain-text file. Markdown gives it structure with headings, emphasis, lists, and links, while keeping the source easy to read.
- Keep each article in its own file.
- Give the file a descriptive name; it determines the article URL.
- Preview the result before sharing it.
Code that stays readable
Add a language after the opening fence to enable syntax highlighting. This TypeScript example formats a short greeting:
function greet(name: string): string {
return `Hello, ${name}!`;
}
console.log(greet('reader'));
HTML examples should display as code, rather than becoming elements on the page:
<p>Read the example, not a rendered element.</p>
Long lines scroll inside the code block, leaving the rest of the article at a comfortable reading width:
This deliberately long sample line demonstrates horizontal scrolling within a code block without stretching the article or making the entire page scroll sideways on a narrow phone screen.
Keep exploring
See the Astro Markdown documentation for more formatting options, or return to all articles.