From d4ae34bd26e36f06171175005b25f078e5473d11 Mon Sep 17 00:00:00 2001 From: Per Unneberg Date: Tue, 16 Apr 2024 12:29:17 +0200 Subject: [PATCH 01/11] Add quarto introduction lecture --- quarto/intro.qmd | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 quarto/intro.qmd diff --git a/quarto/intro.qmd b/quarto/intro.qmd new file mode 100644 index 0000000..b5c9bf6 --- /dev/null +++ b/quarto/intro.qmd @@ -0,0 +1,25 @@ +# Introduction to Quarto + +## What is Quarto + +### The Quarto CLI + +## Authoring + +### Render vs preview + +## Computations + +### Engines + +## Document types + +## Presentations + +## Projects + +### Configuration + +### Website + +### Practical example on UPPMAX From ce31daf9328beef2de3e5ee1312c0ade14c1c57e Mon Sep 17 00:00:00 2001 From: Per Unneberg Date: Tue, 16 Apr 2024 13:47:17 +0200 Subject: [PATCH 02/11] Add learner/review pairs --- quarto/intro.qmd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/quarto/intro.qmd b/quarto/intro.qmd index b5c9bf6..ba42049 100644 --- a/quarto/intro.qmd +++ b/quarto/intro.qmd @@ -1,16 +1,16 @@ # Introduction to Quarto -## What is Quarto +## What is Quarto (Tomas / André) -### The Quarto CLI +### The Quarto CLI (Martin / Tomas) -## Authoring +## Authoring (Estelle / Martin) -### Render vs preview +### Render vs preview (Guilherme / Estelle) -## Computations +## Computations (Mahesh / Guilherme) -### Engines +### Engines (André / Mahesh) ## Document types From 9778d8bfb87a441e92ea6095e7c2f2674af47700 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 16 Apr 2024 13:13:04 +0000 Subject: [PATCH 03/11] Add section on quarto computatations --- quarto/intro.qmd | 72 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/quarto/intro.qmd b/quarto/intro.qmd index ba42049..c2db632 100644 --- a/quarto/intro.qmd +++ b/quarto/intro.qmd @@ -8,7 +8,77 @@ ### Render vs preview (Guilherme / Estelle) -## Computations (Mahesh / Guilherme) +## Computations + +Quarto lets you perform computations within your notebook. This is typically +done using code blocks denoted by three backticks followed by the language +you're using in curly brackets. + +``` +```{{python}} +1 + 1 +``` +``` + +Quarto supports computations in several languages: +- [Python](https://quarto.org/docs/computations/python.html) +- [R](https://quarto.org/docs/computations/r.html) +- [Julia](https://quarto.org/docs/computations/julia.html) +- [Observable](https://quarto.org/docs/computations/ojs.html) + +Additional languages can also be supported through other Jupyter kernels (see Engines below). +See this page for a list of [Jupyter kernels](https://gist.github.com/chronitis/682c4e0d9f663e85e3d87e97cd7d1624). + +The languages and packages used in your computations must be available in your `render` environment, and +are often installed through other means, for example using `conda` or a container platform. + +Packages and variables created within one code block are also accessible from other code blocks, including +inline code blocks. For example, here we create a figure and reference the value in the caption. + +```` + +:::{#fig-plot-alt} + +```{r} +x <- 1:10 +y <- x^2 + +plot(x, y) +``` + +A plot of $x$ against it's square (n = `{r} length(x)`). +::: + +```` + +The output of computations can be controlled using [execution options](https://quarto.org/docs/computations/execution-options.html). +These can be set for the whole document in the yaml front-matter at the top of the document, e.g., + +```` +--- +title: My Experiment +execute: + echo: false +--- +```` + +Alternatively, execution options can be specified within each code block, e.g., + +```` +```{python} +#| echo: false +#| output: asis +print(""" +## Introduction + +This is Markdown text. +""") +``` +```` + +Computations can also be used to dynamically generate Markdown +or HTML content by using the `output` format `asis`. For example, +document sections can by dynamically generated from an input file. ### Engines (André / Mahesh) From ed67724d9e1e3f0659c293b08e205d2379955415 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Thu, 18 Apr 2024 10:46:10 +0000 Subject: [PATCH 04/11] Apply code review fixes for Quarto syntax --- quarto/intro.qmd | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/quarto/intro.qmd b/quarto/intro.qmd index c2db632..e609158 100644 --- a/quarto/intro.qmd +++ b/quarto/intro.qmd @@ -14,13 +14,14 @@ Quarto lets you perform computations within your notebook. This is typically done using code blocks denoted by three backticks followed by the language you're using in curly brackets. -``` +````{.markdown} ```{{python}} 1 + 1 ``` -``` +```` Quarto supports computations in several languages: + - [Python](https://quarto.org/docs/computations/python.html) - [R](https://quarto.org/docs/computations/r.html) - [Julia](https://quarto.org/docs/computations/julia.html) @@ -35,11 +36,10 @@ are often installed through other means, for example using `conda` or a containe Packages and variables created within one code block are also accessible from other code blocks, including inline code blocks. For example, here we create a figure and reference the value in the caption. -```` - +````{.markdown} :::{#fig-plot-alt} -```{r} +```{{r}} x <- 1:10 y <- x^2 @@ -48,13 +48,12 @@ plot(x, y) A plot of $x$ against it's square (n = `{r} length(x)`). ::: - ```` The output of computations can be controlled using [execution options](https://quarto.org/docs/computations/execution-options.html). These can be set for the whole document in the yaml front-matter at the top of the document, e.g., -```` +````{.yml} --- title: My Experiment execute: @@ -64,8 +63,8 @@ execute: Alternatively, execution options can be specified within each code block, e.g., -```` -```{python} +````{.markdown} +```{{python}} #| echo: false #| output: asis print(""" @@ -78,7 +77,7 @@ This is Markdown text. Computations can also be used to dynamically generate Markdown or HTML content by using the `output` format `asis`. For example, -document sections can by dynamically generated from an input file. +document sections can be dynamically generated from an input file. ### Engines (André / Mahesh) From ea167ea269c5ab2c00c384ecab6aa1028a65014c Mon Sep 17 00:00:00 2001 From: Guilherme Borges Dias Date: Fri, 19 Apr 2024 14:15:43 +0200 Subject: [PATCH 05/11] Update Render vs Preview --- quarto/intro.qmd | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/quarto/intro.qmd b/quarto/intro.qmd index ba42049..78395b2 100644 --- a/quarto/intro.qmd +++ b/quarto/intro.qmd @@ -6,7 +6,24 @@ ## Authoring (Estelle / Martin) -### Render vs preview (Guilherme / Estelle) +### Render vs preview + +The `quarto render` and `quarto preview` commands are used to generate output from a Quarto (.qmd) document. + +The `quarto render` command generates output in all formats specified in your YAML header (e.g. pdf,html,word), while the `quarto preview` command only generates output in a format suitable for viewing in a web browser. + +In a typical workflow, you would use the `quarto preview` command to view the output of your document as you are working on it. + +```bash +quarto preview my.qmd +``` +This command will start a local web server and open a web browser to view the output of the document. The web server will automatically update the output as you make changes to the document. + +Once you are ready to produce your final output you can use the `quarto render` command. + +```bash +quarto render my.qmd +``` ## Computations (Mahesh / Guilherme) From 89ac5e6ddba0104a5496b68d8a052a384bfd6334 Mon Sep 17 00:00:00 2001 From: Guilherme Borges Dias Date: Mon, 22 Apr 2024 10:53:06 +0200 Subject: [PATCH 06/11] Update intro.qmd --- quarto/intro.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quarto/intro.qmd b/quarto/intro.qmd index 78395b2..14097e5 100644 --- a/quarto/intro.qmd +++ b/quarto/intro.qmd @@ -10,7 +10,7 @@ The `quarto render` and `quarto preview` commands are used to generate output from a Quarto (.qmd) document. -The `quarto render` command generates output in all formats specified in your YAML header (e.g. pdf,html,word), while the `quarto preview` command only generates output in a format suitable for viewing in a web browser. +The `quarto render` command generates output in all formats specified in your YAML header (e.g. pdf,html,word) or in your command line with the option --to, while the `quarto preview` command only generates output in a format suitable for viewing in a web browser. In a typical workflow, you would use the `quarto preview` command to view the output of your document as you are working on it. From 186748bc3f00a1727de2ef216af979aeecc056d8 Mon Sep 17 00:00:00 2001 From: Martin Pippel Date: Tue, 23 Apr 2024 10:10:26 +0200 Subject: [PATCH 07/11] Update intro.qmd - The Quarto CLI initial commit section: The Quarto CLI --- quarto/intro.qmd | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/quarto/intro.qmd b/quarto/intro.qmd index ba42049..69b43dd 100644 --- a/quarto/intro.qmd +++ b/quarto/intro.qmd @@ -2,7 +2,47 @@ ## What is Quarto (Tomas / André) -### The Quarto CLI (Martin / Tomas) +### The Quarto CLI + +0. In order to use quarto you need to install quarto first. The easiest way is to get the package for your desired platform directly from [https://quarto.org/docs/get-started/](https://quarto.org/docs/get-started/). If you need the most recent version you can also get the source code from the [quarto-cli](https://github.com/quarto-dev/quarto-cli) git repository. +1. After quarto is installed on your system you can get an overview of all subcommonds when you type `quarto help` (followed by pressing ENTER) in a terminal: +``` + Usage: quarto + Version: 1.4.553 + + Description: + + Quarto CLI + + Options: + + -h, --help - Show this help. + -V, --version - Show the version number for this program. + + Commands: + + render [input] [args...] - Render files or projects to various document types. + preview [file] [args...] - Render and preview a document or website project. + serve [input] - Serve a Shiny interactive document. + create [type] [commands...] - Create a Quarto project or extension + use [target] - Automate document or project setup tasks. + add - Add an extension to this folder or project + update [target...] - Updates an extension or global dependency. + remove [target...] - Removes an extension. + convert - Convert documents to alternate representations. + pandoc [args...] - Run the version of Pandoc embedded within Quarto. + typst [args...] - Run the version of Typst embedded within Quarto. + run [script] [args...] - Run a TypeScript, R, Python, or Lua script. + install [target...] - Installs a global dependency (TinyTex or Chromium). + uninstall [tool] - Removes an extension. + tools - Display the status of Quarto installed dependencies + publish [provider] [path] - Publish a document or project to a provider. + check [target] - Verify correct functioning of Quarto installation. + help [command] - Show this help or the help of a sub-command. +``` +There are many quarto subcommands available. You can get more details about each subcommand when you type `quarto help` in the terminal: e.g. `quarto render help` provides detailed information about rendering files or projects to various document types - including some usage examples at the end. + + ## Authoring (Estelle / Martin) From 3fa7d2c37d4a7308b70cc3831152d9129155add0 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Wed, 24 Apr 2024 09:40:43 +0000 Subject: [PATCH 08/11] Add reference in figure example --- quarto/intro.qmd | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/quarto/intro.qmd b/quarto/intro.qmd index e609158..518afb6 100644 --- a/quarto/intro.qmd +++ b/quarto/intro.qmd @@ -33,8 +33,9 @@ See this page for a list of [Jupyter kernels](https://gist.github.com/chronitis/ The languages and packages used in your computations must be available in your `render` environment, and are often installed through other means, for example using `conda` or a container platform. -Packages and variables created within one code block are also accessible from other code blocks, including -inline code blocks. For example, here we create a figure and reference the value in the caption. +Loaded packages and variables defined within a code block are also accessible from other code blocks, including +inline code blocks. For example, here we create a figure within a div (`:::`) and reference the `x` variable +in both the figure caption and text body. ````{.markdown} :::{#fig-plot-alt} @@ -48,6 +49,9 @@ plot(x, y) A plot of $x$ against it's square (n = `{r} length(x)`). ::: + +This paragraph refers to @fig-plot-alt for a plot of $y=x^2$ +based on `{r} length(x)` points. ```` The output of computations can be controlled using [execution options](https://quarto.org/docs/computations/execution-options.html). From dfec361abef966b6ce7309371c7370dcb2dc2498 Mon Sep 17 00:00:00 2001 From: Per Unneberg Date: Tue, 11 Jun 2024 13:26:37 +0200 Subject: [PATCH 09/11] Add section on document formats --- quarto/intro.qmd | 105 +++++++++++++++++++++++++++++++---------------- 1 file changed, 70 insertions(+), 35 deletions(-) diff --git a/quarto/intro.qmd b/quarto/intro.qmd index 5aec94c..694ae1f 100644 --- a/quarto/intro.qmd +++ b/quarto/intro.qmd @@ -1,11 +1,22 @@ # Introduction to Quarto -## What is Quarto (Tomas / André) +## What is Quarto ### The Quarto CLI -0. In order to use quarto you need to install quarto first. The easiest way is to get the package for your desired platform directly from [https://quarto.org/docs/get-started/](https://quarto.org/docs/get-started/). If you need the most recent version you can also get the source code from the [quarto-cli](https://github.com/quarto-dev/quarto-cli) git repository. -1. After quarto is installed on your system you can get an overview of all subcommonds when you type `quarto help` (followed by pressing ENTER) in a terminal: +0. In order to use Quarto you need to install Quarto first. The + easiest way is to get the package for your desired platform + directly from + [https://quarto.org/docs/get-started/](https://quarto.org/docs/get-started/). + If you need the most recent version you can also get the source + code from the + [quarto-cli](https://github.com/quarto-dev/quarto-cli) git + repository. + +1. After Quarto is installed on your system you can get an overview of + all subcommonds when you type `quarto help` (followed by pressing + ENTER) in a terminal: + ``` Usage: quarto Version: 1.4.553 @@ -40,26 +51,38 @@ check [target] - Verify correct functioning of Quarto installation. help [command] - Show this help or the help of a sub-command. ``` -There are many quarto subcommands available. You can get more details about each subcommand when you type `quarto help` in the terminal: e.g. `quarto render help` provides detailed information about rendering files or projects to various document types - including some usage examples at the end. - +There are many Quarto subcommands available. You can get more details +about each subcommand when you type `quarto help` in the +terminal: e.g. `quarto render help` provides detailed information +about rendering files or projects to various document types - +including some usage examples at the end. -## Authoring (Estelle / Martin) +## Authoring ### Render vs preview -The `quarto render` and `quarto preview` commands are used to generate output from a Quarto (.qmd) document. +The `quarto render` and `quarto preview` commands are used to generate +output from a Quarto (.qmd) document. -The `quarto render` command generates output in all formats specified in your YAML header (e.g. pdf,html,word) or in your command line with the option --to, while the `quarto preview` command only generates output in a format suitable for viewing in a web browser. +The `quarto render` command generates output in all formats specified +in your YAML header (e.g. pdf,html,word) or in your command line with +the option --to, while the `quarto preview` command only generates +output in a format suitable for viewing in a web browser. -In a typical workflow, you would use the `quarto preview` command to view the output of your document as you are working on it. +In a typical workflow, you would use the `quarto preview` command to +view the output of your document as you are working on it. ```bash quarto preview my.qmd ``` -This command will start a local web server and open a web browser to view the output of the document. The web server will automatically update the output as you make changes to the document. -Once you are ready to produce your final output you can use the `quarto render` command. +This command will start a local web server and open a web browser to +view the output of the document. The web server will automatically +update the output as you make changes to the document. + +Once you are ready to produce your final output you can use the +`quarto render` command. ```bash quarto render my.qmd @@ -67,9 +90,9 @@ quarto render my.qmd ## Computations -Quarto lets you perform computations within your notebook. This is typically -done using code blocks denoted by three backticks followed by the language -you're using in curly brackets. +Quarto lets you perform computations within your notebook. This is +typically done using code blocks denoted by three backticks followed +by the language you're using in curly brackets. ````{.markdown} ```{{python}} @@ -84,15 +107,18 @@ Quarto supports computations in several languages: - [Julia](https://quarto.org/docs/computations/julia.html) - [Observable](https://quarto.org/docs/computations/ojs.html) -Additional languages can also be supported through other Jupyter kernels (see Engines below). -See this page for a list of [Jupyter kernels](https://gist.github.com/chronitis/682c4e0d9f663e85e3d87e97cd7d1624). +Additional languages can also be supported through other Jupyter +kernels (see Engines below). See this page for a list of [Jupyter +kernels](https://gist.github.com/chronitis/682c4e0d9f663e85e3d87e97cd7d1624). -The languages and packages used in your computations must be available in your `render` environment, and -are often installed through other means, for example using `conda` or a container platform. +The languages and packages used in your computations must be available +in your `render` environment, and are often installed through other +means, for example using `conda` or a container platform. -Loaded packages and variables defined within a code block are also accessible from other code blocks, including -inline code blocks. For example, here we create a figure within a div (`:::`) and reference the `x` variable -in both the figure caption and text body. +Loaded packages and variables defined within a code block are also +accessible from other code blocks, including inline code blocks. For +example, here we create a figure within a div (`:::`) and reference +the `x` variable in both the figure caption and text body. ````{.markdown} :::{#fig-plot-alt} @@ -111,8 +137,10 @@ This paragraph refers to @fig-plot-alt for a plot of $y=x^2$ based on `{r} length(x)` points. ```` -The output of computations can be controlled using [execution options](https://quarto.org/docs/computations/execution-options.html). -These can be set for the whole document in the yaml front-matter at the top of the document, e.g., +The output of computations can be controlled using [execution +options](https://quarto.org/docs/computations/execution-options.html). +These can be set for the whole document in the yaml front-matter at +the top of the document, e.g., ````{.yml} --- @@ -122,7 +150,8 @@ execute: --- ```` -Alternatively, execution options can be specified within each code block, e.g., +Alternatively, execution options can be specified within each code +block, e.g., ````{.markdown} ```{{python}} @@ -136,20 +165,26 @@ This is Markdown text. ``` ```` -Computations can also be used to dynamically generate Markdown -or HTML content by using the `output` format `asis`. For example, -document sections can be dynamically generated from an input file. - -### Engines (André / Mahesh) +Computations can also be used to dynamically generate Markdown or HTML +content by using the `output` format `asis`. For example, document +sections can be dynamically generated from an input file. ## Document types -## Presentations +Quarto can generate a number of document output types, including PDF, +HTML, and MS Word. The output format can be set on the command line +via the `--to` option, or by setting the `format` option in the yaml +configuration. For instance, the following header configuration will +generate PDF output: -## Projects - -### Configuration +````{.yml} +--- +format: pdf +--- +```` -### Website +### Presentation -### Practical example on UPPMAX +In addition to regular document formats, there is support for formats +that will generate presentations, including `revealjs` (HTML), `pptx` +(PowerPoint) and `beamer` (LaTeX/PDF). From 60eda0aa56a29f084d89cacdb561570c4f64d874 Mon Sep 17 00:00:00 2001 From: Per Unneberg Date: Tue, 11 Jun 2024 14:26:40 +0200 Subject: [PATCH 10/11] Update quarto/intro.qmd Co-authored-by: Mahesh Binzer-Panchal --- quarto/intro.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quarto/intro.qmd b/quarto/intro.qmd index 694ae1f..6d1cf52 100644 --- a/quarto/intro.qmd +++ b/quarto/intro.qmd @@ -66,7 +66,7 @@ The `quarto render` and `quarto preview` commands are used to generate output from a Quarto (.qmd) document. The `quarto render` command generates output in all formats specified -in your YAML header (e.g. pdf,html,word) or in your command line with +in your YAML header (e.g., pdf, html, word) or in your command line with the option --to, while the `quarto preview` command only generates output in a format suitable for viewing in a web browser. From 6e8e97a3643c21cb5df1b4186b000af3d44c0b63 Mon Sep 17 00:00:00 2001 From: Per Unneberg Date: Tue, 11 Jun 2024 14:26:51 +0200 Subject: [PATCH 11/11] Update quarto/intro.qmd Co-authored-by: Mahesh Binzer-Panchal --- quarto/intro.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quarto/intro.qmd b/quarto/intro.qmd index 6d1cf52..1ece5d1 100644 --- a/quarto/intro.qmd +++ b/quarto/intro.qmd @@ -67,7 +67,7 @@ output from a Quarto (.qmd) document. The `quarto render` command generates output in all formats specified in your YAML header (e.g., pdf, html, word) or in your command line with -the option --to, while the `quarto preview` command only generates +the option `--to`, while the `quarto preview` command only generates output in a format suitable for viewing in a web browser. In a typical workflow, you would use the `quarto preview` command to