Skip to content

Example

This is an example documentation page demonstrating various Markdown features supported by MkDocs.

Back to Documentation Index

How to add a link to the index:

[Back to Documentation Index](../index.md)

Image Example

Cat

How to add an image:

![Cat](cat.jpg)

Code Block Example

1
2
3
def greet(name):
    return f"Hello, {name}!"
print(greet("World"))
How to add a code block:

1
2
3
4
```python
def greet(name):
    return f"Hello, {name}!"
```

Admonition Example

Note

This is a note admonition. You can use admonitions to highlight important information.

!!! note 
    This is a note admonition. You can use admonitions to highlight important information.

Footnote Example

Here is a sentence with a footnote.1

How to add a footnote:

1
2
3
Here is a sentence with a footnote.[^1]

[^1]: This is the footnote text.

Definition List Example

Term 1
Definition 1
Term 2
Definition 2

How to add a definition list:

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

Table Example

Header 1 Header 2
Cell 1 Cell 2
Cell 3 Cell 4

How to add a table:

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

Abbreviation Example

The HTML specification is maintained by the W3C.

How to add an abbreviation:

1
2
3
4
The HTML specification is maintained by the W3C.

*[HTML]: HyperText Markup Language
*[W3C]: World Wide Web Consortium

Smarty Example

“Smart” quotes, dashes – and ellipses… are converted automatically.

How to enable SmartyPants:

"Smart" quotes, dashes -- and ellipses... are converted automatically.

Tabbed Content Example

def hello():
    print("Hello, Python!")
1
2
3
function hello() {
    console.log("Hello, JavaScript!");
}

How to add tabbed content:

=== "Python"
    ```python
    def hello():
        print("Hello, Python!")
    ```
=== "JavaScript"
    ```javascript
    function hello() {
        console.log("Hello, JavaScript!");
    }
    ```

New Documentation Site

To add a new documentation site, you need to create a new markdown file in the docs directory and update the mkdocs.yml file to include it in the navigation.

You need to define the navigation structure in the mkdocs.yml file to include this example in the documentation site.

Here is an example of how to define the navigation in mkdocs.yml:

1
2
3
4
nav:
  - Home: index.md
  - Examples:
      - Example: examples/example.md

Testing the sync

This is a test to see if the mkdocs sync is working properly.


  1. This is the footnote text.