diff --git a/docs/get-started/computations/rstudio.qmd b/docs/get-started/computations/rstudio.qmd index f7b2dd8140..1bd4556cb1 100644 --- a/docs/get-started/computations/rstudio.qmd +++ b/docs/get-started/computations/rstudio.qmd @@ -262,15 +262,10 @@ mean_hwy <- round(mean(mpg$hwy), 2) Then, add the following markdown text to your Quarto document. -```{=html} -
-
-
-The average city mileage of the cars in our data is `r mean_cty` and the average highway mileage is `r mean_hwy`. 
-
-
-
+```markdown +The average city mileage of the cars in our data is `{r} mean_cty` and the average highway mileage is `{r} mean_hwy`. ``` + Save your document and inspect the rendered output. ::: border @@ -303,7 +298,7 @@ If you followed along step-by-step with this tutorial, you should now have a Qua Otherwise, you can download a completed version of `computations.qmd` below. ::: {.callout-note appearance="minimal"} - [Download computations-complete.qmd](_computations-complete.qmd){download="computations-complete.qmd"} +``{=html} [Download computations-complete.qmd](_computations-complete.qmd){download="computations-complete.qmd"} ::: {{< include _footer.md >}} diff --git a/docs/visual-editor/technical.qmd b/docs/visual-editor/technical.qmd index 34ccc167c2..22b94cab4b 100644 --- a/docs/visual-editor/technical.qmd +++ b/docs/visual-editor/technical.qmd @@ -69,8 +69,8 @@ Source code which you include in a Quarto document can either be for display onl To display but not execute code, either use the **Insert -\> Code Block** menu item, or start a new line and type either: -1. ```` ``` ```` (for a plain code block); or -2. ```` ``` ```` (where \ is a language) for a code block with syntax highlighting. +1. ` ``` ` (for a plain code block); or +2. ` ``` ` (where `` is a language) for a code block with syntax highlighting. Then press the **Enter** key. To display code inline, simply surround text with backticks (`` `code` ``), or use the **Format -\> Code** menu item. @@ -78,11 +78,13 @@ Then press the **Enter** key. To display code inline, simply surround text with To insert an executable code chunk, use the **Insert -\> Code Chunk** menu item, or start a new line and type: -```` ```{r} ```` +` ```{r} ` -Then press the **Enter** key. Note that `r` could be another language supported by knitr (e.g. `python` or `sql`) and you can also include a chunk label and other chunk options. +Then press the **Enter** key. Note that `r` could be another language supported by `knitr` (e.g., `python` or `sql`) and you can also include a chunk label and other chunk options. -To include inline R code, you just create normal inline code (e.g. by using backticks or the ⌘ D shortcut) but preface it with `r` or `{r}`. For example, this inline code will be executed by knitr: `` `r Sys.Date()` ``. Note that when the code displays in visual mode it won't have the backticks (but they will still appear in source mode). +To include [inline R code](/docs/computations/inline-code.qmd), create normal inline code (e.g., by using backticks or the ⌘ D shortcut) but preface it with `{r}` (or `r`). For example, to include the current date using the R function `Sys.Date()` you would use: `` `{r} Sys.Date()` ``. + +Note that when the code displays in visual mode it won't have the backticks (but they will still appear in source mode). ### Running Chunks