|
1 | 1 | --- |
2 | | -title: "(4) Markdown" |
| 2 | +title: "Markdown basics" |
3 | 3 | --- |
4 | 4 |
|
5 | 5 | > **Acknowledgements:** This page is adapted from [health-data-science-OR/jupyterlab-introduction](https://github.com/health-data-science-OR/jupyterlab-introduction/blob/main/01_basic_markdown.ipynb). |
@@ -152,241 +152,6 @@ You can use this for quotes, highlights, or short notes. |
152 | 152 |
|
153 | 153 | ::: |
154 | 154 |
|
155 | | -## Callouts |
156 | | - |
157 | | -Quarto extends Markdown with **callouts**, which are highlighted boxes you can use for notes, tips, or warnings. |
158 | | - |
159 | | -Callouts use a small bit of extra syntax that Quarto understands as a "special box" rather than normal text. In Markdown, `::: ... :::` defines a block (a kind of container) that Quarto treats like an HTML `<div>`. By adding a class to that block, you tell Quarto what kind of callout it is. |
160 | | - |
161 | | -A simple callout note looks like this: |
162 | | - |
163 | | -* `:::` starts the block. |
164 | | -* `{.callout-note}` says that this is a class "callout-note" (just like HTML `<div class="callout-note">`)/ |
165 | | -* Everything until the closing `:::` is the content of the callout. |
166 | | -* The final `:::` closes the block. |
167 | | - |
168 | | -::::: {.columns} |
169 | | - |
170 | | -:::: {.column width=60%} |
171 | | - |
172 | | -Markdown: |
173 | | - |
174 | | -```markdown |
175 | | -::: {.callout-note} |
176 | | -This is a callout. |
177 | | -You can use it to draw attention to important information. |
178 | | -::: |
179 | | -``` |
180 | | - |
181 | | -:::: |
182 | | - |
183 | | -:::: {.column width=5%} |
184 | | - |
185 | | -:::: |
186 | | - |
187 | | -:::: {.column width=35%} |
188 | | - |
189 | | -Output: |
190 | | - |
191 | | -::: {.callout-note} |
192 | | -This is a callout. |
193 | | -You can use it to draw attention to important information. |
194 | | -::: |
195 | | - |
196 | | -:::: |
197 | | - |
198 | | -::::: |
199 | | - |
200 | | -You can change the type: |
201 | | - |
202 | | -::::: {.columns} |
203 | | - |
204 | | -:::: {.column width=60%} |
205 | | - |
206 | | -```markdown |
207 | | -::: {.callout-tip} |
208 | | -This is a tip. |
209 | | -::: |
210 | | -``` |
211 | | - |
212 | | -```markdown |
213 | | -::: {.callout-warning} |
214 | | -This is a warning. |
215 | | -::: |
216 | | -``` |
217 | | - |
218 | | -```markdown |
219 | | -::: {.callout-important} |
220 | | -This is important information. |
221 | | -::: |
222 | | -``` |
223 | | - |
224 | | -```markdown |
225 | | -::: {.callout-caution} |
226 | | -This is a caution. |
227 | | -::: |
228 | | -``` |
229 | | - |
230 | | -:::: |
231 | | - |
232 | | -:::: {.column width=5%} |
233 | | - |
234 | | -:::: |
235 | | - |
236 | | -:::: {.column width=35%} |
237 | | - |
238 | | -::: {.callout-tip} |
239 | | -This is a tip. |
240 | | -::: |
241 | | - |
242 | | -::: {.callout-warning} |
243 | | -This is a warning. |
244 | | -::: |
245 | | - |
246 | | -::: {.callout-important} |
247 | | -This is important information. |
248 | | -::: |
249 | | - |
250 | | -::: {.callout-caution} |
251 | | -This is a caution. |
252 | | -::: |
253 | | - |
254 | | -:::: |
255 | | - |
256 | | -::::: |
257 | | - |
258 | | -You can add a title: |
259 | | - |
260 | | -::::: {.columns} |
261 | | - |
262 | | -:::: {.column width=60%} |
263 | | - |
264 | | -```markdown |
265 | | -::: {.callout-tip title="Helpful tip"} |
266 | | -Remember to save your file before you render. |
267 | | -::: |
268 | | -``` |
269 | | - |
270 | | -:::: |
271 | | - |
272 | | -:::: {.column width=5%} |
273 | | - |
274 | | -:::: |
275 | | - |
276 | | -:::: {.column width=35%} |
277 | | - |
278 | | -::: {.callout-tip title="Helpful tip"} |
279 | | -Remember to save your file before you render. |
280 | | -::: |
281 | | - |
282 | | -:::: |
283 | | - |
284 | | -::::: |
285 | | - |
286 | | -You can also set the callout to collapse: |
287 | | - |
288 | | -::::: {.columns} |
289 | | - |
290 | | -:::: {.column width=60%} |
291 | | - |
292 | | -``` |
293 | | -::: {.callout-note title="More details" collapse="true"} |
294 | | -This extra information is hidden until you click the arrow. |
295 | | -::: |
296 | | -``` |
297 | | - |
298 | | -:::: |
299 | | - |
300 | | -:::: {.column width=5%} |
301 | | - |
302 | | -:::: |
303 | | - |
304 | | -:::: {.column width=35%} |
305 | | - |
306 | | -::: {.callout-note title="More details" collapse="true"} |
307 | | -This extra information is hidden until you click the arrow. |
308 | | -::: |
309 | | - |
310 | | -:::: |
311 | | - |
312 | | -::::: |
313 | | - |
314 | | -You can change the appearance style to `simple` or `minimal`: |
315 | | - |
316 | | -::::: {.columns} |
317 | | - |
318 | | -:::: {.column width=60%} |
319 | | - |
320 | | -```markdown |
321 | | -::: {.callout-note appearance="simple"} |
322 | | -This is a simple callout. |
323 | | -::: |
324 | | -``` |
325 | | - |
326 | | -```markdown |
327 | | -::: {.callout-note appearance="minimal"} |
328 | | -This is a minimal callout. |
329 | | -::: |
330 | | -``` |
331 | | - |
332 | | -:::: |
333 | | - |
334 | | -:::: {.column width=5%} |
335 | | - |
336 | | -:::: |
337 | | - |
338 | | -:::: {.column width=35%} |
339 | | - |
340 | | -::: {.callout-note appearance="simple"} |
341 | | -This is a simple callout. |
342 | | -::: |
343 | | - |
344 | | -::: {.callout-note appearance="minimal"} |
345 | | -This is a minimal callout. |
346 | | -::: |
347 | | - |
348 | | -:::: |
349 | | - |
350 | | -::::: |
351 | | - |
352 | | -You can also hide the icon: |
353 | | - |
354 | | -::::: {.columns} |
355 | | - |
356 | | -:::: {.column width=60%} |
357 | | - |
358 | | -```markdown |
359 | | -::: {.callout-note icon="false"} |
360 | | -Default callout with icon removed |
361 | | -::: |
362 | | -``` |
363 | | - |
364 | | -:::: |
365 | | - |
366 | | -:::: {.column width=5%} |
367 | | - |
368 | | -:::: |
369 | | - |
370 | | -:::: {.column width=35%} |
371 | | - |
372 | | -::: {.callout-note icon="false"} |
373 | | -Default callout with icon removed |
374 | | -::: |
375 | | - |
376 | | -:::: |
377 | | - |
378 | | -::::: |
379 | | - |
380 | | -::: {.pale-blue} |
381 | | - |
382 | | -**Task:** In `markdown.qmd`: |
383 | | - |
384 | | -* [ ] Add a callout of type `tip` with a short title (e.g., "Helpful tip"). |
385 | | -* [ ] Inside the callout, write one sentence of advice (e.g., "Take short breaks when you are concentrating."). |
386 | | -* [ ] Add another callout with `collapse="true"` (e.g., with title "More information" and with content "You can come back to this note later if you need it."). |
387 | | - |
388 | | -::: |
389 | | - |
390 | 155 | ## Line break |
391 | 156 |
|
392 | 157 | You can insert a line break using `<br>`. |
|
0 commit comments