Skip to content

Commit f3e5fce

Browse files
authored
Merge pull request #1709 from joshrotenberg/markdown-page
Markdown page
2 parents e3e1707 + 2d36cd9 commit f3e5fce

File tree

4 files changed

+109
-7
lines changed

4 files changed

+109
-7
lines changed

guide/src/README.md

-7
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@ In addition to the above features, mdBook also has a Rust [API](https://docs.rs/
1818
write your own preprocessor or renderer, as well as incorporate mdBook features into other applications.
1919
The [For Developers](for_developers) section of this guide contains more information and some examples.
2020

21-
## Markdown
22-
23-
mdBook's [parser](https://github.com/raphlinus/pulldown-cmark) adheres to the [CommonMark](https://commonmark.org/)
24-
specification. You can take a quick [tutorial](https://commonmark.org/help/tutorial/),
25-
or [try out](https://spec.commonmark.org/dingus/) CommonMark in real time. For a more in-depth experience, check out the
26-
[Markdown Guide](https://www.markdownguide.org).
27-
2821
## Contributing
2922

3023
mdBook is free and open source. You can find the source code on

guide/src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- [Editor](format/theme/editor.md)
2323
- [MathJax Support](format/mathjax.md)
2424
- [mdBook-specific features](format/mdbook.md)
25+
- [Markdown](format/markdown.md)
2526
- [Continuous Integration](continuous-integration.md)
2627
- [For Developers](for_developers/README.md)
2728
- [Preprocessors](for_developers/preprocessors.md)
Loading

guide/src/format/markdown.md

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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+
![The Rust Logo](images/rust-logo-blk.svg)
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+
![The Rust Logo](images/rust-logo-blk.svg)
105+
106+
107+
See the [Markdown Guide Basic Syntax](https://www.markdownguide.org/basic-syntax/) document for more.

0 commit comments

Comments
 (0)