Course

Markdown Cheatsheet

Image

Before we learn how to customize your GitHub profile, let's take a quick look at Markdown.

Markdown is a simple way to format text on GitHub, and it's used a lot for README files and documentation.

Here's a quick Markdown cheatsheet to help you get started. If you want to learn more about Markdown, you can check out the official Markdown Guide.

Basic Text Formatting

Markdown has a few simple text formatting options. Here are some examples:

Bold Text

**Bold Text**

Italic Text

_Italic Text_

Bold and Italic Text

**_Bold and Italic Text_**

<!-- ***Bold and Italic Text** -->
<!-- ___Bold and Italic Text__ -->
<!-- __*Bold and Italic Text*__ -->
<!-- **_Bold and Italic Text_** -->

Strikethrough Text

~~Strikethrough Text~~

Headings

You can create headings using the symbol. The number of symbols indicates the level of the heading.

Heading 1

# Heading 1

Heading 2

## Heading 2

Heading 3

### Heading 3

Heading 4

#### Heading 4

Lists

You can create ordered and unordered lists in Markdown.

Unordered List

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

Ordered List

1. Item 1
2. Item 2
   1. Subitem 1
   2. Subitem 2
3. Item 3
4. Item 4
   1. Subitem 1
      1. Subsubitem 1
      2. Subsubitem 2
   2. Subitem 2

Links

You can create links in Markdown using the following syntax:

[Link Text](URL)

Images

You can add images to your Markdown files using the following syntax:

![Alt Text](Image URL)

Code Blocks

You can create code blocks in Markdown using triple backticks (```) followed by the language name.

```javascript
function greet() {
  console.log("Hello, World!");
}

greet();
```

```python
def greet():
    print("Hello, World!")

greet()
```

```html
<!doctype html>
<html>
  <head>
    <title>Hello, World!</title>
  </head>
  <body>
    <h1>Hello, World!</h1>
  </body>
</html>
```

```css
body {
  background-color: #f0f0f0;
  color: #333;
}
```

```bash
echo "Hello, World!"
```

Blockquotes

You can create blockquotes in Markdown using the > symbol.

This is a blockquote.

> This is a blockquote.

You can add multiple lines to a blockquote by starting each line with a >. This is another line in the blockquote.

> You can add multiple lines to a blockquote by starting each line with a `>`.
> This is another line in the blockquote.

This is the first paragraph of the blockquote.

This is the second paragraph of the blockquote, which also spans multiple lines.

And here is the third paragraph.

> This is the first paragraph of the blockquote.
>
> This is the second paragraph of the blockquote,
> which also spans multiple lines.
>
> And here is the third paragraph.

Horizontal Rules

You can create horizontal rules in Markdown using three or more hyphens (---), asterisks (***), or underscores (___).

---

<!-- *** -->
<!-- ___ -->

Task Lists

You can create task lists in Markdown using the following syntax:

- [x] Task 1
- [ ] Task 2

Tables

You can create tables in Markdown using the following syntax:

| Header 1     | Header 2     | Header 3     |
| ------------ | ------------ | ------------ |
| Row 1, Col 1 | Row 1, Col 2 | Row 1, Col 3 |
| Row 2, Col 1 | Row 2, Col 2 | Row 2, Col 3 |

Escaping Characters

If you want to display special characters as plain text in Markdown, you can escape them using a backslash (\).

\*This text will not be italicized\*

Comments

You can add comments to your Markdown files using HTML comments.

<!-- This is a comment in Markdown. -->

Embedding HTML

You can embed HTML code directly into your Markdown files.

<div>
  <h1>Hello, World!</h1>
  <p>This is an HTML block embedded in Markdown.</p>
</div>

Here are the formatting options that Markdown provides for text and content. While it has some limitations, it's popular due to its simplicity and compatibility across different platforms. If you need more advanced features, you can use MDX, but it isn't currently supported in GitHub READMEs.

The lesson you're reading now is written in MDX format, a superset of Markdown that enables advanced features like interactive components and embedded JSX code.

0 Comments

"Please login to view comments"

glass-bbok

Join the Conversation!

Subscribing gives you access to the comments so you can share your ideas, ask questions, and connect with others.

Upgrade your account
tick-guideNext Lesson

Customize your Profile README