Markdown is a lightweight markup language with plain-text formatting syntax designed to be easy to read and easy to write. Markdown documents can be used for various purposes such as writing documentation, creating README files, blogging, and more. Below is a comprehensive guide to writing Markdown documents:

Headers

You can create headers using the # symbol. The number of # symbols determines the level of the header.

1# Header 1
2## Header 2
3### Header 3
4#### Header 4
5##### Header 5
6###### Header 6

Emphasis

You can add emphasis to your text using asterisks * or underscores _.

1*italic* or _italic_
2**bold** or __bold__

Lists

You can create ordered and unordered lists.

Unordered List

1- Item 1
2- Item 2
3  - Subitem 1
4  - Subitem 2

Ordered List

11. First item
22. Second item
33. Third item

You can create links using [text](url) syntax.

1[Google](https://www.google.com)

Images

You can include images using ![alt text](url) syntax.

1![Alt text](path_to_image.jpg)

Blockquotes

You can create blockquotes using the > symbol optionally with a citation which must be within a footer or cite element.

1> This is a blockquote.

Blockquote example without attribution

Tiam, ad mint andaepu dandae nostion secatur sequo quae.

Note that you can use Markdown syntax within a blockquote.

Blockquote example with attribution

Don’t communicate by sharing memory, share memory by communicating.
Rob Pike

Code Blocks

You can include code blocks using triple backticks followed by the language name. Fenced Code Blocks can be created using triple backticks without specifying a language. Syntax highlighting can be enabled in fenced code blocks by specifying the language after the first set of triple backticks.

1```python
2print("Hello, World!")
3``

Horizontal Rule

You can create a horizontal rule using three or more hyphens, asterisks, or underscores.

1---

Tables

You can create tables using hyphens and pipes.

1| Header 1 | Header 2 |
2|----------|----------|
3| Cell 1   | Cell 2   |

Escaping Characters

You can escape characters using the backslash \ symbol.

1\* This is not italic \*

Task Lists

You can create task lists using square brackets [ ].

1- [x] Task 1
2- [ ] Task 2

Inline HTML

You can also use HTML within Markdown documents for more complex formatting.

1<html>
2 <!-- code here -->
3</html>

Footnotes

Add footnotes using [^footnote_reference] syntax.

Here’s a sentence with a footnote. 1

Strikethrough

Cross out text using ~~.

This is the example of strikethrough text.

Abbreviations

Define abbreviations using [abbreviation]: expansion syntax.

Definition Lists

Create definition lists using terms followed by a colon and definitions.

1Term 1
2: Definition 1
3
4Term 2
5: Definition 2

URLs will be automatically converted to clickable links.

Comments

Some Markdown processors support HTML comments (<!-- -->).

Emoji

To add emoji to your Markdown text, use the following syntax: :emoji_name:.

1That is so funny! 😂

(See also Copying and Pasting Emoji)

Superscript and Subscript

Create superscript using ^ and subscript using ~.

1H~2~O
2X^2^

You can also use other elements like abbr, sub, sup, kbd, mark.

1<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.
2H<sub>2</sub>O
3X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
4Press <kbd><kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd></kbd> to end the session.
5Most <mark>salamanders</mark> are nocturnal.

GIF is a bitmap image format.
H2O
Xn + Yn = Zn
Press CTRL+ALT+Delete to end the session.
Most salamanders are nocturnal.

Conclusion

Markdown is a versatile and easy-to-use markup language for creating formatted documents. With the above guide, you should be equipped to write Markdown documents for various purposes. Experiment with different features to create documents that suit your needs.


  1. This is the footnote example. ↩︎