Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaiacs committed Jul 28, 2023
1 parent 8daa86b commit a91055c
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 10 deletions.
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Minimal Example of Tutorial in Quarto with R

[index.qmd](index.qmd) show all the **required** metadata used by Methods Hub.
[`index.qmd`](index.qmd) illustrates all the **required** metadata used by [`andrew`](https://github.com/GESIS-Methods-Hub/andrew).

This repository uses [install.R](install.R) as [configuration file](https://mybinder.readthedocs.io/en/latest/using/config_files.html).
This repository uses [install.R](install.R) as [configuration file](https://mybinder.readthedocs.io/en/latest/using/config_files.html).

## Metadata

| Markdown YAML front matter key | Required | Note |
| --- | --- | --- |
| title | ‼️ | |
| subtitle | | |
| author | ‼️ | |
| image | | Preferable as 900×600 pixels. |
| image-alt | | |

## Supported Features

| Feature | [`andrew`](https://github.com/GESIS-Methods-Hub/andrew) | Notes |
| --- | --- | --- |
| [Pandoc’s Markdown](https://pandoc.org/MANUAL.html#pandocs-markdown) | 👍 | |
| Images | 👍 | As part of Pandoc’s Markdown |
| Tables | 👍 | As part of Pandoc’s Markdown |
| Citations and Bibliographies | 👍 | As part of Pandoc’s Markdown |
| Footnotes | 👍 | As part of Pandoc’s Markdown |
| Math | 👍 | Powered by [MathJax](https://www.mathjax.org/) as part of Pandoc’s Markdown |
| Callout Blocks | 😥 | See https://github.com/GESIS-Methods-Hub/andrew/issues/149 |
| Cross References | 👍 | |
| Computation of [Inline Code](https://rmarkdown.rstudio.com/lesson-4.html) | 👍 | |
| Computation of [Code Chunks](https://rmarkdown.rstudio.com/lesson-3.html) | 👍 | |
| [Code Annotation](https://quarto.org/docs/authoring/code-annotation.html) | 👍 | Requires Quarto >= 1.3 |
| [Title Blocks](https://quarto.org/docs/authoring/title-blocks.html) | 👍 | Generated by Quarto based on YAML header |
| How to cite in the appendix | 👍 | Generated by Quarto based on YAML header |

## Binder

The link to Binder will launch [RStudio IDE](https://posit.co/products/open-source/rstudio-server/).
Binary file added img/north.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed img/quarto.png
Binary file not shown.
46 changes: 38 additions & 8 deletions index.qmd
Original file line number Diff line number Diff line change
@@ -1,22 +1,51 @@
---
title: "Minimal Example of Tutorial in Markdown with R"
title: "Minimal Example of Tutorial in Quarto with R"
author: Raniere Silva
image: img/cover.jpg
image-alt: Computer screen showing calculator app.
bibliography: references.bib
---

This example demonstrates the **required** metadata by Methods Hub.
This example illustrates the **required** metadata by [`andrew`](https://github.com/GESIS-Methods-Hub/andrew) for a tutorial written as a Quarto Document, an extension to Markdown [@markdown2004].

Although footnotes are supported, the use of footnotes is discouraged[^1].

[^1]: Because of it makes navigation harder.

Math can be written using [LaTeX](https://www.latex-project.org/) and is render by [MathJax](https://www.mathjax.org/). Both inline, for example $x$, and standalone, for example $$x = \sqrt{a^2 + b^2}\text{,}$$ is supported.

::: {.callout-important}

To draw attention, wrap the text inside a callout blocks.

:::

Cross reference of figures, tables, equations, ... is also supported. For example, see @fig-north.

![Photo of weathercock by Mat Brown. Available at <https://www.pexels.com/photo/silhouette-of-wind-vane-552600/>.](img/north.jpg){#fig-north}

## Execution of R code

R code can be executed and the output can be included inline, for example `1 + 1` is equal to `r 1 + 1`, and standalone, for example

```{r}
1 + 1
a <- 1
b <- 1
a + b
```

Annotation of code blocks is also supported. For example,

```r
(3 %/% 2) != (3 %% 2) # <1>
```
1. `%%` calculates the remainder on integer division.

## Creation of figure with R

```{r}
plot(rnorm(10), rnorm(10))
plot(runif(10, min=0, max=10), type='l')
```

## Dependencies
Expand Down Expand Up @@ -46,14 +75,15 @@ json |>

## Binder

The link to Binder will launch the RStudio interface.
The link to Binder will launch [RStudio IDE](https://posit.co/products/open-source/rstudio-server/).

:::{.callout-important}

Binder uses the information in `runtime.txt` to launch RStudio.
Binder uses the information in `runtime.txt` to launch [RStudio IDE](https://posit.co/products/open-source/rstudio-server/).

:::

## Dependencies
## References

![Quarto](img/quarto.png)
::: {#refs}
:::

0 comments on commit a91055c

Please sign in to comment.