From c378c48b53a3ed6aa2747b3f6a66dd0eb779d670 Mon Sep 17 00:00:00 2001 From: "james.balamuta@gmail.com" Date: Tue, 26 Nov 2024 00:31:37 -0600 Subject: [PATCH] Switch the second example to R; enable a demo. --- docs/index.qmd | 54 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/docs/index.qmd b/docs/index.qmd index 04c7df4..2ff67db 100644 --- a/docs/index.qmd +++ b/docs/index.qmd @@ -37,32 +37,32 @@ Create a tabset by wrapping code blocks in a div with the `tabby` class: ````markdown ::: {.tabby} ```{{python}} -print("Hello, World!") +print("Hello, Python World!") ``` ```javascript -console.log("Hello, World!"); +console.log("Hello, JavaScript World!"); ``` ```{{r}} -print("Hello, World!") +print("Hello, R World!") ``` ::: ```` -This will automatically create a tabset with three tabs: "Python", "Javascript", and "R", each containing the respective code. +This will automatically create a tabset with three tabs: "Python", "Javascript", and "R", each containing the respective code and, where applicable, its output. ::: {.tabby} ```{python} -print("Hello, World!") +print("Hello, Python World!") ``` ```javascript -console.log("Hello, World!"); +console.log("Hello, JavaScript World!"); ``` ```{r} -print("Hello, World!") +print("Hello, R World!") ``` ::: @@ -94,14 +94,14 @@ Synchronize tab selection across multiple tabsets using the `group` attribute, s ````markdown ::: {.tabby group="mygroup"} -```python +```{{python}} def greet(): print("Hello!") ``` -```javascript -function greet() { - console.log("Hello!"); +```{{r}} +greet <- function() { + cat("Hello!\n"); } ``` ::: @@ -109,18 +109,44 @@ function greet() { Some text in between... ::: {.tabby group="mygroup"} -```python +```{{python}} greet() ``` -```javascript -greet(); +```{{r}} +greet() ``` ::: ```` When you switch tabs in one tabset, all tabsets in the same group will switch to the same language. + +::: {.tabby group="mygroup"} +```{python} +def greet(): + print("Hello!") +``` + +```{r} +greet <- function() { + cat("Hello!\n"); +} +``` +::: + +Some text in between... + +::: {.tabby group="mygroup"} +```{python} +greet() +``` + +```{r} +greet() +``` +::: + ## Configuration Options | Option | Description | Default | Example |