|
106 | 106 | - `pinned` - if present, show the cell's source code |
107 | 107 | - `hidden` - if present, suppress the cell's implicit display |
108 | 108 | - `output` - for non-JavaScript cells, how to expose the value |
109 | | - - `database` - for SQL cells, which database to query |
| 109 | + - `database` - for [SQL cells](./databases), which database to query |
| 110 | + - `format` - for [data loader cells](./data-loaders), the output format |
110 | 111 | - `id` - the cell identifier, for stable editing (optional) |
111 | 112 | </script> |
112 | 113 | <script id="49" type="text/markdown"> |
|
120 | 121 | - `application/x-tex` - ${tex`\TeX`} |
121 | 122 | - `text/vnd.graphviz` - DOT (Graphviz) |
122 | 123 | - `application/vnd.observable.javascript` - Observable JavaScript |
| 124 | + - `application/vnd.node.javascript` - Node.js |
| 125 | + - `text/x-python` - Python |
| 126 | + - `text/x-r` - R |
123 | 127 |
|
124 | 128 | Here's an example of each supported cell type. |
125 | 129 | </script> |
@@ -198,6 +202,35 @@ <h1>Hello, <i>world</i>!</h1> |
198 | 202 | <\/script> |
199 | 203 | ``` |
200 | 204 | </script> |
| 205 | + <script id="87" type="text/markdown"> |
| 206 | + A Node.js (`application/vnd.node.javascript`) data loader cell: |
| 207 | + |
| 208 | + ```html |
| 209 | + <script type="application/vnd.node.javascript"> |
| 210 | + process.stdout.write("hello world"); |
| 211 | + <\/script> |
| 212 | + ``` |
| 213 | + </script> |
| 214 | + <script id="89" type="text/markdown"> |
| 215 | + A Python (`text/x-python`) data loader cell: |
| 216 | + |
| 217 | + ```html |
| 218 | + <script type="text/x-python"> |
| 219 | + import sys |
| 220 | +
|
| 221 | + sys.stdout.write("hello world") |
| 222 | + <\/script> |
| 223 | + ``` |
| 224 | + </script> |
| 225 | + <script id="91" type="text/markdown"> |
| 226 | + An R (`text/x-r`) data loader cell: |
| 227 | + |
| 228 | + ```html |
| 229 | + <script type="text/r"> |
| 230 | + cat("hello world") |
| 231 | + <\/script> |
| 232 | + ``` |
| 233 | + </script> |
201 | 234 | <script id="51" type="text/markdown"> |
202 | 235 | The `pinned` attribute determines whether to show the cell's source code. The `hidden` attribute suppresses the cell's implicit display; for example, you can use it hide a SQL cell's results table. Cells can also have an `id` attribute to indicate a unique (positive integer) identifier; an `id` isn't required, but gives cells a stable identity for editing. |
203 | 236 | </script> |
|
0 commit comments