6. Adding a blog ↑
6.6. Code and pre-formatted text
Markdown makes it easy to write about code, and about HTML in particular.
First, it provides automatic escaping for special characters, and then you can indicate code simply by surrounding a short span of code with backtick quotes.
Here’s an example of both features.
First, in code.
By the end of day one, he was familiar with
basic tags like `<html>`, `<head>`, and `<body>`.
On day two, he was creating paragraphs
and lists. By day three, he had moved on
to creating stunning layouts
with `<article>` and `<section>`.
And then as rendered into HTML.
By the end of day one, he was familiar with basic tags like <html>, <head>, and <body>. On day two, he was creating paragraphs and lists. By day three, he had moved on to creating stunning layouts with <article> and <section>.
You can display multiple lines of code by indenting each line with a tab, or four spaces; a common Markdown extension also allows a block of code to be indicated using fenced code blocks, preceding and concluding the block with three backticks isolated on lines by themselves.
Next: 6.7. Asides