Skip to content

Commit c0d3462

Browse files
committed
Add slides
1 parent 59e625f commit c0d3462

File tree

126 files changed

+24330
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+24330
-2
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.Rproj.user
2+
.Rhistory
3+
.RData
4+
.Ruserdata

README.md

+41-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,41 @@
1-
# getting-started-with-report-writing-using-quarto
2-
2024-01-23 R-Ladies Nairobi
1+
# Getting started with report writing using Quarto
2+
3+
## 2024-01-23 R-Ladies Nairobi Presentation
4+
5+
![](images/title.png)
6+
7+
## Data
8+
9+
- [TidyTuesday](https://github.com/rfordatascience/tidytuesday)
10+
- [@thedivtagguy's geocoding analysis](https://github.com/thedivtagguy/tidytuesday/tree/master/2024/week-03-polling-places/analysis)
11+
12+
## Resources
13+
14+
### Native pipe
15+
16+
- [Understanding the native R pipe |>](https://ivelasq.rbind.io/blog/understanding-the-r-pipe/)
17+
18+
### For R Markdown Users
19+
20+
* [FAQ for R Markdown Users](https://quarto.org/docs/faq/rmarkdown.html)
21+
* [From R Markdown to Quarto workshop](https://rstudio-conf-2022.github.io/rmd-to-quarto/) taught by Dr. Mine Çetinkaya-Rundel and Dr. Andrew Bray.
22+
23+
### Quartos and reports
24+
25+
- [Making Pretty PDFs with Quarto by Nicola Rennie by](https://nrennie.rbind.io/blog/making-pretty-pdf-quarto/)
26+
- [Tips for Custom Parameterized PDFs in Quarto by Meghan Hall](https://meghan.rbind.io/blog/quarto-pdfs/)
27+
- [Introduction to Reproducible Publications with Quarto by Torin White at R-Ladies Rome](https://www.youtube.com/watch?v=hgpL-sppw7E&t=4392s)
28+
29+
### Image
30+
31+
- [RawPixel](https://www.rawpixel.com/)
32+
33+
### Parameterization
34+
35+
- [Parameterized Reporting with Quarto by Jadey Ryan at R-Ladies Abuja](https://jadeyryan.quarto.pub/rladies-abuja-quarto-params/)
36+
37+
### knit_child()
38+
39+
- [Generating dynamic contents in R Markdown and Quarto by Qiushi Yan](https://www.qiushiyan.dev/posts/dynamic-rmd-quarto/)
40+
- [knit_child in a loop - variable as title (StackOverflow)](https://stackoverflow.com/questions/43873345/knit-child-in-a-loop-variable-as-title)
41+
- [How do I knit child doc uments with parameters into a main RMarkdown document? (StackOverflow)](https://stackoverflow.com/questions/70655915/how-do-i-knit-child-documents-with-parameters-into-a-main-rmarkdown-document)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
title: Reveal agenda
2+
author: Andrie de Vries
3+
version: 0.0.3
4+
contributes:
5+
filters:
6+
- reveal-auto-agenda.lua
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* Done display slide header on auto-agenda slides */
2+
.agenda-slide h1 {
3+
size: 0em;
4+
display: none;
5+
}
6+
7+
/* The agenda heading, if specified */
8+
.agenda-heading {
9+
font-size: 1.25em;
10+
font-weight: bold;
11+
margin-bottom: 0.5em;
12+
}
13+
14+
/* The container class for auto-agenda */
15+
.agenda {
16+
}
17+
18+
.agenda-active {
19+
font-weight: bold;
20+
}
21+
22+
.agenda-inactive {
23+
opacity: 0.7;
24+
}
25+
26+
.agenda-pre-active {
27+
/* color: #b22222; */
28+
}
29+
30+
.agenda-post-active {
31+
/* color: #2222b2; */
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
2+
local stringify = pandoc.utils.stringify
3+
local headers = pandoc.List()
4+
5+
local options_bullets = "bullet"
6+
local options_heading = nil
7+
8+
-- permitted options include:
9+
-- auto-agenda:
10+
-- bullets: none | bullet | numbered
11+
-- heading: none | heading
12+
local function read_meta(meta)
13+
local options = meta["auto-agenda"]
14+
if options ~= nil then
15+
if options.bullets ~= nil then
16+
options_bullets = stringify(options.bullets)
17+
else
18+
options_bullets = "bullet"
19+
end
20+
if options.heading ~= nil then
21+
options_heading = options.heading
22+
end
23+
end
24+
end
25+
26+
local function get_header_text(el)
27+
return el.content
28+
end
29+
30+
local function scan_headers(el)
31+
if el.level == 1 then
32+
headers:insert(get_header_text(el))
33+
end
34+
end
35+
36+
--@param el pandoc.Header
37+
--@return pandoc.Header
38+
local function change_header_class(el)
39+
el.attr.classes = {"agenda-slide"}
40+
return el
41+
end
42+
43+
local function identity(el)
44+
return el
45+
end
46+
47+
local function scan_blocks(blocks)
48+
local newBlocks = pandoc.List()
49+
local header_n = 0
50+
51+
-- define agende bullet options
52+
local bullet_class = pandoc.BulletList
53+
if options_bullets ~= nil then
54+
if options_bullets == "none" then
55+
bullet_class = identity
56+
elseif options_bullets == "numbered" then
57+
bullet_class = pandoc.OrderedList
58+
end
59+
end
60+
61+
for _, block in pairs(blocks) do
62+
if (block ~= nil and
63+
block.t == "Header" and
64+
block.level == 1 and
65+
not block.attr.classes:includes("no-auto-agenda")
66+
) then
67+
header_n = header_n + 1
68+
change_header_class(block)
69+
newBlocks:insert(block)
70+
71+
-- if defined in options, insert a heading
72+
if (options_heading ~= nil) then
73+
newBlocks:insert(
74+
pandoc.Div(
75+
pandoc.Para(options_heading),
76+
pandoc.Attr("", {"agenda-heading"})
77+
)
78+
)
79+
end
80+
81+
-- modify the agenda items for active agenda item
82+
local mod_headers = pandoc.List()
83+
local agenda_class = {}
84+
for i=1, #headers do
85+
if (i == header_n) then
86+
agenda_class = {"agenda-active"}
87+
elseif (i < header_n) then
88+
agenda_class = {"agenda-inactive", "agenda-pre-active"}
89+
elseif (i > header_n) then
90+
agenda_class = {"agenda-inactive", "agenda-post-active"}
91+
end
92+
mod_headers:insert(
93+
pandoc.Div(pandoc.Para(headers[i]), pandoc.Attr("", agenda_class))
94+
)
95+
end
96+
97+
-- insert the agenda items
98+
newBlocks:insert(
99+
pandoc.Div(
100+
bullet_class(mod_headers),
101+
pandoc.Attr("", {"agenda"})
102+
)
103+
)
104+
else
105+
newBlocks:insert(block)
106+
end
107+
end
108+
109+
-- inject the CSS dependency
110+
quarto.doc.addHtmlDependency({
111+
name = "reveal-auto-agenda",
112+
version = "0.0.3",
113+
stylesheets = {"reveal-auto-agenda.css"}
114+
})
115+
116+
return newBlocks
117+
end
118+
119+
if (quarto.doc.isFormat("revealjs")) then
120+
return {
121+
{Meta = read_meta},
122+
{Header = scan_headers},
123+
{Blocks = scan_blocks}
124+
}
125+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
title: Font Awesome support
2+
author: Carlos Scheidegger
3+
version: 1.1.0
4+
quarto-required: ">=1.2.269"
5+
contributes:
6+
shortcodes:
7+
- fontawesome.lua

0 commit comments

Comments
 (0)