A Beginner's Guide To Writing Markdown
A Beginner's Guide To Writing Markdown
Markdown is a lightweight markup language that is simple to learn and widely used
for formatting plain text. It is commonly used for creating documentation, README
files, blogs, and notes. This tutorial provides an overview of Markdown's syntax
and practical tips for writing your own Markdown files.
What is Markdown?
Markdown allows you to format text using plain-text syntax, which is then rendered
as structured HTML or styled text in Markdown-compatible viewers. Its simplicity
and readability make it a popular choice for both technical and non-technical
users. Markdown files typically have the .md or .markdown extension.
markdown
Copy code
# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6
Output:
Header 1
Header 2
Header 3
2. Paragraphs and Line Breaks
Simply type your text as normal to create a paragraph. For a line break, leave two
spaces at the end of the line or insert an empty line between blocks of text.
markdown
Copy code
This is a paragraph.
markdown
Copy code
*Italicized text* or _Italicized text_
4. Lists
Unordered lists use *, -, or +.
Ordered lists use numbers followed by a period (1.).
markdown
Copy code
- Item 1
- Item 2
- Sub-item 2.1
- Sub-item 2.2
1. First item
2. Second item
1. Sub-item 2.1
2. Sub-item 2.2
Output:
Item 1
Item 2
Sub-item 2.1
Sub-item 2.2
First item
Second item
Sub-item 2.1
Sub-item 2.2
5. Links and Images
Links are created using [link text](URL) syntax.
Images use the same syntax but are prefixed with an exclamation mark (!).
markdown
Copy code
[OpenAI](https://www.openai.com)

Output:
OpenAI
6. Blockquotes
Use the > symbol to create blockquotes.
markdown
Copy code
> This is a blockquote.
> It can span multiple lines.
Output:
This is a blockquote.
It can span multiple lines.
markdown
Copy code
Inline code: `print('Hello, world!')`
Code block:
def hello(): print("Hello, world!")
Copy code
Output:
Inline code: print('Hello, world!')
scss
Copy code
def hello():
print("Hello, world!")
8. Tables
Tables use pipes (|) and hyphens (-) to create rows and columns.
markdown
Copy code
| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Data 1 | Data 2 | Data 3 |
| Data 4 | Data 5 | Data 6 |
Output:
markdown
Copy code
---
***
___
Output:
10. Escaping Characters
If you need to display a literal Markdown character (e.g., * or #), escape it with
a backslash (\).
markdown
Copy code
\*This text is not italicized.\*
Output:
*This text is not italicized.*
markdown
Copy code
<p>This is a paragraph in HTML.</p>
Extensions for GitHub Flavored Markdown (GFM)
GFM supports additional features, such as task lists and tables.
markdown
Copy code
- [x] Task 1
- [ ] Task 2
Output:
Task 1
Task 2
Conclusion
Markdown's simple syntax makes it an essential tool for anyone creating formatted
documents or web content. By mastering its basic and advanced features, you can
quickly produce clean and professional-looking text. Experiment with Markdown in a
live preview editor to gain confidence and explore its full potential.