Skip to content

Commit

Permalink
Switch the second example to R; enable a demo.
Browse files Browse the repository at this point in the history
  • Loading branch information
coatless committed Nov 26, 2024
1 parent 5bc6fbb commit c378c48
Showing 1 changed file with 40 additions and 14 deletions.
54 changes: 40 additions & 14 deletions docs/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
```
:::

Expand Down Expand Up @@ -94,33 +94,59 @@ 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");
}
```
:::

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 |
Expand Down

0 comments on commit c378c48

Please sign in to comment.