> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Basic Formatting Syntax

> Guide to essential Markdown formatting for documentation and READMEs covering headings, emphasis, lists, tables, blockquotes, links, images, code blocks, and accessibility and SEO tips

This guide covers the essential Markdown formatting you’ll use in documentation and README files: headings, emphasis, lists, tables, blockquotes, links, images, and code. Each section includes concise examples you can copy and adapt.

## Headings

Create headings with the hash symbol `#`. The number of hashes defines the level (one `#` = H1, six `######` = H6). Use H1 for the main document title and subsections with H2–H4 to keep content scannable for readers and search engines.

```markdown theme={null}
# H1: Project Documentation Header
## H2: Sub-Section Header
### H3: Feature Header
#### H4: Detail Header
##### H5: Minor Header
###### H6: Smallest Header
```

<Callout icon="warning" color="#FF6B6B">
  Use only one `#` (H1) per document when possible and structure content with H2/H3 for accessibility and SEO.
</Callout>

## Emphasis

Use asterisks `*` or underscores `_` to emphasize text.

* One `*` or `_` for italic
* Two `**` or `__` for bold
* Three `***` or `___` for bold + italic

```markdown theme={null}
*italic*    _italic_
**bold**    __bold__
***bold italic***  ___bold italic___
```

To summarize these markers, here’s a quick reference:

| Effect        | Markup examples              |
| ------------- | ---------------------------- |
| Italic        | `*text*` or `_text_`         |
| Bold          | `**text**` or `__text__`     |
| Bold + Italic | `***text***` or `___text___` |

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/UUYFvHM79dCKO7ER/images/GitHub-Foundations-Certification/GitHub-Markdown/Basic-Formatting-Syntax/markdown-basic-syntax-emphasis-guide.jpg?fit=max&auto=format&n=UUYFvHM79dCKO7ER&q=85&s=6f29653895c2bbfdffa0a0768756f9fa" alt="The image explains Markdown basic syntax for text emphasis, illustrating how to apply bold, italic, and bold-italic effects, along with escape characters for plain text." width="1920" height="1080" data-path="images/GitHub-Foundations-Certification/GitHub-Markdown/Basic-Formatting-Syntax/markdown-basic-syntax-emphasis-guide.jpg" />
</Frame>

## Escaping Markdown Characters

If you need to show literal Markdown characters (for example, an asterisk) without rendering them, escape with a backslash `\`.

```markdown theme={null}
This is a literal asterisk: \*
This shows a backslash-escaped underscore: \_
```

## Links and Images

Links and images share a similar syntax. Put the link text in square brackets and the URL in parentheses; prefix with `!` to embed an image.

```markdown theme={null}
[Display text](https://example.com)
![Alt text](https://example.com/image.png)
```

Best practices:

* Use clear link text that describes the destination.
* Add descriptive alt text for images to improve accessibility and SEO.
* For local images in docs, use relative paths.

## Lists

Use unordered or ordered lists to break down steps or items. Unordered lists accept `-`, `*`, or `+`. For ordered lists, use numbers followed by a period. Indent to create nested lists (2–4 spaces is common).

```markdown theme={null}
- Item A
  - Nested item A.1
  - Nested item A.2
* Item B
+ Item C

1. First step
2. Second step
   1. Sub-step
   2. Sub-step
```

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/UUYFvHM79dCKO7ER/images/GitHub-Foundations-Certification/GitHub-Markdown/Basic-Formatting-Syntax/markdown-unordered-ordered-list-syntax.jpg?fit=max&auto=format&n=UUYFvHM79dCKO7ER&q=85&s=e3bc37578371e422428de7fcba5f61b0" alt="The image provides a comparison of unordered and ordered list syntax in Markdown, demonstrating basic list formatting." width="1920" height="1080" data-path="images/GitHub-Foundations-Certification/GitHub-Markdown/Basic-Formatting-Syntax/markdown-unordered-ordered-list-syntax.jpg" />
</Frame>

## Tables

Markdown tables use pipes `|` to separate columns and dashes `-` to separate headers from rows. Put inline code in backticks when table cells contain snippets or commands.

```markdown theme={null}
| Feature | Command        | Description        |
|---------|----------------|--------------------|
| Status  | `git status`   | Working tree state |
| Log     | `git log`      | Commit history     |
| Branch  | `git branch`   | Manage branches    |
```

When to use tables:

* To compare features or commands.
* To present structured data clearly for readers and search engines.

## Blockquotes

Blockquotes start with `>` and are useful for highlighting tips, notes, or quoted text.

```markdown theme={null}
> This is a blockquote about version control:
> Always commit with clear messages.
```

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/UUYFvHM79dCKO7ER/images/GitHub-Foundations-Certification/GitHub-Markdown/Basic-Formatting-Syntax/markdown-blockquotes-syntax-example.jpg?fit=max&auto=format&n=UUYFvHM79dCKO7ER&q=85&s=66e8117ed3907e774fe59f42929e5fd0" alt="The image describes the basic syntax for using blockquotes in Markdown, with an example related to version control." width="1920" height="1080" data-path="images/GitHub-Foundations-Certification/GitHub-Markdown/Basic-Formatting-Syntax/markdown-blockquotes-syntax-example.jpg" />
</Frame>

## Inline Code and Fenced Code Blocks

Use single backticks for inline code and triple backticks for fenced code blocks. Specify the language immediately after the opening triple backticks to enable syntax highlighting.

Inline:

```markdown theme={null}
`print("hello")`
```

Fenced block with language:

```python theme={null}
# A larger code block with language specified
def greet(name):
    return f"Hello, {name}"

print(greet("World"))
```

<Callout icon="lightbulb" color="#1CB2FE">
  Always specify the language after the opening triple backticks (for example, `python`) so renderers can apply proper syntax highlighting.
</Callout>

## Quick SEO & Accessibility Tips

* Use descriptive headings and alt text for images.
* Keep link text meaningful (avoid "click here").
* Use code fences and language tags for better indexing and readability.

That covers the core Markdown features you'll use most often when writing documentation and READMEs.

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/github-foundation-certification/module/42c15655-2217-4c66-8d0a-2472a3b15e43/lesson/6671f083-263a-49bb-b7ef-999c7ea5ce1d" />
</CardGroup>
