from github to this gitea
This commit is contained in:
56
quarto tabsets.md
Normal file
56
quarto tabsets.md
Normal file
@@ -0,0 +1,56 @@
|
||||
up:: [[quarto blog]]
|
||||
link:: https://quarto.org/docs/output-formats/html-basics.html
|
||||
#informatique #blog
|
||||
|
||||
Pour faire une petite fenêtre avec des onglets (par exemple, montrer plusieurs langages).
|
||||
|
||||
> [!example]- Exemple
|
||||
> ````markdown
|
||||
> ::: {.panel-tabset}
|
||||
> ## R
|
||||
>
|
||||
> ``` {.r}
|
||||
> fizz_buzz <- function(fbnums = 1:50) {
|
||||
> output <- dplyr::case_when(
|
||||
> fbnums %% 15 == 0 ~ "FizzBuzz",
|
||||
> fbnums %% 3 == 0 ~ "Fizz",
|
||||
> fbnums %% 5 == 0 ~ "Buzz",
|
||||
> TRUE ~ as.character(fbnums)
|
||||
> )
|
||||
> print(output)
|
||||
> }
|
||||
> ```
|
||||
>
|
||||
> ## Python
|
||||
>
|
||||
> ``` {.python}
|
||||
> def fizz_buzz(num):
|
||||
> if num % 15 == 0:
|
||||
> print("FizzBuzz")
|
||||
> elif num % 5 == 0:
|
||||
> print("Buzz")
|
||||
> elif num % 3 == 0:
|
||||
> print("Fizz")
|
||||
> else:
|
||||
> print(num)
|
||||
> ```
|
||||
>
|
||||
> :::
|
||||
> ````
|
||||
|
||||
|
||||
Il est également possible de faire des **groupes de tabsets**. Ils seront alors synchronisés (si l'un change d'onglet, les autres le suivront).
|
||||
|
||||
> [!example] Exemple
|
||||
> ```markdown
|
||||
> ::: {.panel-tabset group="language"}
|
||||
> ## R
|
||||
>
|
||||
> Tab content
|
||||
>
|
||||
> ## Python
|
||||
>
|
||||
> Tab content
|
||||
> :::
|
||||
> ```
|
||||
|
Reference in New Issue
Block a user