Skip to content

Commit

Permalink
Merge pull request #14 from rstats-wtf/eda-2024-updates
Browse files Browse the repository at this point in the history
eda 2024 updates
  • Loading branch information
edavidaja authored Jun 7, 2024
2 parents b2eddcf + 4feb011 commit 7016fc2
Show file tree
Hide file tree
Showing 19 changed files with 2,147 additions and 699 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
_site/
_freeze/
index_files/

/.luarc.json
6 changes: 6 additions & 0 deletions _extensions/andrie/reveal-auto-agenda/_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
title: Reveal agenda
author: Andrie de Vries
version: 0.0.3
contributes:
filters:
- reveal-auto-agenda.lua
32 changes: 32 additions & 0 deletions _extensions/andrie/reveal-auto-agenda/reveal-auto-agenda.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* Done display slide header on auto-agenda slides */
.agenda-slide h1 {
size: 0em;
display: none;
}

/* The agenda heading, if specified */
.agenda-heading {
font-size: 1.25em;
font-weight: bold;
margin-bottom: 0.5em;
}

/* The container class for auto-agenda */
.agenda {
}

.agenda-active {
font-weight: bold;
}

.agenda-inactive {
opacity: 0.7;
}

.agenda-pre-active {
/* color: #b22222; */
}

.agenda-post-active {
/* color: #2222b2; */
}
125 changes: 125 additions & 0 deletions _extensions/andrie/reveal-auto-agenda/reveal-auto-agenda.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@

local stringify = pandoc.utils.stringify
local headers = pandoc.List()

local options_bullets = "bullet"
local options_heading = nil

-- permitted options include:
-- auto-agenda:
-- bullets: none | bullet | numbered
-- heading: none | heading
local function read_meta(meta)
local options = meta["auto-agenda"]
if options ~= nil then
if options.bullets ~= nil then
options_bullets = stringify(options.bullets)
else
options_bullets = "bullet"
end
if options.heading ~= nil then
options_heading = options.heading
end
end
end

local function get_header_text(el)
return el.content
end

local function scan_headers(el)
if el.level == 1 then
headers:insert(get_header_text(el))
end
end

--@param el pandoc.Header
--@return pandoc.Header
local function change_header_class(el)
el.attr.classes = {"agenda-slide"}
return el
end

local function identity(el)
return el
end

local function scan_blocks(blocks)
local newBlocks = pandoc.List()
local header_n = 0

-- define agende bullet options
local bullet_class = pandoc.BulletList
if options_bullets ~= nil then
if options_bullets == "none" then
bullet_class = identity
elseif options_bullets == "numbered" then
bullet_class = pandoc.OrderedList
end
end

for _, block in pairs(blocks) do
if (block ~= nil and
block.t == "Header" and
block.level == 1 and
not block.attr.classes:includes("no-auto-agenda")
) then
header_n = header_n + 1
change_header_class(block)
newBlocks:insert(block)

-- if defined in options, insert a heading
if (options_heading ~= nil) then
newBlocks:insert(
pandoc.Div(
pandoc.Para(options_heading),
pandoc.Attr("", {"agenda-heading"})
)
)
end

-- modify the agenda items for active agenda item
local mod_headers = pandoc.List()
local agenda_class = {}
for i=1, #headers do
if (i == header_n) then
agenda_class = {"agenda-active"}
elseif (i < header_n) then
agenda_class = {"agenda-inactive", "agenda-pre-active"}
elseif (i > header_n) then
agenda_class = {"agenda-inactive", "agenda-post-active"}
end
mod_headers:insert(
pandoc.Div(pandoc.Para(headers[i]), pandoc.Attr("", agenda_class))
)
end

-- insert the agenda items
newBlocks:insert(
pandoc.Div(
bullet_class(mod_headers),
pandoc.Attr("", {"agenda"})
)
)
else
newBlocks:insert(block)
end
end

-- inject the CSS dependency
quarto.doc.addHtmlDependency({
name = "reveal-auto-agenda",
version = "0.0.3",
stylesheets = {"reveal-auto-agenda.css"}
})

return newBlocks
end

if (quarto.doc.isFormat("revealjs")) then
return {
{Meta = read_meta},
{Header = scan_headers},
{Blocks = scan_blocks}
}
end
8 changes: 8 additions & 0 deletions _extensions/gadenbuie/countdown/_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: countdown
author: Garrick Aden-Buie and James Joseph Balamuta
version: 0.0.0-dev.1
quarto-required: ">=1.4.0"
contributes:
shortcodes:
- countdown.lua

175 changes: 175 additions & 0 deletions _extensions/gadenbuie/countdown/assets/countdown.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
.countdown {
--_margin: 0.6em;
--_running-color: var(--countdown-color-running-text, rgba(0, 0, 0, 0.8));
--_running-background: var(--countdown-color-running-background, #43AC6A);
--_running-border-color: var(--countdown-color-running-border, rgba(0, 0, 0, 0.1));
--_finished-color: var(--countdown-color-finished-text, rgba(0, 0, 0, 0.7));
--_finished-background: var(--countdown-color-finished-background, #F04124);
--_finished-border-color: var(--countdown-color-finished-border, rgba(0, 0, 0, 0.1));

position: absolute;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
background: var(--countdown-color-background, inherit);
font-size: var(--countdown-font-size, 3rem);
line-height: var(--countdown-line-height, 1);
border-color: var(--countdown-color-border, #ddd);
border-width: var(--countdown-border-width, 0.1875rem);
border-style: solid;
border-radius: var(--countdown-border-radius, 0.9rem);
box-shadow: var(--countdown-box-shadow, 0px 4px 10px 0px rgba(50, 50, 50, 0.4));
margin: var(--countdown-margin, var(--_margin, 0.6em));
padding: var(--countdown-padding, 0.625rem 0.9rem);
text-align: center;
z-index: 10;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

.countdown.inline {
position: relative;
width: max-content;
max-width: 100%;
}

.countdown .countdown-time {
background: none;
font-size: 100%;
padding: 0;
color: currentColor;
}

.countdown-digits {
color: var(--countdown-color-text);
}

.countdown.running {
border-color: var(--_running-border-color);
background-color: var(--_running-background);
}

.countdown.running .countdown-digits {
color: var(--_running-color);
}

.countdown.finished {
border-color: var(--_finished-border-color);
background-color: var(--_finished-background);
}

.countdown.finished .countdown-digits {
color: var(--_finished-color);
}

.countdown.running.warning {
border-color: var(--countdown-color-warning-border, rgba(0, 0, 0, 0.1));
background-color: var(--countdown-color-warning-background, #E6C229);
}

.countdown.running.warning .countdown-digits {
color: var(--countdown-color-warning-text, rgba(0, 0, 0, 0.7));
}

.countdown.running.blink-colon .countdown-digits.colon {
opacity: 0.1;
}

/* ------ Controls ------ */
.countdown:not(.running) .countdown-controls,
.countdown.no-controls .countdown-controls {
display: none;
}

.countdown-controls {
position: absolute;
top: -0.5rem;
right: -0.5rem;
left: -0.5rem;
display: flex;
justify-content: space-between;
margin: 0;
padding: 0;
}

.countdown-controls>button {
position: relative;
font-size: 1.5rem;
width: 1rem;
height: 1rem;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-family: monospace;
padding: 10px;
margin: 0;
background: inherit;
border: 2px solid;
border-radius: 100%;
transition: 50ms transform ease-in-out, 150ms opacity ease-in;
box-shadow: 0px 2px 5px 0px rgba(50, 50, 50, 0.4);
-webkit-box-shadow: 0px 2px 5px 0px rgba(50, 50, 50, 0.4);
--_button-bump: 0;
opacity: var(--_opacity, 0);
transform: translate(0, var(--_button-bump));
}

/* increase hit area of the +/- buttons */
.countdown .countdown-controls > button::after {
content: "";
height: 200%;
width: 200%;
position: absolute;
border-radius: 50%;
}

.countdown .countdown-controls>button:last-child {
color: var(--_running-color);
background-color: var(--_running-background);
border-color: var(--_running-border-color);
}

.countdown .countdown-controls>button:first-child {
color: var(--_finished-color);
background-color: var(--_finished-background);
border-color: var(--_finished-border-color);
}

.countdown.running:hover, .countdown.running:focus-within {
--_opacity: 1;
}

.countdown.running:hover .countdown-controls>button,
.countdown.running:focus-within .countdown-controls>button {
--_button-bump: -3px;
}

.countdown.running:hover .countdown-controls>button:active,
.countdown.running:focus-within .countdown-controls>button:active {
--_button-bump: 0;
}

/* ---- Quarto Reveal.js ---- */
.reveal .countdown {
--_margin: 0;
}

/* ----- Fullscreen ----- */
.countdown.countdown-fullscreen {
z-index: 0;
}

.countdown-fullscreen.running .countdown-controls {
top: 1rem;
left: 0;
right: 0;
justify-content: center;
}

.countdown-fullscreen.running .countdown-controls>button+button {
margin-left: 1rem;
}
Loading

0 comments on commit 7016fc2

Please sign in to comment.