05:00
Intro Quarto @ Cascadia R Conf
Posit, PBC
Metadata: YAML
Text: Markdown
Code: Executed via knitr
or jupyter
Weave it all together, and you have beautiful, powerful, and useful outputs!
“Yet Another Markup Language” or “YAML Ain’t Markup Language” is used to provide document level metadata …
… in key-value pairs,
… that can nest,
… are fussy about indentation,
Indentation matters!
:
There are multiple ways of formatting valid YAML:
:
:
format: html
with additional options made with proper indentationTo avoid manually typing out all the options, every time when rendering via the CLI:
Lint, or a linter, is a static code analysis tool used to flag programming errors, bugs, stylistic errors and suspicious constructs.
RStudio + VSCode provide rich tab-completion - start a word and tab to complete, or Ctrl + space
to see all available options.
hello-penguins.qmd
in RStudio.Ctrl + space
to see the available YAML options.05:00
Many YAML fields are common across various outputs
But also each output type has its own set of valid YAML fields and options
Definitive list: quarto.org/docs/reference/formats/html
Markdown Syntax | Output |
---|---|
|
italics and bold |
|
superscript2 / subscript2 |
|
|
|
verbatim code |
Markdown Syntax | Output |
---|---|
|
Header 1 |
|
Header 2 |
|
Header 3 |
|
Header 4 |
|
Header 5 |
|
Header 6 |
There are several types of “links” or hyperlinks.
Markdown
Output
You can embed named hyperlinks, direct urls like https://quarto.org/, and links to other places in the document. The syntax is similar for embedding an inline image: .
![Penguins playing with a Quarto ball](images/penguins-quarto-ball.png)
![](images/penguins-quarto-ball.png){fig-align="left" width=250}
![](images/penguins-quarto-ball.png){fig-align="right" width=250 fig-alt="Illustration of two penguins playing with a Quarto ball."}
Unordered list:
Output
Ordered list:
Markdown:
> Let us change our traditional attitude to the construction of programs: Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do.
> - Donald Knuth, Literate Programming
Output:
Let us change our traditional attitude to the construction of programs: Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do. - Donald Knuth, Literate Programming
markdown-syntax.qmd
in RStudio.05:00