You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+31-13
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,17 @@ To install the `quarto-panelize` extension, follow these steps:
16
16
quarto add coatless-quarto/panelize
17
17
```
18
18
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.
20
30
21
31
## Usage
22
32
@@ -37,6 +47,8 @@ Supported options include:
37
47
| `.to-webr` | Convert code cell from static R code to interactive R code using webR. |
38
48
39
49
50
+
### Display Source
51
+
40
52
For example, if we have a code cell with R that we want to show its options, then we use:
41
53
42
54
````md
@@ -49,19 +61,26 @@ For example, if we have a code cell with R that we want to show its options, the
49
61
:::
50
62
````
51
63
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:
59
65
60
-
# For R
61
-
quarto add coatless/quarto-webr
66
+
````md
67
+
:::{.panel-tabset}
68
+
### Results
69
+
```{r}
70
+
#| eval: true
71
+
1 + 1
62
72
```
73
+
### Source
74
+
```{{r}}
75
+
#| eval: true
76
+
1 + 1
77
+
```
78
+
:::
79
+
````
80
+
81
+
### Interactivity
63
82
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.
65
84
66
85
```yml
67
86
filters:
@@ -76,7 +95,7 @@ filters:
76
95
> Otherwise, the interactivity filter will *not* detect the code cell!
77
96
>
78
97
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`.
80
99
81
100
For Python, that looks like:
82
101
@@ -98,7 +117,6 @@ For R, that looks like:
98
117
:::
99
118
````
100
119
101
-
102
120
## Acknowledgements
103
121
104
122
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).
0 commit comments