Skip to content

Commit 177202e

Browse files
committed
docs: add code-annotations example
1 parent f4f4781 commit 177202e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

_extensions/coeos/_extension.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ contributes:
77
revealjs:
88
theme: coeos.scss
99
highlight-style: github-dark
10+
mermaid:
11+
theme: dark
1012
date-format: 'dddd[, the] Do [of] MMMM, YYYY'
1113
slide-number: c
14+
code-annotations: select
1215
footer: |
1316
<a href="https://mickael.canouil.fr/">mickael.canouil.fr</a>
1417
|

template.qmd

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,21 @@ format:
4040
{{< placeholder 600 400 >}}
4141

4242
:::
43+
44+
# PART 2 With `code` {.center .center-x}
45+
46+
## Code annotation
47+
48+
```{.python}
49+
import numpy as np # <1>
50+
51+
def f(x): # <2>
52+
return np.sin(x) # <3>
53+
54+
# Example of a simple function using NumPy
55+
f(0)
56+
```
57+
58+
1. Importing the NumPy library.
59+
2. Defining a function `f` that takes an argument `x`.
60+
3. Returning the sine of `x` using NumPy's `sin` function.

0 commit comments

Comments
 (0)