Skip to content

Commit 150c3b4

Browse files
authored
Merge pull request #1405 from quarto-dev/sync-1400-to-prerelease
[Sync to prerelease] Update RStudio and VS Code manuscript tutorials to use inline code syntax
2 parents 566add5 + 58669b8 commit 150c3b4

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

docs/manuscripts/authoring/_inline-computations.qmd

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,29 @@ 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

215215
::: {.content-visible when-meta="tool.is_rstudio"}
216-
You can use computed values directly in your article text using the syntax `` `r expr` ``. For example, consider this line in `index.qmd`:
216+
You can use computed values directly in your article text using the syntax `` `{{r}} expr` ``. For example, consider this line in `index.qmd`:
217+
218+
``` markdown
219+
Based on data up to and including 1971, eruptions on La Palma happen every `{{r}} round(avg_years_between_eruptions, 1)` years on average.
220+
```
221+
222+
When rendered, it displays as:
223+
224+
> Based on data up to and including 1971, eruptions on La Palma happen every 79.8 years on average.
225+
226+
You can read more about using code inline at [Inline Code](/docs/computations/execution-options.qmd#inline-code).
227+
:::
228+
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`:
217231

218232
``` markdown
219-
Based on data up to and including 1971, eruptions on La Palma happen every `r round(avg_years_between_eruptions, 1)` years on average.
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.
220234
```
221235

222236
When rendered, it displays as:

0 commit comments

Comments
 (0)