Skip to content

Commit 4c6dfd3

Browse files
authored
Merge pull request #1334 from mcanouil/default-bracket-inline
docs: make bracketed inline code the default syntax
2 parents 295c1f0 + 45d6d83 commit 4c6dfd3

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

docs/get-started/computations/rstudio.qmd

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -262,15 +262,10 @@ mean_hwy <- round(mean(mpg$hwy), 2)
262262

263263
Then, add the following markdown text to your Quarto document.
264264

265-
```{=html}
266-
<div class="sourceCode">
267-
<pre class="sourceCode markdown">
268-
<code class="sourceCode markdown">
269-
The average city mileage of the cars in our data is &#96;r mean_cty&#96 and the average highway mileage is &#96;r mean_hwy&#96.
270-
</code>
271-
</pre>
272-
</div>
265+
```markdown
266+
The average city mileage of the cars in our data is `{r} mean_cty` and the average highway mileage is `{r} mean_hwy`.
273267
```
268+
274269
Save your document and inspect the rendered output.
275270

276271
::: border
@@ -303,7 +298,7 @@ If you followed along step-by-step with this tutorial, you should now have a Qua
303298
Otherwise, you can download a completed version of `computations.qmd` below.
304299

305300
::: {.callout-note appearance="minimal"}
306-
<i class="bi bi-download"></i> [Download computations-complete.qmd](_computations-complete.qmd){download="computations-complete.qmd"}
301+
`<i class="bi bi-download"></i>`{=html} [Download computations-complete.qmd](_computations-complete.qmd){download="computations-complete.qmd"}
307302
:::
308303

309304
{{< include _footer.md >}}

docs/visual-editor/technical.qmd

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,22 @@ Source code which you include in a Quarto document can either be for display onl
6969

7070
To display but not execute code, either use the **Insert -\> Code Block** menu item, or start a new line and type either:
7171

72-
1. ```` ``` ```` (for a plain code block); or
73-
2. ```` ```<lang> ```` (where \<lang\> is a language) for a code block with syntax highlighting.
72+
1. ` ``` ` (for a plain code block); or
73+
2. ` ```<lang> ` (where `<lang>` is a language) for a code block with syntax highlighting.
7474

7575
Then press the **Enter** key. To display code inline, simply surround text with backticks (`` `code` ``), or use the **Format -\> Code** menu item.
7676

7777
### Code Chunks
7878

7979
To insert an executable code chunk, use the **Insert -\> Code Chunk** menu item, or start a new line and type:
8080

81-
```` ```{r} ````
81+
` ```{r} `
8282

83-
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.
83+
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.
8484

85-
To include inline R code, you just create normal inline code (e.g. by using backticks or the <kbd>⌘ D</kbd> 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).
85+
To include [inline R code](/docs/computations/inline-code.qmd), create normal inline code (e.g., by using backticks or the <kbd>⌘ D</kbd> 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()` ``.
86+
87+
Note that when the code displays in visual mode it won't have the backticks (but they will still appear in source mode).
8688

8789
### Running Chunks
8890

0 commit comments

Comments
 (0)