Markdown
mdBook's parser adheres to the CommonMark specification. You can take a quick tutorial, or try out CommonMark in real time. A complete Markdown overview is out of scope for this documentation, but below is a high level overview of some of the basics. For a more in-depth experience, check out the Markdown Guide.
Text and Paragraphs
Text is rendered relatively predictably:
Here is a line of text.
This is a new line.
Will look like you might expect:
Here is a line of text.
This is a new line.
Headings
Headings use the #
marker and should be on a line by themselves. More #
mean smaller headings:
### A heading
Some text.
#### A smaller heading
More text.
A heading
Some text.
A smaller heading
More text.
Lists
Lists can be unordered or ordered. Ordered lists will order automatically:
* milk
* eggs
* butter
1. carrots
1. celery
1. radishes
- milk
- eggs
- butter
- carrots
- celery
- radishes
Links
Linking to a URL or local file is easy:
Use [mdBook](https://github.com/rust-lang/mdBook).
Read about [mdBook](mdBook.md).
A bare url: <https://www.rust-lang.org>.
Use mdBook.
Read about mdBook.
A bare url: https://www.rust-lang.org.
Images
Including images is simply a matter of including a link to them, much like in the Links section above. The following markdown
includes the Rust logo SVG image found in the images
directory at the same level as this file:
![The Rust Logo](images/rust-logo-blk.svg)
Produces the following HTML when built with mdBook:
<p><img src="images/rust-logo-blk.svg" alt="The Rust Logo" /></p>
Which, of course displays the image like so:
See the Markdown Guide Basic Syntax document for more.