|
| 1 | +# Markdown |
| 2 | + |
| 3 | +mdBook's [parser](https://github.com/raphlinus/pulldown-cmark) adheres to the [CommonMark](https://commonmark.org/) |
| 4 | +specification. You can take a quick [tutorial](https://commonmark.org/help/tutorial/), |
| 5 | +or [try out](https://spec.commonmark.org/dingus/) CommonMark in real time. A complete Markdown overview is out of scope for |
| 6 | +this documentation, but below is a high level overview of some of the basics. For a more in-depth experience, check out the |
| 7 | +[Markdown Guide](https://www.markdownguide.org). |
| 8 | + |
| 9 | +## Text and Paragraphs |
| 10 | + |
| 11 | +Text is rendered relatively predictably: |
| 12 | + |
| 13 | +```markdown |
| 14 | +Here is a line of text. |
| 15 | + |
| 16 | +This is a new line. |
| 17 | +``` |
| 18 | + |
| 19 | +Will look like you might expect: |
| 20 | + |
| 21 | +Here is a line of text. |
| 22 | + |
| 23 | +This is a new line. |
| 24 | + |
| 25 | +## Headings |
| 26 | + |
| 27 | +Headings use the `#` marker and should be on a line by themselves. More `#` mean smaller headings: |
| 28 | + |
| 29 | +```markdown |
| 30 | +### A heading |
| 31 | + |
| 32 | +Some text. |
| 33 | + |
| 34 | +#### A smaller heading |
| 35 | + |
| 36 | +More text. |
| 37 | +``` |
| 38 | + |
| 39 | +### A heading |
| 40 | + |
| 41 | +Some text. |
| 42 | + |
| 43 | +#### A smaller heading |
| 44 | + |
| 45 | +More text. |
| 46 | + |
| 47 | +## Lists |
| 48 | + |
| 49 | +Lists can be unordered or ordered. Ordered lists will order automatically: |
| 50 | + |
| 51 | +```markdown |
| 52 | +* milk |
| 53 | +* eggs |
| 54 | +* butter |
| 55 | + |
| 56 | +1. carrots |
| 57 | +1. celery |
| 58 | +1. radishes |
| 59 | +``` |
| 60 | + |
| 61 | +* milk |
| 62 | +* eggs |
| 63 | +* butter |
| 64 | + |
| 65 | +1. carrots |
| 66 | +1. celery |
| 67 | +1. radishes |
| 68 | + |
| 69 | +## Links |
| 70 | + |
| 71 | +Linking to a URL or local file is easy: |
| 72 | + |
| 73 | +```markdown |
| 74 | +Use [mdBook](https://github.com/rust-lang/mdBook). |
| 75 | + |
| 76 | +Read about [mdBook](mdBook.md). |
| 77 | + |
| 78 | +A bare url: <https://www.rust-lang.org>. |
| 79 | +``` |
| 80 | + |
| 81 | +Use [mdBook](https://github.com/rust-lang/mdBook). |
| 82 | + |
| 83 | +Read about [mdBook](mdBook.md). |
| 84 | + |
| 85 | +A bare url: <https://www.rust-lang.org>. |
| 86 | + |
| 87 | +## Images |
| 88 | + |
| 89 | +Including images is simply a matter of including a link to them, much like in the _Links_ section above. The following markdown |
| 90 | +includes the Rust logo SVG image found in the `images` directory at the same level as this file: |
| 91 | + |
| 92 | +```markdown |
| 93 | + |
| 94 | +``` |
| 95 | + |
| 96 | +Produces the following HTML when built with mdBook: |
| 97 | + |
| 98 | +```html |
| 99 | +<p><img src="images/rust-logo-blk.svg" alt="The Rust Logo" /></p> |
| 100 | +``` |
| 101 | + |
| 102 | +Which, of course displays the image like so: |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | +See the [Markdown Guide Basic Syntax](https://www.markdownguide.org/basic-syntax/) document for more. |
0 commit comments