Skip to content

Commit c8b8ec0

Browse files
committed
Updating Quarto page to reflect new in-line code insertion capability
1 parent ca04207 commit c8b8ec0

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

quarto.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ The table below gives all of the options for code blocks.
168168
| `true` | True |
169169
| `false` | False |
170170

171-
Although it's a bit clunky, it's also possible to insert code results in-line with text. Here's a minimal example of that.
171+
It's also **possible to insert code results in-line with text**. Here's a minimal example of that.
172172

173173
````markdown
174174
---
@@ -180,7 +180,7 @@ number-sections: true
180180
jupyter: python3
181181
---
182182

183-
## Report
183+
## Report
184184

185185
For a demonstration of a line plot on a polar axis, see @fig-polar.
186186

@@ -195,16 +195,12 @@ import seaborn as sns
195195
df = sns.load_dataset("penguins")
196196
big_pen = df["body_mass_g"].max()
197197
number = len(df)
198-
display(
199-
Markdown(
200-
"""
198+
```
199+
201200
### The Heaviest Penguin
202201

203-
We find that the heaviest penguin, out of a total of {number} penguins, has a mass of {big_pen:.2f} kilograms.
204-
""".format(big_pen = big_pen, number=number)
205-
)
206-
)
207-
```
202+
We find that the heaviest penguin, out of a total of `python f"{number}"` penguins, has a mass of `python f"{big_pen:.2f}"` kilograms.
203+
208204
````
209205

210206
Note that, in this example, the `:2f` part of `{big_pen:.2f}` is an instruction to report the given number to 2 decimal places.
@@ -262,7 +258,7 @@ quarto render jupyter-report.ipynb --execute --to html
262258

263259
## The Optimal Workflow for Writing Automated Reports
264260

265-
This is an alternative to using the Visual Studio Code **Quarto** extension.
261+
This is an alternative to using the Visual Studio Code **Quarto** extension.
266262

267263
We now turn to a big tip on the optimal workflow for making automated reports and slides. Often you are interested in seeing how the final report will look as you change the code in *real time*. This is possible with Jupyter Notebooks and **Quarto**. Run the following in the terminal
268264

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)