| 1 |
# Code blocks { #code-blocks } |
| 2 |
|
| 3 |
Some text |
| 4 |
|
| 5 |
```python |
| 6 |
# This is a sample Python code block |
| 7 |
def hello_world(): |
| 8 |
# Comment with indentation |
| 9 |
print("Hello, world!") # Print greeting |
| 10 |
``` |
| 11 |
|
| 12 |
Some more text |
| 13 |
|
| 14 |
```toml |
| 15 |
# This is a sample TOML code block |
| 16 |
title = "TOML Example" # Title of the document |
| 17 |
``` |
| 18 |
|
| 19 |
And more text |
| 20 |
|
| 21 |
```console |
| 22 |
// Use the command "live" and pass the language code as a CLI argument |
| 23 |
$ python ./scripts/docs.py live es |
| 24 |
|
| 25 |
<span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008 |
| 26 |
<span style="color: green;">[INFO]</span> Start watching changes |
| 27 |
<span style="color: green;">[INFO]</span> Start detecting changes |
| 28 |
``` |
| 29 |
|
| 30 |
And even more text |
| 31 |
|
| 32 |
```json |
| 33 |
{ |
| 34 |
// This is a sample JSON code block |
| 35 |
"greeting": "Hello, world!" // Greeting |
| 36 |
} |
| 37 |
``` |
| 38 |
|
| 39 |
Mermaid diagram |
| 40 |
|
| 41 |
```mermaid |
| 42 |
flowchart LR |
| 43 |
stone(philosophers-stone) -->|requires| harry-1[harry v1] |
| 44 |
``` |