58 lines
847 B
Markdown
58 lines
847 B
Markdown
![]() |
# Code Examples
|
||
|
|
||
|
## Code annotation Examples
|
||
|
|
||
|
### Codeblocks
|
||
|
|
||
|
Some `code` goes here.
|
||
|
|
||
|
### Plain codeblock
|
||
|
|
||
|
A plain codeblock:
|
||
|
|
||
|
```
|
||
|
Some code here
|
||
|
def my_function():
|
||
|
print("Hello, world!")
|
||
|
```
|
||
|
|
||
|
#### Code for a specific language
|
||
|
|
||
|
Some more code with the `py` at the start:
|
||
|
|
||
|
```py
|
||
|
def my_function():
|
||
|
print("Hello, world!")
|
||
|
```
|
||
|
|
||
|
#### With title
|
||
|
|
||
|
```py title="my_function.py"
|
||
|
def my_function():
|
||
|
print("Hello, world!")
|
||
|
```
|
||
|
|
||
|
#### With title and line numbers
|
||
|
|
||
|
```py title="my_function.py" linenums="1"
|
||
|
def my_function():
|
||
|
print("Hello, world!")
|
||
|
```
|
||
|
|
||
|
#### With line numbers and line highlighting
|
||
|
|
||
|
```py title="my_function.py" linenums="1" hl_lines="2"
|
||
|
def my_function():
|
||
|
print("Hello, world!")
|
||
|
```
|
||
|
|
||
|
## Icons and Emojis
|
||
|
|
||
|
:smile:
|
||
|
|
||
|
:fontawesome-brands-github-alt:
|
||
|
|
||
|
:fontawesome-brands-twitter:{ .twitter}
|
||
|
|
||
|
:octicons-heart-fill-24:{ .heart}
|