forked from edenian-prince/make-quarto-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.qmd
426 lines (354 loc) Β· 7.53 KB
/
demo.qmd
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
---
title: "Github Pages π¦"
title-slide-attributes:
data-background-color: "#bdcad4"
data-background-size: contain
format:
revealjs:
theme: [default,assets/another.scss]
chalkboard: true
page-layout: custom
margin: 0
echo: true
revealjs-plugins:
- codewindow
editor: visual
knitr: true
---
# {background-color="#bdcad4"}
![](images/Screen%20Shot%202023-09-07%20at%2010.41.36%20AM.png){style="myframe"}
# examples {background-color="#bdcad4"}
::: {layout-ncol="2"}
## R
```{=html}
<iframe width="500" height="500" src="https://dplyr.tidyverse.org/" title="Quarto Documentation" class="myframe"></iframe>
```
## Python
```{=html}
<iframe width="500" height="500" src="https://pandas.pydata.org/" title="Quarto Documentation" class="myframe"></iframe>
```
:::
# open a quarto project {background-color="#bdcad4"}
![](images/ezgif-5-4bfe38e796.gif){.myframe}
# files {background-color="#bdcad4"}
::: columns
::: {.column width="50%"}
::: {.codewindow width="500px"}
```{sass eval=FALSE}
#| code-line-numbers: false
.
βββ _quarto.yml
βββ about.qmd
βββ index.qmd
βββ make-ghpage-doc.Rproj
βββ styles.css
1 directory, 5 files
```
:::
:::
::: {.column width="50%"}
- `_quarto.yml` yaml for all documents
- `about.qmd` example `qmd` file
- `index.qmd` main document, [keep this]{.dark-blue}
- `.Rproj` R project file
- `styles.css` add spice to the site
:::
:::
------------------------------------------------------------------------
::: columns
::: {.column width="50%"}
::: {.codewindow .sass}
styles.css
```{sass eval=FALSE}
#| code-line-numbers: false
.pink {
color: pink;
}
```
:::
::: {.codewindow .r}
index.qmd
```{sass eval=FALSE}
#| code-line-numbers: false
---
title: "make-ghpage-doc"
---
This is a Quarto website.
To learn more about Quarto websites visit <https://quarto.org/docs/websites>.
```
:::
:::
::: {.column width="50%"}
::: codewindow
\_quarto.yml
```{yaml eval=FALSE}
#| code-line-numbers: "6-10|"
project:
type: website
website:
title: "make-ghpage-doc"
navbar:
left:
- href: index.qmd
text: Home
- about.qmd
format:
html:
theme: cosmo
css: styles.css
toc: true
editor: visual
```
:::
:::
:::
# nav bar {background-color="#bdcad4"}
```{=html}
<iframe width="1000" height="500" src="https://edenian-prince.github.io/testing/" title="Quarto Documentation" class="myframe"></iframe>
```
# add more files {background-color="#bdcad4"}
::: {layout-ncol="2"}
::: {.column .express width="20%"}
```{sass}
#| code-line-numbers: "|6-9|"
#| eval: false
#| classes: myframe
folder tree
.
βββ _quarto.yml
βββ about.qmd
βββ fancy-site-doc.Rproj
βββ home
βΒ Β βββ how_to.qmd
βΒ Β βββ link_code.qmd
βΒ Β βββ renv.qmd
βββ index.qmd
βββ plots
βΒ Β βββ plot1.qmd
βββ scripts
βΒ Β βββ script.qmd
βββ styles.css
βββ styles.scss
4 directories, 11 files
```
:::
::: {.column width="80%"}
```{sass eval=FALSE}
#| code-line-numbers: "5-23|"
#| classes: myframe
_quarto.yml
project:
type: website
website:
title: "fancy-site-doc"
navbar:
left:
- text: Home
menu:
- href: index.qmd
text: "0: Intro"
- href: home/how_to.qmd
text: "1: How to create this doc"
- href: home/link_code.qmd
text: "2: How to link code to doc"
- href: home/renv.qmd
text: "3: Virtual Environments"
- text: Scripts
menu:
- href: scripts/script.qmd
text: "0: my script"
- text: Plots
menu:
- href: plots/plot1.qmd
text: "0: my plot"
format:
html:
theme: cosmo
css: styles.css
scss: styles.scss
toc: true
editor: visual
```
:::
:::
# idk {background-color="aquamarine"}
:::{.express}
```{r}
#| eval: false
#| classes: myframe
#| code-line-numbers: "1-2"
mtcars |>
filter(color==5) %>%
mutate(hello=15)
# a comment
```
:::
# nav bar results {background-color="#bdcad4"}
```{=html}
edenian-prince.github.io/quarto-site/
<iframe width="1000" height="500" src="https://edenian-prince.github.io/quarto-site/" title="Quarto Documentation" class="myframe"></iframe>
```
# link external code to documentation
::: {layout-ncol="2"}
::: {.codewindow width="500px"}
external_script.R
```{r eval=FALSE}
#| code-line-numbers: "8,12"
# ----- Read in Libraries ----- #
## ---- libraries
library(dplyr)
library(magrittr)
## ---- stop
# ----- Read in the File ----- #
## ---- read-chunk
(df <- airquality %>%
arrange(desc(Month)) %>%
as_tibble())
## ---- stop
```
:::
::: {.codewindow width="500px"}
scripts/script.qmd
```{r read-chunk}
#| echo: fenced
#
```
:::
:::
# github actions - let's automate π
# github actions
::: {.codewindow .sass width="500px"}
.github/workflows/quarto-publish.yml
```{sass}
#| eval: false
on:
workflow_dispatch:
push:
branches: main
name: Quarto Publish
jobs:
build-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Setup Renv
uses: r-lib/actions/setup-renv@v2
- name: Render and Publish
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
:::
# github actions
![](images/Screen%20Shot%202023-09-07%20at%206.08.31%20PM.png){.myframe}
# scss/css/sass
::: {.codewindow .sass width="500px"}
styles.scss
```{sass eval=FALSE}
/*-- scss:defaults --*/
/* potential themes */
$light-blue: #ABBECB;
$back-blue: #160e1d;
$med-back-blue: #274E5A;
$crash-blue: #88AEB3;
$fade-blue: #BDCFD4;
$text-blue: #DEE2E2;
$light-back : #bdcad4;
/*-- scss:rules --*/
.myframe {
box-shadow: $back-blue 10px 5px 5px 0px;
}
.slide1{
h1 {
font-size: 1.5em;
color: $text-blue;
z-index: 1;
}
h2, p, pre {
color: $text-blue;
font-size: 2em;
z-index: 1;
}
ul {
text-align: center;
}
}
```
:::
# html
```{r}
#| eval: false
<iframe width="500" height="500" src="https://dplyr.tidyverse.org/" title="Quarto Documentation" class="myframe"></iframe>
```
# js
# add more files
::: columns
::: {.column width="30%"}
```{sass}
#| code-line-numbers: "|6-9|"
#| eval: false
#| classes: express
folder tree
.
βββ _quarto.yml
βββ about.qmd
βββ fancy-site-doc.Rproj
βββ home
βΒ Β βββ how_to.qmd
βΒ Β βββ link_code.qmd
βΒ Β βββ renv.qmd
βββ index.qmd
βββ plots
βΒ Β βββ plot1.qmd
βββ scripts
βΒ Β βββ script.qmd
βββ styles.css
βββ styles.scss
4 directories, 11 files
```
:::
::: {.column width="70%"}
```{sass eval=FALSE}
#| code-line-numbers: "5-23|"
_quarto.yml
project:
type: website
website:
title: "fancy-site-doc"
navbar:
left:
- text: Home
menu:
- href: index.qmd
text: "0: Intro"
- href: home/how_to.qmd
text: "1: How to create this doc"
- href: home/link_code.qmd
text: "2: How to link code to doc"
- href: home/renv.qmd
text: "3: Virtual Environments"
- text: Scripts
menu:
- href: scripts/script.qmd
text: "0: my script"
- text: Plots
menu:
- href: plots/plot1.qmd
text: "0: my plot"
format:
html:
theme: cosmo
css: styles.css
scss: styles.scss
toc: true
editor: visual
```
:::
:::