- Introduction to Markdown
- Basic Syntax
- Links and Images
- Tables
- Advanced Markdown
- Markdown Best Practices
- Conclusion
- Markdown is a lightweight markup language with plain text formatting syntax.
- It is designed to be easy to read and write, and it can be converted to HTML and other formats.
- Created by John Gruber in 2004, Markdown is widely used for writing documentation, README files, blog posts, and more.
- Markdown is simple and easy to learn, making it accessible for beginners and efficient for experienced users.
- It is platform-independent and can be edited with any text editor.
- Markdown files are plain text, so they can be version-controlled with systems like Git.
- Markdown enhances readability, making it suitable for technical documentation.
- You can use any text editor to write Markdown, but specialized Markdown editors offer additional features like live preview.
- Some popular Markdown editors include:
- Visual Studio Code: A powerful code editor with Markdown support. Download Visual Studio Code
- Typora: A minimalistic Markdown editor with live preview. Download Typora
- Dillinger: An online Markdown editor with cloud storage integration. Use Dillinger Online
- Markdown Here: A browser extension that allows you to write Markdown in any web app. Install Markdown Here
- Headings are created using the
#
symbol. The number of#
symbols indicates the heading level. - Headings range from level 1 (largest) to level 6 (smallest).
- Example:
# Heading 1 ## Heading 2 ### Heading 3 #### Heading 4 ##### Heading 5 ###### Heading 6
-
Paragraphs are created by writing text separated by one or more blank lines.
-
Example:
This is a paragraph. This is another paragraph.
This is a paragraph.
This is another paragraph.
- To create a line break (without starting a new paragraph), end a line with two or more spaces, and then type return.
- Example:
This is the first line.
This is the first line. This is the second line.
This is the second line.
-
Emphasis can be added using asterisks
*
or underscores_
. -
To create italic text, wrap the text with one
*
or_
. -
To create bold text, wrap the text with two
**
or__
. -
To create bold and italic text, wrap the text with three
***
or___
. -
Example:
*Italic* or _Italic_ **Bold** or __Bold__ ***Bold and Italic*** or ___Bold and Italic___
Italic or Italic
Bold or Bold
Bold and Italic or Bold and Italic
-
Blockquotes are created using the
>
symbol. Blockquotes can be nested by adding additional>
symbols. -
Example:
> This is a blockquote. > > This is another line in the same blockquote.
This is a blockquote.
This is another line in the same blockquote.
-
Nested Blockquote:
> This is the first level of quoting. > >> This is nested blockquote.
This is the first level of quoting.
This is nested blockquote.
- Ordered lists use numbers followed by a period. The numbers can be in any order; Markdown will automatically number them correctly.
- Example:
1. First item 2. Second item 3. Third item
- First item
- Second item
- Third item
- Unordered lists use asterisks
*
, plus+
, or minus-
. - Example:
* Item 1 * Item 2 * Item 3
- Item 1
- Item 2
- Item 3
- Lists can be nested by indenting the items. Both ordered and unordered lists can be nested.
- Example:
1. Item 1 - Subitem 1 - Subitem 2 2. Item 2
- Item 1
- Subitem 1
- Subitem 2
- Item 2
- Item 1
- Inline code is created using backticks
`
. This is useful for short snippets of code within a sentence. - Example:
This is
This is `inline code`.
inline code
.
- Code blocks are created using triple backticks
```
or indenting with four spaces. This is useful for larger blocks of code. - You can also specify the language for syntax highlighting by adding the language name after the opening backticks.
- Example:
```python def hello_world(): print("Hello, World!") ```
def hello_world(): print("Hello, World!")
- Horizontal rules are created using three or more hyphens
---
, asterisks***
, or underscores___
. They are useful for separating sections of content. - Example:
--- *** ___
-
Inline links are created using square brackets for the text and parentheses for the URL.
-
You can also add a title, which appears as a tooltip when you hover over the link, by placing it in quotes after the URL.
-
Example:
[This is a link](https://www.example.com) [This is a link with a title](https://www.example.com "Example Title")
- Reference links are created using square brackets for the text and a label, with the URL defined elsewhere in the document. This is useful for managing long URLs or when the same link is used multiple times.
- Example:
This is a reference link
[This is a reference link][1] [1]: https://www.example.com
- Automatic links are created by enclosing the URL in angle brackets. This is useful for quick links without custom text.
- Example:
https://www.example.com
<https://www.example.com>
-
Images are created using an exclamation mark followed by square brackets for the alt text and parentheses for the URL.
-
You can also add a title, which appears as a tooltip when you hover over the image, by placing it in quotes after the URL.
-
Example:
![Alt text](https://www.example.com/image.jpg) ![Alt text with title](https://www.example.com/image.jpg "Image Title")
- Tables are created using pipes
|
and hyphens-
to define the structure. Colons:
can be used to align columns. - Example:
| Header 1 | Header 2 | Header 3 | | -------- | :------: | -------: | | Row 1 | Data 1 | Data 2 | | Row 2 | Data 3 | Data 4 |
Header 1 Header 2 Header 3 Row 1 Data 1 Data 2 Row 2 Data 3 Data 4
-
Footnotes are created using square brackets and a caret
[^1]
. The footnote content is placed at the end of the document. -
Example:
This is a footnote reference[^1]. [^1]: This is the footnote.
This is a footnote reference1.
- Strikethrough text is created using double tildes
~~
. This is useful for indicating deleted text or completed tasks. - Example:
~~This is strikethrough text~~
This is strikethrough text
- Task lists are created using square brackets. A checked box
[x]
indicates a completed task, and an unchecked box[ ]
indicates a pending task. - Example:
- [x] Task 1 - [ ] Task 2 - [ ] Task 3
- Task 1
- Task 2
- Task 3
- Use Markdown's simplicity to your advantage. Avoid overly complex formatting. Focus on readability and clarity.
- Maintain consistent formatting throughout your document for better readability. Use the same style for headings, lists, links, etc.
- Use a Markdown editor with live preview or an online preview tool to check how your Markdown renders. This helps in catching formatting errors and ensuring the document looks as expected.
- Use descriptive link text to give readers a clear idea of what they are clicking on. Avoid using generic text like "click here."
- Organize your document with clear headings and subheadings to make it easier to navigate. Use lists and tables to present information in a structured way.
This tutorial covered the basics of Markdown, including document structure, common elements, links, images, tables, and advanced features. Markdown is a powerful and easy-to-learn language for writing formatted text. Practice using Markdown to enhance your documentation, blog posts, and other writing. Happy writing!
Footnotes
-
This is the footnote. ↩