Markdown is a lightweight markup language that is widely used for creating formatted documents, web content, and documentation. It allows you to format text using simple and intuitive syntax. This cheatsheet and editing guide provides an extensive list of Markdown elements and their usage, along with examples and code blocks to illustrate each element.
Headers are used to define different levels of section headings in your document.
# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6
Use double asterisks **
or double underscores __
to make text bold.
This is **bold** text.
This is bold text.
Use single asterisks *
or single underscores _
to make text italic.
This is *italic* text.
This is italic text.
Use double tildes ~~
to create strikethrough text.
This is ~~strikethrough~~ text.
This is strikethrough text.
Markdown doesn't have native underline support, but you can use HTML <u>
tags for underlining.
This is <u>underlined</u> text.
This is underlined text.
Use HTML <sup>
for superscript and <sub>
for subscript.
H<sub>2</sub>O is a liquid. 2<sup>3</sup> equals 8.
H2O is a liquid. 23 equals 8.
Create ordered lists using numbers followed by a period.
1. Item 1
2. Item 2
3. Item 3
Create unordered lists using asterisks *
, plus +
, or hyphens -
.
* Item 1
* Item 2
* Item 3
You can nest lists by indenting them with spaces or tabs.
* Item 1
* Subitem 1
* Subitem 2
* Item 2
* Subitem 3
Create links using square brackets []
for the link text and parentheses ()
for the URL.
[Google](https://www.google.com)
Define reference links at the end of the document and use them throughout the text.
[Google][1]
[1]: https://www.google.com
You can link header on a page by hash notation. The browser will scroll to the correct section on load.
[tableofcontents](#tableofcontents)
Embed images using an exclamation mark !
, followed by square brackets []
for the alt text, and parentheses ()
for the image URL.
![Markdown Logo](https://commonmark.org/help/images/favicon.png)
Note:
You can also specify the size of the final image either in pixels or in percentage of the screen resolution. You just need to add =10%x*
or =100pxx*
at the end of round brackets.
![Markdown Logo 10%](https://commonmark.org/help/images/favicon.png =10%x*)
Enclose inline code within backticks `
.
This is `inline code`.
This is inline code
.
Create code blocks by indenting with four spaces or by using triple backticks for fenced code blocks.
```
function hello() {
console.log("Hello, world!");
}
```
function hello() {
console.log("Hello, world!");
}
Create horizontal lines with three or more hyphens ---
, asterisks ***
, or underscores ___
.
---
Create tables using pipes |
to separate columns and hyphens for headers.
| Header 1 | Header 2 |
|----------|----------|
| Row 1 | Data 1 |
| Row 2 | Data 2 |
Header 1 | Header 2 |
---|---|
Row 1 | Data 1 |
Row 2 | Data 2 |
To display characters that have special meaning in Markdown, escape them with a backslash \
.
\*This is not italic\*
*This is not italic*
Use the >
symbol to create blockquotes.
> This is a blockquote. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Turpis egestas maecenas pharetra convallis posuere morbi leo. Scelerisque felis imperdiet proin fermentum. Sit amet volutpat consequat mauris. Vitae nunc sed velit dignissim sodales ut eu sem integer. Orci phasellus egestas tellus rutrum tellus pellentesque eu tincidunt tortor. Dictum varius duis at consectetur lorem donec massa. Mattis pellentesque id nibh tortor. Vulputate enim nulla aliquet porttitor lacus. Mi eget mauris pharetra et. Quam elementum pulvinar etiam non quam lacus suspendisse faucibus.
This is a blockquote. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Turpis egestas maecenas pharetra convallis posuere morbi leo. Scelerisque felis imperdiet proin fermentum. Sit amet volutpat consequat mauris. Vitae nunc sed velit dignissim sodales ut eu sem integer. Orci phasellus egestas tellus rutrum tellus pellentesque eu tincidunt tortor. Dictum varius duis at consectetur lorem donec massa. Mattis pellentesque id nibh tortor. Vulputate enim nulla aliquet porttitor lacus. Mi eget mauris pharetra et. Quam elementum pulvinar etiam non quam lacus suspendisse faucibus.
Preview: This wiki has a preview mode to see how your document will look when rendered.
Consistency: Maintain consistent formatting and indentation for better readability.
Practice: The more you practice, the more comfortable you'll become with Markdown.
Use Reference Links: For long URLs or repeated links, reference links can make your Markdown cleaner.
Now that you have a comprehensive Markdown cheatsheet, you can start creating well-formatted documents and content with ease.
Feel free to experiment and explore Markdown's versatility!
This Markdown cheatsheet and editing guide covers a wide range of elements and techniques to help you create formatted and well-structured documents. Use it as a reference whenever you're working with Markdown, and don't hesitate to explore more advanced features and extensions based on your specific needs. Happy Markdown editing!