-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
204 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,203 @@ | ||
--- | ||
title: "Output Rendering" | ||
subtitle: "Subtitle is skipped from the TOC" | ||
author: "Author is skipped from the TOC" | ||
date: "Date is skipped from the TOC" | ||
--- | ||
|
||
```{r} | ||
# all from https://github.com/r-lib/pkgdown/blob/bbf246ea0e115fa39486bee5be80f91903c0081b/vignettes/test/rendering.Rmd#L1 | ||
#| include: FALSE | ||
knitr::opts_chunk$set(collapse = TRUE, comment = "#>") | ||
``` | ||
|
||
This vignette tests pkgdown output rendering for several use cases. | ||
|
||
## Footnotes | ||
|
||
Yay[^footnote] | ||
|
||
[^footnote]: Including **footnotes**! 😁 | ||
|
||
## Figures | ||
|
||
```{r} | ||
#| fig.alt: Test plot | ||
plot(1:10) | ||
``` | ||
|
||
|
||
## Details tag | ||
|
||
<details> | ||
This should only be shown when required | ||
</details> | ||
|
||
<details> | ||
<summary>Multiple paragraphs</summary> | ||
First paragraph | ||
|
||
Second paragraph | ||
</details> | ||
|
||
<details> | ||
<summary>Some R code</summary> | ||
|
||
```{r} | ||
1 + 2 | ||
``` | ||
</details> | ||
|
||
## Tables | ||
|
||
| col 1 | col 2 | col 3 | col 4 | | ||
|:---------------|:-----------|:-------:|:---------:| | ||
| Brightness | Total brightness, total reflectance, spectral intensity | $$y = x^2$$ | test | | ||
|
||
## Math | ||
|
||
$$f(x) = \dfrac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{(x-\mu^2)}{2\sigma^2}}$$ | ||
|
||
Inline equations: $y=x^2$ | ||
|
||
## Code | ||
|
||
### Line width | ||
|
||
```{r} | ||
pkgdown:::ruler() | ||
cat(rep("x ", 100), sep = "") | ||
cat(rep("xy", 100), sep = "") | ||
``` | ||
|
||
### Should be highlighted | ||
|
||
Valid R code in `\preformatted{}`: | ||
|
||
``` | ||
mean(a + 1) | ||
``` | ||
|
||
R code in `R` block: | ||
|
||
```R | ||
mean(a + 1) | ||
``` | ||
|
||
R code in `r` block: | ||
|
||
```R | ||
mean(a + 1) | ||
``` | ||
|
||
Yaml | ||
|
||
```yaml | ||
yaml: [a, 1] | ||
``` | ||
### Shouldn't be highlighted | ||
Non-R code in `\preformatted{}` | ||
|
||
``` | ||
yaml: [a, b, c] | ||
``` | ||
### Crayon | ||
```{r} | ||
cat(cli::col_red("This is red"), "\n") | ||
cat(cli::col_blue("This is blue\n"), "\n") | ||
message(cli::col_green("This is green")) | ||
warning(cli::style_bold("This is bold")) | ||
``` | ||
Some text | ||
|
||
```{r} | ||
#| error: TRUE | ||
stop(cli::style_italic("This is italic")) | ||
``` | ||
|
||
Some more text | ||
|
||
## Quoted text | ||
|
||
> Single-line quote about something miscellaneous. | ||
| Flush | ||
| 1 space indent | ||
| 2 space indent | ||
| 3 space indent | ||
|
||
## This section is unnumbered {-} | ||
|
||
There should however be no bug here! | ||
|
||
## Tabsets | ||
|
||
### Tabset with pills {.tabset .tabset-pills} | ||
|
||
#### Tab 1 | ||
|
||
blablablabla | ||
|
||
```r | ||
1 + 1 | ||
``` | ||
|
||
Should be "cool" heading below | ||
|
||
##### cool | ||
|
||
Stuff | ||
|
||
#### Tab 2 | ||
|
||
blop | ||
|
||
### Tabset without pills {.tabset} | ||
|
||
#### Tab 1 | ||
|
||
something nice | ||
|
||
```{r} | ||
#| fig.alt: Another test plot | ||
plot(1:42) | ||
``` | ||
|
||
#### Tab 2 {.active} | ||
|
||
This tab should be active | ||
|
||
### Fading tabset {.tabset .tabset-fade} | ||
|
||
#### English | ||
|
||
Hello! | ||
|
||
#### French | ||
|
||
Bonjour! | ||
|
||
#### German | ||
|
||
Guten tag. | ||
|
||
## Deep headings | ||
|
||
### Heading 3 | ||
|
||
#### Heading 4 | ||
|
||
##### Heading 5 | ||
|
||
## Very long words | ||
|
||
This word should be broken across multiple lines on mobile, rather than making the page scroll horizontally: | ||
|
||
Ccccccccccccaaaaaaaaaaaaaaatttttttttttttttttssssssssssssssss |