Skip to content

Commit 07b0295

Browse files
committed
Improve description
1 parent 269e4fe commit 07b0295

File tree

2 files changed

+50
-13
lines changed

2 files changed

+50
-13
lines changed

README.md

+31-13
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,17 @@ To install the `quarto-panelize` extension, follow these steps:
1616
quarto add coatless-quarto/panelize
1717
```
1818

19-
This command will download and install the extension under the `_extensions` subdirectory of your Quarto project. If you are using version control, ensure that you include this directory in your repository.
19+
If you wish to make your code interactive, please install the following Quarto extensions:
20+
21+
```sh
22+
# For Python
23+
quarto add coatless-quarto/pyodide
24+
25+
# For R
26+
quarto add coatless/quarto-webr
27+
```
28+
29+
These commands will download and install the extension as well as any dependencies under the `_extensions` subdirectory of your Quarto project. If you are using version control, ensure that you include this directory in your repository.
2030

2131
## Usage
2232

@@ -37,6 +47,8 @@ Supported options include:
3747
| `.to-webr` | Convert code cell from static R code to interactive R code using webR. |
3848

3949

50+
### Display Source
51+
4052
For example, if we have a code cell with R that we want to show its options, then we use:
4153

4254
```` md
@@ -49,19 +61,26 @@ For example, if we have a code cell with R that we want to show its options, the
4961
:::
5062
````
5163

52-
### Interactivity
53-
54-
If you wish to make your code interactive, please install the following Quarto extensions:
55-
56-
```sh
57-
# For Python
58-
quarto add coatless-quarto/pyodide
64+
This will generate output equivalent to:
5965

60-
# For R
61-
quarto add coatless/quarto-webr
66+
```` md
67+
:::{.panel-tabset}
68+
### Results
69+
```{r}
70+
#| eval: true
71+
1 + 1
6272
```
73+
### Source
74+
```{{r}}
75+
#| eval: true
76+
1 + 1
77+
```
78+
:::
79+
````
80+
81+
### Interactivity
6382

64-
Next, modify the document header and place the desired extension filter **after** `panelize`, e.g.
83+
For creating a tabset that contains both rendered results and interactive option, modify the document header and place the desired extension filter **after** `panelize`, e.g.
6584

6685
```yml
6786
filters:
@@ -76,7 +95,7 @@ filters:
7695
> Otherwise, the interactivity filter will *not* detect the code cell!
7796
>
7897

79-
Finally, wrap the existing code cell using a `Div` with a class of either `.to-pyodide` or `.to-webr`.
98+
Next, wrap the existing code cell using a `Div` with a class of either `.to-pyodide` or `.to-webr`.
8099

81100
For Python, that looks like:
82101

@@ -98,7 +117,6 @@ For R, that looks like:
98117
:::
99118
````
100119

101-
102120
## Acknowledgements
103121

104122
Thanks to [@mcanouil](https://github.com/mcanouil) and [@cscheid](https://github.com/cscheid) who provided great insight into approaching this problem by re-orienting it in a way that is more managable. Please see the [full discussion](https://github.com/quarto-dev/quarto-cli/discussions/9646).

docs/index.qmd

+19
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,22 @@ print(x)
2929
:::
3030
````
3131

32+
This will generate output equivalent to:
33+
34+
````md
35+
:::{.panel-tabset}
36+
### Results
37+
```{{python}}
38+
#| echo: fenced
39+
#| eval: true
40+
x = [1, 2]
41+
print(x)
42+
```
43+
### Source
44+
```{{{python}}}
45+
#| eval: true
46+
x = [1, 2]
47+
print(x)
48+
```
49+
:::
50+
````

0 commit comments

Comments
 (0)