Skip to content

Commit

Permalink
moslty done intro to Quarto
Browse files Browse the repository at this point in the history
  • Loading branch information
ttimbers committed Feb 12, 2024
1 parent 3025f16 commit 64b87d7
Show file tree
Hide file tree
Showing 57 changed files with 1,233 additions and 611 deletions.
2 changes: 2 additions & 0 deletions docs/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@
<li class="toctree-l1"><a class="reference internal" href="materials/lectures/05-containerization-3.html">Customizing and building containers</a></li>
<li class="toctree-l1"><a class="reference internal" href="materials/lectures/07-scripts.html">Non-interactive scripts</a></li>
<li class="toctree-l1"><a class="reference internal" href="materials/lectures/08-reproducible-reports.html">Reproducible reports</a></li>


<li class="toctree-l1"><a class="reference internal" href="materials/lectures/09-pipelines.html">Data analysis pipelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="materials/lectures/06-intro-to-testing-code.html">Introduction to testing code for data science</a></li>
<li class="toctree-l1"><a class="reference internal" href="materials/lectures/10-packaging-and-documenting.html">Packaging and documenting code</a></li>
Expand Down
187 changes: 182 additions & 5 deletions docs/_sources/materials/lectures/08-reproducible-reports.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"In these notes, we will generally introduce this tool,\n",
"and demonstrate how to: \n",
"\n",
"- Anatomy of a Quarto document\n",
"- Create document sections and a table of contents.\n",
"- Add citations and a bibliography.\n",
"- Format figures and figure captions, as well as automatically number them and cross reference them in the narrative text.\n",
Expand All @@ -108,7 +109,7 @@
"\n",
"There are two ways to render a document from the `qmd` source to the desired output. One is using a button in RStudio - the **\"Render\"** button that looks like this:\n",
"\n",
"<img src=\"img/render.png\" width=200>\n",
"<img src=\"img/render.png\" width=100>\n",
"\n",
"Try clicking that button and see what happens!\n",
"\n",
Expand All @@ -122,14 +123,190 @@
"\n",
"RStudio has implemented a new feature for working with Quarto to make it more similar to working with Jupyter - it is called the visual markdown editor. Checkout this feature by clicking the visual markdown editor button when you have an R Markdown file open in the editor. The button looks like this:\n",
"\n",
"<img src=\"img/viz-md-button.png\" width=250>"
"<img src=\"img/viz-md-button.png\" width=125>"
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "markdown",
"metadata": {},
"source": [
"## Anatomy of a Quarto document\n",
"\n",
"At a basic level, a Quarto document has three parts:\n",
"\n",
"1. Yaml frontmatter\n",
"\n",
"2. Markdown text\n",
"\n",
"3. Code chunks\n",
"\n",
"TBD - add figure of Quarto doc, highlighting each part.\n",
"\n",
"\n",
"### Yaml frontmatter\n",
"\n",
"The yaml frontmatter controls global settings for the report\n",
"(document output types, code display defaults, table of contents presence and depth), \n",
"as well as houses document metadata (e.g., author, date, etc).\n",
"Below is an example yaml frontmatter which sets the:\n",
"\n",
"- Title\n",
"- Author\n",
"- Date of report rendering\n",
"- Document render format to HTML\n",
"- Document have a references section and the source file for the references\n",
"- Source code to be hidden in the rendered report\n",
"- RStudio editor to show the source code view instead of the visual markdown view\n",
"\n",
"```\n",
"---\r",
"title: \"Historical Horse Population in Canada\"\r",
"author: \"Tiffany Timbers\"\r",
"date: Sys.Date()\r",
"format: html\r",
"bibliography: references.bib\r",
"execute:\r",
" echo: false\r",
"editor: visual\r",
"---\n",
"```\n",
"\n",
"### Markdown text\n",
"\n",
"Following the yaml frontmatter section, by default, \n",
"the rest of the document is considered Markdown text.\n",
"If no markdown syntax is used, \n",
"the text will be rendered as unformatted text. \n",
"Here is a table of very common markdown formatting that you might find useful:\n",
"\n",
"| Description | Markdown syntax | Output |\n",
"|-------------|-----------------|--------|\n",
"| Bold text | `**Bold text**` | **Bold text** |\n",
"| Italic text | `*Italic text*` | *Italic text* |\n",
"| Bold Italic text | `***Bold Italic text***` | ***Bold Italic text*** |\n",
"| verbatim code (not executed) | \\`verbatim code\\ | `verbatim code` |\n",
"| Inline math | `$E = mc^{2}$` | $E = mc^{2}$ |\n",
"| Display math | `$$E = mc^{2}$$` | $$E = mc^{2}$$ |\n",
"\n",
"\n",
"See the Quarto Mardown docs for additional formatting that you might need to do:\n",
"- [Quarto Markdown basics](https://quarto.org/docs/authoring/markdown-basics.html)\n",
"\n",
"## Code chunks\n",
"\n",
"Just like Jupyter notebooks,\n",
"Quarto has code cells,\n",
"although they're more commonly referred to as code \"chunks\" or \"blocks\".\n",
"These are based off fenced Markdown code blocks\n",
"and always start and end with 3 backticks (\\`\\`\\`),\n",
"just like in Markdown.\n",
"Unique to Quarto\n",
"is that the leading three backticks are followed by curly braces\n",
"containing the language engine you want to run,\n",
"which for r looks like this `{r}`.\n",
"For Python, they would look like `{python}`.\n",
"Additional metadata can be included,\n",
"for example a name to reference the code chunk:\n",
"\n",
"````\n",
"```{r my-first-code-chunk}\n",
"x <- 5\n",
"x\n",
"```\n",
"````\n",
"\n",
"All code cells are run when you render the entire document\n",
"(like pressing \"Run all\" in JupyterLab).\n",
"By default,\n",
"the code in the chunk and the code output will be included in your rendered document.\n",
"You can also run the code by clicking the green play button on the right-hand side of the code chunk."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Document sections and a table of contents.\n",
"\n",
"By using Markdown formatted headers, \n",
"we can create document sections that we can link to, \n",
"as well as easily create linkable table of contents.\n",
"This is especially important in longer documents,\n",
"that without such features are hard to navigate.\n",
"\n",
"Markdown headers are specified by staring the line with\n",
"one or more `#` characters. \n",
"\n",
"A single `#` results in a first level header, \n",
"two `#`'s results in a second level header,\n",
"three `#'s` results in a third level header,\n",
"and so on.\n",
"\n",
"For example:\n",
"\n",
"```\n",
"# First level header\n",
"```\n",
"\n",
"results in:\n",
"\n",
"# First level header\n",
"\n",
"while:\n",
"\n",
"\n",
"```\n",
"# Second level header\n",
"```\n",
"\n",
"results in:\n",
"\n",
"# Second level header\n",
"\n",
"Once the headers have been created in the document, \n",
"the yaml frontmatter can be edited to specify that \n",
"you would like a table of contents, and to what depth\n",
"of header level you would like to include in it."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Citations and a bibliographies"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Figures"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Tables"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Inline code"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Code chunk formatting options"
]
},
{
"cell_type": "markdown",
"metadata": {},
"outputs": [],
"source": []
}
],
Expand Down
2 changes: 2 additions & 0 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@
<li class="toctree-l1"><a class="reference internal" href="materials/lectures/05-containerization-3.html">Customizing and building containers</a></li>
<li class="toctree-l1"><a class="reference internal" href="materials/lectures/07-scripts.html">Non-interactive scripts</a></li>
<li class="toctree-l1"><a class="reference internal" href="materials/lectures/08-reproducible-reports.html">Reproducible reports</a></li>


<li class="toctree-l1"><a class="reference internal" href="materials/lectures/09-pipelines.html">Data analysis pipelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="materials/lectures/06-intro-to-testing-code.html">Introduction to testing code for data science</a></li>
<li class="toctree-l1"><a class="reference internal" href="materials/lectures/10-packaging-and-documenting.html">Packaging and documenting code</a></li>
Expand Down
2 changes: 2 additions & 0 deletions docs/materials/lectures/01-intro-to-ds-workflows-Copy1.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@
<li class="toctree-l1"><a class="reference internal" href="05-containerization-3.html">Customizing and building containers</a></li>
<li class="toctree-l1"><a class="reference internal" href="07-scripts.html">Non-interactive scripts</a></li>
<li class="toctree-l1"><a class="reference internal" href="08-reproducible-reports.html">Reproducible reports</a></li>


<li class="toctree-l1"><a class="reference internal" href="09-pipelines.html">Data analysis pipelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="06-intro-to-testing-code.html">Introduction to testing code for data science</a></li>
<li class="toctree-l1"><a class="reference internal" href="10-packaging-and-documenting.html">Packaging and documenting code</a></li>
Expand Down
2 changes: 2 additions & 0 deletions docs/materials/lectures/01-intro-to-ds-workflows.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@
<li class="toctree-l1"><a class="reference internal" href="05-containerization-3.html">Customizing and building containers</a></li>
<li class="toctree-l1"><a class="reference internal" href="07-scripts.html">Non-interactive scripts</a></li>
<li class="toctree-l1"><a class="reference internal" href="08-reproducible-reports.html">Reproducible reports</a></li>


<li class="toctree-l1"><a class="reference internal" href="09-pipelines.html">Data analysis pipelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="06-intro-to-testing-code.html">Introduction to testing code for data science</a></li>
<li class="toctree-l1"><a class="reference internal" href="10-packaging-and-documenting.html">Packaging and documenting code</a></li>
Expand Down
2 changes: 2 additions & 0 deletions docs/materials/lectures/02-intro-to-bash.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@
<li class="toctree-l1"><a class="reference internal" href="05-containerization-3.html">Customizing and building containers</a></li>
<li class="toctree-l1"><a class="reference internal" href="07-scripts.html">Non-interactive scripts</a></li>
<li class="toctree-l1"><a class="reference internal" href="08-reproducible-reports.html">Reproducible reports</a></li>


<li class="toctree-l1"><a class="reference internal" href="09-pipelines.html">Data analysis pipelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="06-intro-to-testing-code.html">Introduction to testing code for data science</a></li>
<li class="toctree-l1"><a class="reference internal" href="10-packaging-and-documenting.html">Packaging and documenting code</a></li>
Expand Down
2 changes: 2 additions & 0 deletions docs/materials/lectures/02-version-control-1.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@
<li class="toctree-l1"><a class="reference internal" href="05-containerization-3.html">Customizing and building containers</a></li>
<li class="toctree-l1"><a class="reference internal" href="07-scripts.html">Non-interactive scripts</a></li>
<li class="toctree-l1"><a class="reference internal" href="08-reproducible-reports.html">Reproducible reports</a></li>


<li class="toctree-l1"><a class="reference internal" href="09-pipelines.html">Data analysis pipelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="06-intro-to-testing-code.html">Introduction to testing code for data science</a></li>
<li class="toctree-l1"><a class="reference internal" href="10-packaging-and-documenting.html">Packaging and documenting code</a></li>
Expand Down
2 changes: 2 additions & 0 deletions docs/materials/lectures/02-version-control-2.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@
<li class="toctree-l1"><a class="reference internal" href="05-containerization-3.html">Customizing and building containers</a></li>
<li class="toctree-l1"><a class="reference internal" href="07-scripts.html">Non-interactive scripts</a></li>
<li class="toctree-l1"><a class="reference internal" href="08-reproducible-reports.html">Reproducible reports</a></li>


<li class="toctree-l1"><a class="reference internal" href="09-pipelines.html">Data analysis pipelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="06-intro-to-testing-code.html">Introduction to testing code for data science</a></li>
<li class="toctree-l1"><a class="reference internal" href="10-packaging-and-documenting.html">Packaging and documenting code</a></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@
<li class="toctree-l1"><a class="reference internal" href="05-containerization-3.html">Customizing and building containers</a></li>
<li class="toctree-l1"><a class="reference internal" href="07-scripts.html">Non-interactive scripts</a></li>
<li class="toctree-l1"><a class="reference internal" href="08-reproducible-reports.html">Reproducible reports</a></li>


<li class="toctree-l1"><a class="reference internal" href="09-pipelines.html">Data analysis pipelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="06-intro-to-testing-code.html">Introduction to testing code for data science</a></li>
<li class="toctree-l1"><a class="reference internal" href="10-packaging-and-documenting.html">Packaging and documenting code</a></li>
Expand Down
2 changes: 2 additions & 0 deletions docs/materials/lectures/04-virtual-environments.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@
<li class="toctree-l1"><a class="reference internal" href="05-containerization-3.html">Customizing and building containers</a></li>
<li class="toctree-l1"><a class="reference internal" href="07-scripts.html">Non-interactive scripts</a></li>
<li class="toctree-l1"><a class="reference internal" href="08-reproducible-reports.html">Reproducible reports</a></li>


<li class="toctree-l1"><a class="reference internal" href="09-pipelines.html">Data analysis pipelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="06-intro-to-testing-code.html">Introduction to testing code for data science</a></li>
<li class="toctree-l1"><a class="reference internal" href="10-packaging-and-documenting.html">Packaging and documenting code</a></li>
Expand Down
2 changes: 2 additions & 0 deletions docs/materials/lectures/05-containerization-1.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@
<li class="toctree-l1"><a class="reference internal" href="05-containerization-3.html">Customizing and building containers</a></li>
<li class="toctree-l1"><a class="reference internal" href="07-scripts.html">Non-interactive scripts</a></li>
<li class="toctree-l1"><a class="reference internal" href="08-reproducible-reports.html">Reproducible reports</a></li>


<li class="toctree-l1"><a class="reference internal" href="09-pipelines.html">Data analysis pipelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="06-intro-to-testing-code.html">Introduction to testing code for data science</a></li>
<li class="toctree-l1"><a class="reference internal" href="10-packaging-and-documenting.html">Packaging and documenting code</a></li>
Expand Down
2 changes: 2 additions & 0 deletions docs/materials/lectures/05-containerization-2.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@
<li class="toctree-l1"><a class="reference internal" href="05-containerization-3.html">Customizing and building containers</a></li>
<li class="toctree-l1"><a class="reference internal" href="07-scripts.html">Non-interactive scripts</a></li>
<li class="toctree-l1"><a class="reference internal" href="08-reproducible-reports.html">Reproducible reports</a></li>


<li class="toctree-l1"><a class="reference internal" href="09-pipelines.html">Data analysis pipelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="06-intro-to-testing-code.html">Introduction to testing code for data science</a></li>
<li class="toctree-l1"><a class="reference internal" href="10-packaging-and-documenting.html">Packaging and documenting code</a></li>
Expand Down
2 changes: 2 additions & 0 deletions docs/materials/lectures/05-containerization-3.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@
<li class="toctree-l1 current active"><a class="current reference internal" href="#">Customizing and building containers</a></li>
<li class="toctree-l1"><a class="reference internal" href="07-scripts.html">Non-interactive scripts</a></li>
<li class="toctree-l1"><a class="reference internal" href="08-reproducible-reports.html">Reproducible reports</a></li>


<li class="toctree-l1"><a class="reference internal" href="09-pipelines.html">Data analysis pipelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="06-intro-to-testing-code.html">Introduction to testing code for data science</a></li>
<li class="toctree-l1"><a class="reference internal" href="10-packaging-and-documenting.html">Packaging and documenting code</a></li>
Expand Down
2 changes: 2 additions & 0 deletions docs/materials/lectures/06-intro-to-testing-code.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@
<li class="toctree-l1"><a class="reference internal" href="05-containerization-3.html">Customizing and building containers</a></li>
<li class="toctree-l1"><a class="reference internal" href="07-scripts.html">Non-interactive scripts</a></li>
<li class="toctree-l1"><a class="reference internal" href="08-reproducible-reports.html">Reproducible reports</a></li>


<li class="toctree-l1"><a class="reference internal" href="09-pipelines.html">Data analysis pipelines</a></li>
<li class="toctree-l1 current active"><a class="current reference internal" href="#">Introduction to testing code for data science</a></li>
<li class="toctree-l1"><a class="reference internal" href="10-packaging-and-documenting.html">Packaging and documenting code</a></li>
Expand Down
2 changes: 2 additions & 0 deletions docs/materials/lectures/07-scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@
<li class="toctree-l1"><a class="reference internal" href="05-containerization-3.html">Customizing and building containers</a></li>
<li class="toctree-l1 current active"><a class="current reference internal" href="#">Non-interactive scripts</a></li>
<li class="toctree-l1"><a class="reference internal" href="08-reproducible-reports.html">Reproducible reports</a></li>


<li class="toctree-l1"><a class="reference internal" href="09-pipelines.html">Data analysis pipelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="06-intro-to-testing-code.html">Introduction to testing code for data science</a></li>
<li class="toctree-l1"><a class="reference internal" href="10-packaging-and-documenting.html">Packaging and documenting code</a></li>
Expand Down

0 comments on commit 64b87d7

Please sign in to comment.