File: rendering.Rmd

package info (click to toggle)
r-cran-pkgdown 2.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,740 kB
  • sloc: javascript: 460; makefile: 14; sh: 13
file content (210 lines) | stat: -rw-r--r-- 2,686 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
---
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}
#| 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)
```

## External files

```{r}
x <- readLines("test.txt")
x
```

![bacon](bacon.jpg)

## 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