Skip to content

Commit c2f197d

Browse files
cwickhamgithub-actions[bot]
authored andcommitted
Use inline code
(cherry picked from commit f834fbe)
1 parent 566add5 commit c2f197d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

docs/manuscripts/authoring/_inline-computations.qmd

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ avg_years_between_eruptions
208208
```
209209
:::
210210

211-
::: {.content-visible unless-meta="tool.is_rstudio"}
211+
::: {.content-visible when-meta="tool.is_jupyterlab"}
212212
You can also use computed values directly in your article text by using inline code. Read more in [Inline Code](/docs/computations/inline-code.qmd).
213213
:::
214214

@@ -226,6 +226,20 @@ When rendered, it displays as:
226226
You can read more about using code inline at [Inline Code](/docs/computations/execution-options.qmd#inline-code).
227227
:::
228228

229+
::: {.content-visible when-meta="tool.is_vscode"}
230+
You can use computed values directly in your article text using the syntax `` `{{python}} expr` ``. For example, consider this line in `index.qmd`:
231+
232+
``` markdown
233+
Based on data up to and including 1971, eruptions on La Palma happen every `{{python}} f"{avg_years_between_eruptions:.1f}"` years on average.
234+
```
235+
236+
When rendered, it displays as:
237+
238+
> Based on data up to and including 1971, eruptions on La Palma happen every 79.8 years on average.
239+
240+
You can read more about using code inline at [Inline Code](/docs/computations/execution-options.qmd#inline-code).
241+
:::
242+
229243
Rather than including computations directly in your article you can also embed outputs from other notebooks, read more below in [Embedding Notebooks](#embed).
230244

231245
### When is code executed?

0 commit comments

Comments
 (0)