From eb9cec77d93a2570b5ac98ff857e75cb862b364e Mon Sep 17 00:00:00 2001 From: James J Balamuta Date: Thu, 8 Feb 2024 06:22:24 +0000 Subject: [PATCH 1/8] Add Makefile with sync designation --- Makefile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..17fbf35 --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +# Define the source directory for assets +SRC_DIR := lib + +# Define the destination directories for different languages +PYTHON_DEST := python/countdown/assets +R_DEST := r/inst/countdown +QUARTO_DEST := quarto/_extensions/countdown/assets + +# Set the default target to sync +.DEFAULT_GOAL := sync + +# Define the sync target +sync: sync-python sync-r sync-quarto + +# Rule to copy assets to Python directory +sync-python: + @echo "Syncing assets to Python directory..." + mkdir -p $(PYTHON_DEST) + cp -r $(SRC_DIR)/* $(PYTHON_DEST) + +# Rule to copy assets to R directory +sync-r: + @echo "Syncing assets to R directory..." + mkdir -p $(R_DEST) + cp -r $(SRC_DIR)/* $(R_DEST) + +# Rule to copy assets to Quarto directory +sync-quarto: + @echo "Syncing assets to Quarto directory..." + mkdir -p $(QUARTO_DEST) + cp -r $(SRC_DIR)/* $(QUARTO_DEST) From c028d2e84afe2dbe96b7c47d23b0643c684d7e44 Mon Sep 17 00:00:00 2001 From: James J Balamuta Date: Thu, 8 Feb 2024 08:48:00 +0000 Subject: [PATCH 2/8] Simplify and specify targets to avoid picking up the README. --- Makefile | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 17fbf35..0675d10 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,23 @@ # Define the source directory for assets SRC_DIR := lib -# Define the destination directories for different languages -PYTHON_DEST := python/countdown/assets -R_DEST := r/inst/countdown -QUARTO_DEST := quarto/_extensions/countdown/assets +# Define the languages being used: +LANG_VARIANTS := python r quarto + +# Define the corresponding destination directories for each language +LANG_DEST := python/countdown/assets r/inst/countdown quarto/_extensions/countdown/assets + +# Convert LANG_VARIANTS to a list of sync targets, e.g. make sync-r, sync-python +SYNC_TARGETS := $(addprefix sync-, $(LANG_VARIANTS)) # Set the default target to sync .DEFAULT_GOAL := sync # Define the sync target -sync: sync-python sync-r sync-quarto - -# Rule to copy assets to Python directory -sync-python: - @echo "Syncing assets to Python directory..." - mkdir -p $(PYTHON_DEST) - cp -r $(SRC_DIR)/* $(PYTHON_DEST) - -# Rule to copy assets to R directory -sync-r: - @echo "Syncing assets to R directory..." - mkdir -p $(R_DEST) - cp -r $(SRC_DIR)/* $(R_DEST) +sync: $(SYNC_TARGETS) -# Rule to copy assets to Quarto directory -sync-quarto: - @echo "Syncing assets to Quarto directory..." - mkdir -p $(QUARTO_DEST) - cp -r $(SRC_DIR)/* $(QUARTO_DEST) +# Rule to create directories and copy assets based on LANG_DEST +sync-%: + @echo "Syncing assets to $(filter $*%, $(LANG_DEST)) directory..." + mkdir -p $(filter $*%, $(LANG_DEST)) + cp -r $(SRC_DIR)/*.js $(SRC_DIR)/*.css $(SRC_DIR)/*.mp3 $(filter $*%, $(LANG_DEST)) From 972f497febba22901b3cd035000fdd2f5c076ebd Mon Sep 17 00:00:00 2001 From: James J Balamuta Date: Fri, 9 Feb 2024 09:50:20 +0000 Subject: [PATCH 3/8] Revert "Simplify and specify targets to avoid picking up the README." This reverts commit c028d2e84afe2dbe96b7c47d23b0643c684d7e44. --- Makefile | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 0675d10..17fbf35 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,31 @@ # Define the source directory for assets SRC_DIR := lib -# Define the languages being used: -LANG_VARIANTS := python r quarto - -# Define the corresponding destination directories for each language -LANG_DEST := python/countdown/assets r/inst/countdown quarto/_extensions/countdown/assets - -# Convert LANG_VARIANTS to a list of sync targets, e.g. make sync-r, sync-python -SYNC_TARGETS := $(addprefix sync-, $(LANG_VARIANTS)) +# Define the destination directories for different languages +PYTHON_DEST := python/countdown/assets +R_DEST := r/inst/countdown +QUARTO_DEST := quarto/_extensions/countdown/assets # Set the default target to sync .DEFAULT_GOAL := sync # Define the sync target -sync: $(SYNC_TARGETS) +sync: sync-python sync-r sync-quarto + +# Rule to copy assets to Python directory +sync-python: + @echo "Syncing assets to Python directory..." + mkdir -p $(PYTHON_DEST) + cp -r $(SRC_DIR)/* $(PYTHON_DEST) + +# Rule to copy assets to R directory +sync-r: + @echo "Syncing assets to R directory..." + mkdir -p $(R_DEST) + cp -r $(SRC_DIR)/* $(R_DEST) -# Rule to create directories and copy assets based on LANG_DEST -sync-%: - @echo "Syncing assets to $(filter $*%, $(LANG_DEST)) directory..." - mkdir -p $(filter $*%, $(LANG_DEST)) - cp -r $(SRC_DIR)/*.js $(SRC_DIR)/*.css $(SRC_DIR)/*.mp3 $(filter $*%, $(LANG_DEST)) +# Rule to copy assets to Quarto directory +sync-quarto: + @echo "Syncing assets to Quarto directory..." + mkdir -p $(QUARTO_DEST) + cp -r $(SRC_DIR)/* $(QUARTO_DEST) From 0f696b6ef8b6b7f9649ef29cbb45e4d125fce441 Mon Sep 17 00:00:00 2001 From: James J Balamuta Date: Fri, 9 Feb 2024 10:35:33 +0000 Subject: [PATCH 4/8] Incorporate version information into Makefile and handle import statements with Lua --- Makefile | 29 +++++++++++++++------- lib/version.txt | 1 + quarto/_extensions/countdown/config.lua | 3 +++ quarto/_extensions/countdown/countdown.lua | 9 ++++--- r/R/config.R | 1 + r/R/countdown.R | 2 +- 6 files changed, 31 insertions(+), 14 deletions(-) create mode 100644 lib/version.txt create mode 100644 quarto/_extensions/countdown/config.lua create mode 100644 r/R/config.R diff --git a/Makefile b/Makefile index 17fbf35..bb65bf3 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,17 @@ # Define the source directory for assets SRC_DIR := lib +JS_FILES := $(wildcard $(SRC_DIR)/*.js) +CSS_FILES := $(wildcard $(SRC_DIR)/*.css) +MP3_FILES := $(wildcard $(SRC_DIR)/*.mp3) + +# Read version from version distribution file +VERSION_FILE := $(SRC_DIR)/version.txt +VERSION := $(shell grep '^Version:' $(VERSION_FILE) | awk '{print $$2}') # Define the destination directories for different languages -PYTHON_DEST := python/countdown/assets -R_DEST := r/inst/countdown -QUARTO_DEST := quarto/_extensions/countdown/assets +SYNC_DEST_PYTHON := python/countdown/assets +SYNC_DEST_R := r/inst/countdown +SYNC_DEST_QUARTO := quarto/_extensions/countdown/assets # Set the default target to sync .DEFAULT_GOAL := sync @@ -15,17 +22,21 @@ sync: sync-python sync-r sync-quarto # Rule to copy assets to Python directory sync-python: @echo "Syncing assets to Python directory..." - mkdir -p $(PYTHON_DEST) - cp -r $(SRC_DIR)/* $(PYTHON_DEST) + mkdir -p $(SYNC_DEST_PYTHON) + cp -r $(JS_FILES) $(CSS_FILES) $(MP3_FILES) $(SYNC_DEST_PYTHON) + echo "countdown_embedded = '$(VERSION)'" > python/countdown/config.py # Rule to copy assets to R directory sync-r: @echo "Syncing assets to R directory..." - mkdir -p $(R_DEST) - cp -r $(SRC_DIR)/* $(R_DEST) + mkdir -p $(SYNC_DEST_R) + cp -r $(JS_FILES) $(CSS_FILES) $(MP3_FILES) $(SYNC_DEST_R) + echo "countdown_embedded <- '$(VERSION)'" > r/R/config.R + # Rule to copy assets to Quarto directory sync-quarto: @echo "Syncing assets to Quarto directory..." - mkdir -p $(QUARTO_DEST) - cp -r $(SRC_DIR)/* $(QUARTO_DEST) + mkdir -p $(SYNC_DEST_QUARTO) + cp -r $(JS_FILES) $(CSS_FILES) $(MP3_FILES) $(SYNC_DEST_QUARTO) + echo "local countdown_embedded = '$(VERSION)'\n\nreturn { countdownEmbedded = countdown_embedded }" > quarto/_extensions/countdown/config.lua diff --git a/lib/version.txt b/lib/version.txt new file mode 100644 index 0000000..0769594 --- /dev/null +++ b/lib/version.txt @@ -0,0 +1 @@ +Version: 0.5.0 diff --git a/quarto/_extensions/countdown/config.lua b/quarto/_extensions/countdown/config.lua new file mode 100644 index 0000000..56230be --- /dev/null +++ b/quarto/_extensions/countdown/config.lua @@ -0,0 +1,3 @@ +local countdown_embedded = '0.5.0' + +return { countdownEmbedded = countdown_embedded } diff --git a/quarto/_extensions/countdown/countdown.lua b/quarto/_extensions/countdown/countdown.lua index ec12cdb..4176b58 100644 --- a/quarto/_extensions/countdown/countdown.lua +++ b/quarto/_extensions/countdown/countdown.lua @@ -1,5 +1,7 @@ --- Specify embedded version -local countdownEmbeddedVersion = "0.0.1" +-- Retrieve countdown configuration data +local configData = require("config") +-- Specify the embedded version +local countdownEmbedded = configData.countdownEmbedded -- Only embed resources once if there are multiple timers present local needsToExportDependencies = true @@ -144,11 +146,10 @@ end -- Handle embedding/creation of assets once local function ensureHTMLDependency(meta) - -- Register _all_ assets together. quarto.doc.addHtmlDependency({ name = "countdown", - version = countdownEmbeddedVersion, + version = countdownEmbedded, scripts = { "assets/countdown.js"}, stylesheets = { "assets/countdown.css"}, resources = {"assets/smb_stage_clear.mp3"} diff --git a/r/R/config.R b/r/R/config.R new file mode 100644 index 0000000..6391859 --- /dev/null +++ b/r/R/config.R @@ -0,0 +1 @@ +countdown_embedded <- '0.5.0' diff --git a/r/R/countdown.R b/r/R/countdown.R index 0ed4da2..9ef7779 100644 --- a/r/R/countdown.R +++ b/r/R/countdown.R @@ -267,7 +267,7 @@ countdown <- function( html_dependency_countdown <- function() { htmlDependency( "countdown", - version = utils::packageVersion("countdown"), + version = countdown_embedded, package = "countdown", src = "countdown", script = "countdown.js", From f05680833c9cb8213fe7c209c5b8d954f3cd82c7 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Tue, 13 Feb 2024 09:22:47 -0500 Subject: [PATCH 5/8] Add `make help`, `make debug`, rename `make sync-all` --- Makefile | 56 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index bb65bf3..faad924 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,14 @@ +.PHONY: help debug sync-all sync-python sync-quarto sync-r +.DEFAULT_GOAL := help + +help: ## Show help messages for make targets + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-18s\033[0m %s\n", $$1, $$2}' + # Define the source directory for assets SRC_DIR := lib -JS_FILES := $(wildcard $(SRC_DIR)/*.js) -CSS_FILES := $(wildcard $(SRC_DIR)/*.css) -MP3_FILES := $(wildcard $(SRC_DIR)/*.mp3) +SRC_FILES := $(wildcard $(SRC_DIR)/*.js) +SRC_FILES += $(wildcard $(SRC_DIR)/*.css) +SRC_FILES += $(wildcard $(SRC_DIR)/*.mp3) # Read version from version distribution file VERSION_FILE := $(SRC_DIR)/version.txt @@ -13,30 +19,32 @@ SYNC_DEST_PYTHON := python/countdown/assets SYNC_DEST_R := r/inst/countdown SYNC_DEST_QUARTO := quarto/_extensions/countdown/assets -# Set the default target to sync -.DEFAULT_GOAL := sync - -# Define the sync target -sync: sync-python sync-r sync-quarto +sync-all: sync-python sync-r sync-quarto ## Sync web assets to all subpackages -# Rule to copy assets to Python directory -sync-python: - @echo "Syncing assets to Python directory..." - mkdir -p $(SYNC_DEST_PYTHON) - cp -r $(JS_FILES) $(CSS_FILES) $(MP3_FILES) $(SYNC_DEST_PYTHON) +sync-python: ## Sync web assets to Python package + @echo "Syncing web assets to the Python package..." + @test -d $(SYNC_DEST_PYTHON) || mkdir -p $(SYNC_DEST_PYTHON) + cp -r $(SRC_FILES) $(SYNC_DEST_PYTHON) echo "countdown_embedded = '$(VERSION)'" > python/countdown/config.py -# Rule to copy assets to R directory -sync-r: - @echo "Syncing assets to R directory..." - mkdir -p $(SYNC_DEST_R) - cp -r $(JS_FILES) $(CSS_FILES) $(MP3_FILES) $(SYNC_DEST_R) +sync-r: ## Sync web assets to R package + @echo "Syncing web assets to R directory..." + @test -d $(SYNC_DEST_R) || mkdir -p $(SYNC_DEST_R) + cp -r $(SRC_FILES) $(SYNC_DEST_R) echo "countdown_embedded <- '$(VERSION)'" > r/R/config.R - -# Rule to copy assets to Quarto directory -sync-quarto: - @echo "Syncing assets to Quarto directory..." - mkdir -p $(SYNC_DEST_QUARTO) - cp -r $(JS_FILES) $(CSS_FILES) $(MP3_FILES) $(SYNC_DEST_QUARTO) + +sync-quarto: ## Sync web assets to Quarto extension + @echo "Syncing web assets to Quarto directory..." + @test -d $(SYNC_DEST_QUARTO) || mkdir -p $(SYNC_DEST_QUARTO) + cp -r $(SRC_FILES) $(SYNC_DEST_QUARTO) echo "local countdown_embedded = '$(VERSION)'\n\nreturn { countdownEmbedded = countdown_embedded }" > quarto/_extensions/countdown/config.lua + +debug: ## Print all variables for debugging + @printf "\033[32m%-18s\033[0m %s\n" "VERSION" "$(VERSION)" + @printf "\033[32m%-18s\033[0m %s\n" "SRC_DIR" "$(SRC_DIR)" + @printf "\033[32m%-18s\033[0m %s\n" "SRC_FILES" "$(SRC_FILES)" + @printf "\033[32m%-18s\033[0m %s\n" "VERSION_FILE" "$(VERSION_FILE)" + @printf "\033[32m%-18s\033[0m %s\n" "SYNC_DEST_PYTHON" "$(SYNC_DEST_PYTHON)" + @printf "\033[32m%-18s\033[0m %s\n" "SYNC_DEST_R" "$(SYNC_DEST_R)" + @printf "\033[32m%-18s\033[0m %s\n" "SYNC_DEST_QUARTO" "$(SYNC_DEST_QUARTO)" From e92cb989f0a3cb8b4034beb7a0b87fd112e07730 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Tue, 13 Feb 2024 09:27:14 -0500 Subject: [PATCH 6/8] Rename `countdown_embedded` -> `countdown_version` --- Makefile | 6 +++--- quarto/_extensions/countdown/config.lua | 4 ++-- quarto/_extensions/countdown/countdown.lua | 4 ++-- r/R/config.R | 2 +- r/R/countdown.R | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index faad924..b01e5e0 100644 --- a/Makefile +++ b/Makefile @@ -25,20 +25,20 @@ sync-python: ## Sync web assets to Python package @echo "Syncing web assets to the Python package..." @test -d $(SYNC_DEST_PYTHON) || mkdir -p $(SYNC_DEST_PYTHON) cp -r $(SRC_FILES) $(SYNC_DEST_PYTHON) - echo "countdown_embedded = '$(VERSION)'" > python/countdown/config.py + echo "countdown_version = '$(VERSION)'" > python/countdown/config.py sync-r: ## Sync web assets to R package @echo "Syncing web assets to R directory..." @test -d $(SYNC_DEST_R) || mkdir -p $(SYNC_DEST_R) cp -r $(SRC_FILES) $(SYNC_DEST_R) - echo "countdown_embedded <- '$(VERSION)'" > r/R/config.R + echo "countdown_version <- '$(VERSION)'" > r/R/config.R sync-quarto: ## Sync web assets to Quarto extension @echo "Syncing web assets to Quarto directory..." @test -d $(SYNC_DEST_QUARTO) || mkdir -p $(SYNC_DEST_QUARTO) cp -r $(SRC_FILES) $(SYNC_DEST_QUARTO) - echo "local countdown_embedded = '$(VERSION)'\n\nreturn { countdownEmbedded = countdown_embedded }" > quarto/_extensions/countdown/config.lua + echo "local countdown_version = '$(VERSION)'\n\nreturn { countdownVersion = countdown_version }" > quarto/_extensions/countdown/config.lua debug: ## Print all variables for debugging @printf "\033[32m%-18s\033[0m %s\n" "VERSION" "$(VERSION)" diff --git a/quarto/_extensions/countdown/config.lua b/quarto/_extensions/countdown/config.lua index 56230be..822441e 100644 --- a/quarto/_extensions/countdown/config.lua +++ b/quarto/_extensions/countdown/config.lua @@ -1,3 +1,3 @@ -local countdown_embedded = '0.5.0' +local countdown_version = '0.5.0' -return { countdownEmbedded = countdown_embedded } +return { countdownVersion = countdown_version } diff --git a/quarto/_extensions/countdown/countdown.lua b/quarto/_extensions/countdown/countdown.lua index 4176b58..ff2ae29 100644 --- a/quarto/_extensions/countdown/countdown.lua +++ b/quarto/_extensions/countdown/countdown.lua @@ -1,7 +1,7 @@ -- Retrieve countdown configuration data local configData = require("config") -- Specify the embedded version -local countdownEmbedded = configData.countdownEmbedded +local countdownVersion = configData.countdownVersion -- Only embed resources once if there are multiple timers present local needsToExportDependencies = true @@ -149,7 +149,7 @@ local function ensureHTMLDependency(meta) -- Register _all_ assets together. quarto.doc.addHtmlDependency({ name = "countdown", - version = countdownEmbedded, + version = countdownVersion, scripts = { "assets/countdown.js"}, stylesheets = { "assets/countdown.css"}, resources = {"assets/smb_stage_clear.mp3"} diff --git a/r/R/config.R b/r/R/config.R index 6391859..a4b0130 100644 --- a/r/R/config.R +++ b/r/R/config.R @@ -1 +1 @@ -countdown_embedded <- '0.5.0' +countdown_version <- '0.5.0' diff --git a/r/R/countdown.R b/r/R/countdown.R index 9ef7779..7a53aff 100644 --- a/r/R/countdown.R +++ b/r/R/countdown.R @@ -267,7 +267,7 @@ countdown <- function( html_dependency_countdown <- function() { htmlDependency( "countdown", - version = countdown_embedded, + version = countdown_version, package = "countdown", src = "countdown", script = "countdown.js", From b846fe657aff10e89c47868463bf4822b5e43a85 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Tue, 13 Feb 2024 09:27:28 -0500 Subject: [PATCH 7/8] chore: clean trailing whitespace --- quarto/_extensions/countdown/countdown.lua | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/quarto/_extensions/countdown/countdown.lua b/quarto/_extensions/countdown/countdown.lua index ff2ae29..e4630f9 100644 --- a/quarto/_extensions/countdown/countdown.lua +++ b/quarto/_extensions/countdown/countdown.lua @@ -3,7 +3,7 @@ local configData = require("config") -- Specify the embedded version local countdownVersion = configData.countdownVersion --- Only embed resources once if there are multiple timers present +-- Only embed resources once if there are multiple timers present local needsToExportDependencies = true -- List CSS default options @@ -39,7 +39,7 @@ local function isVariablePopulated(s) return not isVariableEmpty(s) end --- Check if a table is empty +-- Check if a table is empty local function isTableEmpty(tbl) return next(tbl) == nil end @@ -52,7 +52,7 @@ end -- Check whether an argument is present in kwargs -- If it is, return the value local function tryOption(options, key) - + -- Protect against an empty options if not (options and options[key]) then return nil @@ -98,12 +98,12 @@ local function safeStyle(options, key, fmtString) end -- Construct the CSS style attributes -local function structureCountdownCSSVars(options) +local function structureCountdownCSSVars(options) -- Concatenate style properties with their values using %:?% from kwargs local stylePositional = {"top", "right", "bottom", "left"} local stylePositionalTable = {} local styleDefaultOptionsTable = {} - + -- Build the positional style without prefixing countdown variables for i, key in ipairs(stylePositional) do stylePositionalTable[i] = safeStyle(options, key, "%s: %s;") @@ -133,9 +133,9 @@ local function countdown_style(options) local structuredCSS = structureCountdownCSSVars(options) -- Embed into the document to avoid rendering to disk and, then, embedding a URL. - quarto.doc.include_text('in-header', + quarto.doc.include_text('in-header', string.format( - "\n", + "\n", possibleSelector, structuredCSS ) @@ -172,7 +172,7 @@ local function parseTimeString(args) -- Attempt to extract minutes and seconds from the time string local minutes, seconds = args[1]:match("(%d+):(%d+)") - + -- Check if the pattern matching was successful if isVariableEmpty(minutes) or isVariableEmpty(seconds) then -- Log an error message if the format is incorrect @@ -196,7 +196,7 @@ local function countdown(args, kwargs, meta) if isVariablePopulated(arg_time) then minutes = arg_time.minutes seconds = arg_time.seconds - if isVariablePopulated(tryOption(kwargs, "minutes")) or + if isVariablePopulated(tryOption(kwargs, "minutes")) or isVariablePopulated(tryOption(kwargs, "seconds")) then quarto.log.warning( "Please do not specify `minutes` or `seconds` parameters" .. @@ -215,7 +215,7 @@ local function countdown(args, kwargs, meta) -- Calculate remaining seconds after extracting minutes seconds = time - minutes * 60 - + -- Check if minutes is greater than or equal to 100 (the maximum possible for display) if minutes >= 100 then quarto.log.error("The number of minutes must be less than 100.") @@ -235,7 +235,7 @@ local function countdown(args, kwargs, meta) -- Determine if a warning should be given local warn_when = tonumber(getOption(kwargs, "warn_when", 0)) - + -- Retrieve and convert "update_every" attribute to a number, default to 1 if not present or invalid local update_every = tonumber(getOption(kwargs, "update_every", 1)) @@ -252,14 +252,14 @@ local function countdown(args, kwargs, meta) if isVariableEmpty(tryOption(kwargs, "top")) and isVariableEmpty(tryOption(kwargs, "bottom")) then kwargs["bottom"] = 0 - end - + end + if isVariableEmpty(tryOption(kwargs, "left")) and isVariableEmpty(tryOption(kwargs, "right")) then - kwargs["right"] = 0 + kwargs["right"] = 0 end - local style = structureCountdownCSSVars(kwargs) + local style = structureCountdownCSSVars(kwargs) local rawHtml = table.concat({ '
Date: Wed, 14 Feb 2024 21:37:13 -0500 Subject: [PATCH 8/8] make sync-r --- r/inst/countdown/countdown.css | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/r/inst/countdown/countdown.css b/r/inst/countdown/countdown.css index 6118d98..6edffcf 100644 --- a/r/inst/countdown/countdown.css +++ b/r/inst/countdown/countdown.css @@ -1,4 +1,5 @@ .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)); @@ -19,7 +20,7 @@ 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, 0.6em); + margin: var(--countdown-margin, var(--_margin, 0.6em)); padding: var(--countdown-padding, 0.625rem 0.9rem); text-align: center; z-index: 10; @@ -152,6 +153,11 @@ --_button-bump: 0; } +/* ---- Quarto Reveal.js ---- */ +.reveal .countdown { + --_margin: 0; +} + /* ----- Fullscreen ----- */ .countdown.countdown-fullscreen { z-index: 0;