"
template columns*(body: untyped) =
- template column(bodyInner: untyped) =
- nbRawHtml: "
"""
+ nbRawHtml: """
"""
body
nbRawHtml: "
"
+template column*(bodyInner: untyped) =
+ ## column should always be used inside a `columns` block
+ nbRawHtml: "
"
+ bodyInner
+ nbRawHtml: "
"
+
template footer*(text: string, rawHtml = false) =
if rawHtml:
nb.context["revealFooter"] = text
From 11b58ad2f67bcc552be29e36419bee9d27418d57 Mon Sep 17 00:00:00 2001
From: HugoGranstrom <5092565+HugoGranstrom@users.noreply.github.com>
Date: Sat, 24 Sep 2022 20:36:54 +0200
Subject: [PATCH 22/31] footer now accepts fontSize and opacity so it doesn't
stand out as much
---
README.md | 2 +-
changelog.md | 2 +-
docs/showcase.html | 146 ++++++++++++++++++++++-----------------------
src/nimiSlides.nim | 8 ++-
4 files changed, 81 insertions(+), 77 deletions(-)
diff --git a/README.md b/README.md
index 325786f..29dcd6d 100644
--- a/README.md
+++ b/README.md
@@ -291,7 +291,7 @@ nb.useLocalReveal("revealjsfolder")
## Misc. Configuration
- `useScrollWheel()`, this enables stepping forward in the presentation using the scroll-wheel.
- `showSlideNumber()`, this enables the current slide number being shown in the corner.
-- `footer(text: string, rawHtml=false)`, this will create a footer at the bottom of every slide. By default the text is treated as markdown, but if `rawHtml=true` it will inline the text as raw HTML.
+- `footer(text: string, fontSize=16, opacity=0.6, rawHtml=false)`, this will create a footer at the bottom of every slide. By default the text is treated as markdown, but if `rawHtml=true` it will inline the text as raw HTML.
# Roadmap ๐บ
- [X] Make available `fragments` (https://revealjs.com/fragments/)
diff --git a/changelog.md b/changelog.md
index e95afec..34c7e8c 100644
--- a/changelog.md
+++ b/changelog.md
@@ -20,7 +20,7 @@ slide:
column:
nbText: "Right column"
```
-- `footer` template to a footer to every slide. The input is a string with markdown, unless the argument `rawHtml=true` in which case it is treated as raw HTML.
+- `footer(text: string, fontSize=20, opacity=0.6, rawHtml=false)` template to a footer to every slide. The input is a string with markdown, unless the argument `rawHtml=true` in which case it is treated as raw HTML.
- The footer will be shown on all slides except those with image-, video- or iframe-backgrounds.
- Experimental features - the API for these are not yet stable and might change in the future:
- `fragmentThen` - Allows the construction of fragments like `growThenShrink` by `fragmentThen(grows, shrinks)`. The second animations happens at the same time as the next animation, reducing the number of clicks needed.
diff --git a/docs/showcase.html b/docs/showcase.html
index ed32b3a..8ac83ea 100644
--- a/docs/showcase.html
+++ b/docs/showcase.html
@@ -162,21 +162,21 @@
function HEX3Aanonymous_469762055(eventHEX60gensym0_469762056) {
-function lambda_452985023_469762059(event_452985044_469762060) {
+function lambda_452985134_469762059(event_452985155_469762060) {
BeforeRet: do {
rawEcho(makeNimstrLit("slidechanged!"));
- var currentslide_452985045_469762061 = event_452985044_469762060.currentSlide;
- console.log(currentslide_452985045_469762061);
+ var currentslide_452985156_469762061 = event_452985155_469762060.currentSlide;
+ console.log(currentslide_452985156_469762061);
Label1: do {
- var node_452985046_469762065 = null;
+ var node_452985157_469762065 = null;
var i_469762204 = 0;
- var L_469762205 = (currentslide_452985045_469762061.attributes).length;
+ var L_469762205 = (currentslide_452985156_469762061.attributes).length;
Label2: do {
Label3: while (true) {
if (!(i_469762204 < L_469762205)) break Label3;
- node_452985046_469762065 = currentslide_452985045_469762061.attributes[i_469762204];
- if (contains_469762068(["data-background-video", "data-background-iframe", "data-background-image"], node_452985046_469762065.nodeName)) {
- footer_452985043_469762058.style.setProperty("visibility", "hidden", []);
+ node_452985157_469762065 = currentslide_452985156_469762061.attributes[i_469762204];
+ if (contains_469762068(["data-background-video", "data-background-iframe", "data-background-image"], node_452985157_469762065.nodeName)) {
+ footer_452985154_469762058.style.setProperty("visibility", "hidden", []);
break BeforeRet;
}
@@ -184,7 +184,7 @@
}
} while (false);
} while (false);
- footer_452985043_469762058.style.setProperty("visibility", "visible", []);
+ footer_452985154_469762058.style.setProperty("visibility", "visible", []);
} while (false);
@@ -194,21 +194,21 @@
function HEX3Aanonymous_469762125(eventHEX60gensym0_469762126) {
-function lambda_452985023_469762129(event_452985044_469762130) {
+function lambda_452985134_469762129(event_452985155_469762130) {
BeforeRet: do {
rawEcho(makeNimstrLit("slidechanged!"));
- var currentslide_452985045_469762131 = event_452985044_469762130.currentSlide;
- console.log(currentslide_452985045_469762131);
+ var currentslide_452985156_469762131 = event_452985155_469762130.currentSlide;
+ console.log(currentslide_452985156_469762131);
Label1: do {
- var node_452985046_469762135 = null;
+ var node_452985157_469762135 = null;
var i_469762212 = 0;
- var L_469762213 = (currentslide_452985045_469762131.attributes).length;
+ var L_469762213 = (currentslide_452985156_469762131.attributes).length;
Label2: do {
Label3: while (true) {
if (!(i_469762212 < L_469762213)) break Label3;
- node_452985046_469762135 = currentslide_452985045_469762131.attributes[i_469762212];
- if (contains_469762068(["data-background-video", "data-background-iframe", "data-background-image"], node_452985046_469762135.nodeName)) {
- footer_452985043_469762128.style.setProperty("visibility", "hidden", []);
+ node_452985157_469762135 = currentslide_452985156_469762131.attributes[i_469762212];
+ if (contains_469762068(["data-background-video", "data-background-iframe", "data-background-image"], node_452985157_469762135.nodeName)) {
+ footer_452985154_469762128.style.setProperty("visibility", "hidden", []);
break BeforeRet;
}
@@ -216,18 +216,18 @@
}
} while (false);
} while (false);
- footer_452985043_469762128.style.setProperty("visibility", "visible", []);
+ footer_452985154_469762128.style.setProperty("visibility", "visible", []);
} while (false);
}
rawEcho(makeNimstrLit("Doing something!"));
- var deck_452985042_469762127 = Reveal.getRevealElement();
- var footer_452985043_469762128 = document.getElementById("reveal-footer").cloneNode(true);
- footer_452985043_469762128.style.setProperty("visibility", "visible", []);
- deck_452985042_469762127.appendChild(footer_452985043_469762128);
- Reveal.on("slidechanged", lambda_452985023_469762129);
+ var deck_452985153_469762127 = Reveal.getRevealElement();
+ var footer_452985154_469762128 = document.getElementById("reveal-footer").cloneNode(true);
+ footer_452985154_469762128.style.setProperty("visibility", "visible", []);
+ deck_452985153_469762127.appendChild(footer_452985154_469762128);
+ Reveal.on("slidechanged", lambda_452985134_469762129);
}
@@ -239,11 +239,11 @@
if (Reveal.isReady()) {
rawEcho(makeNimstrLit("Doing something!"));
- var deck_452985042_469762057 = Reveal.getRevealElement();
- var footer_452985043_469762058 = document.getElementById("reveal-footer").cloneNode(true);
- footer_452985043_469762058.style.setProperty("visibility", "visible", []);
- deck_452985042_469762057.appendChild(footer_452985043_469762058);
- Reveal.on("slidechanged", lambda_452985023_469762059);
+ var deck_452985153_469762057 = Reveal.getRevealElement();
+ var footer_452985154_469762058 = document.getElementById("reveal-footer").cloneNode(true);
+ footer_452985154_469762058.style.setProperty("visibility", "visible", []);
+ deck_452985153_469762057.appendChild(footer_452985154_469762058);
+ Reveal.on("slidechanged", lambda_452985134_469762059);
}
else {
window.addEventListener("load", HEX3Aanonymous_469762123, false);
@@ -3299,18 +3299,18 @@
Typewriter Effect
return result_469762075[0];
}
-var rootid_452985828_469762057 = to_469762050(parseJson_603985094(makeNimstrLit("\"karax-1\"")));
-var id_452985829_469762063 = to_469762050(parseJson_603985094(makeNimstrLit("\"typewriter0\"")));
-var localtext_452985830_469762069 = to_469762050(parseJson_603985094(makeNimstrLit("\"This text will be typed one letter at a time with the speed and alignement specified.\"")));
-var fragindex_452985831_469762100 = to_469762070(parseJson_603985094(makeNimstrLit("0")));
-var speed_452985832_469762106 = to_469762070(parseJson_603985094(makeNimstrLit("30")));
-var align_452985833_469762112 = to_469762050(parseJson_603985094(makeNimstrLit("\"left\"")));
+var rootid_452985939_469762057 = to_469762050(parseJson_603985094(makeNimstrLit("\"karax-1\"")));
+var id_452985940_469762063 = to_469762050(parseJson_603985094(makeNimstrLit("\"typewriter0\"")));
+var localtext_452985941_469762069 = to_469762050(parseJson_603985094(makeNimstrLit("\"This text will be typed one letter at a time with the speed and alignement specified.\"")));
+var fragindex_452985942_469762100 = to_469762070(parseJson_603985094(makeNimstrLit("0")));
+var speed_452985943_469762106 = to_469762070(parseJson_603985094(makeNimstrLit("30")));
+var align_452985944_469762112 = to_469762050(parseJson_603985094(makeNimstrLit("\"left\"")));
var gid_1174405727 = [0];
var vcomponents_1207959565 = [{}];
var kxi__nimib_kxi_5 = null;
-var postrendercallback_452985834_469762168 = [null];
-var i_452985836_469762175 = [0];
-var timeout_452985837_469762176 = [null];
+var postrendercallback_452985945_469762168 = [null];
+var i_452985947_469762175 = [0];
+var timeout_452985948_469762176 = [null];
function newSeq_1140851702(len_1140851704) {
var result_1140851705 = [];
@@ -4698,14 +4698,14 @@
Typewriter Effect
}
-function createdom_452985823_469762192() {
+function createdom_452985934_469762192() {
var result_469762193 = null;
var tmp_469762224 = tree_1174405894(44, []);
var tmp_469762225 = tree_1174405894(32, []);
- tmp_469762225.id = toJSStr(id_452985829_469762063);
- tmp_469762225.style = style_1241514444(160, toJSStr(align_452985833_469762112));
- add_1174405831(tmp_469762225, text_1174405949(toJSStr(localtext_452985830_469762069)));
+ tmp_469762225.id = toJSStr(id_452985940_469762063);
+ tmp_469762225.style = style_1241514444(160, toJSStr(align_452985944_469762112));
+ add_1174405831(tmp_469762225, text_1174405949(toJSStr(localtext_452985941_469762069)));
add_1174405831(tmp_469762224, tmp_469762225);
result_469762193 = tmp_469762224;
@@ -4883,41 +4883,41 @@
Typewriter Effect
}
-function typewriterlocal_452985824_469762177() {
+function typewriterlocal_452985935_469762177() {
var Temporary1;
- rawEcho(makeNimstrLit("Typing "), HEX24_318767107(fragindex_452985831_469762100));
- var el_452985838_469762178 = document.getElementById(toJSStr(id_452985829_469762063));
- if ((i_452985836_469762175[0] < (localtext_452985830_469762069).length)) {
- if (null != (Temporary1 = toJSStr(nimCharToStr(localtext_452985830_469762069[i_452985836_469762175[0]])), Temporary1)) { if (null == el_452985838_469762178.innerHTML) el_452985838_469762178.innerHTML = Temporary1; else el_452985838_469762178.innerHTML += Temporary1; };
- i_452985836_469762175[0] += 1;
- timeout_452985837_469762176[0] = setTimeout(typewriterlocal_452985824_469762177, speed_452985832_469762106);
+ rawEcho(makeNimstrLit("Typing "), HEX24_318767107(fragindex_452985942_469762100));
+ var el_452985949_469762178 = document.getElementById(toJSStr(id_452985940_469762063));
+ if ((i_452985947_469762175[0] < (localtext_452985941_469762069).length)) {
+ if (null != (Temporary1 = toJSStr(nimCharToStr(localtext_452985941_469762069[i_452985947_469762175[0]])), Temporary1)) { if (null == el_452985949_469762178.innerHTML) el_452985949_469762178.innerHTML = Temporary1; else el_452985949_469762178.innerHTML += Temporary1; };
+ i_452985947_469762175[0] += 1;
+ timeout_452985948_469762176[0] = setTimeout(typewriterlocal_452985935_469762177, speed_452985943_469762106);
}
}
-function lambda_452985825_469762240(event_452985839_469762241) {
+function lambda_452985936_469762240(event_452985950_469762241) {
-function lambda_452985826_469762242(event_452985839_469762243) {
- if (!(isAnimatedCode_1308622862(event_452985839_469762243.fragment))) {
- var index_452985840_469762244 = getFragmentIndex_1308622903(event_452985839_469762243.fragment);
- if ((fragindex_452985831_469762100 == index_452985840_469762244)) {
- var el_452985838_469762245 = document.getElementById(toJSStr(id_452985829_469762063));
- el_452985838_469762245.innerHTML = "";
- i_452985836_469762175[0] = 0;
- rawEcho(makeNimstrLit("Starting "), HEX24_318767107(fragindex_452985831_469762100));
- typewriterlocal_452985824_469762177();
+function lambda_452985937_469762242(event_452985950_469762243) {
+ if (!(isAnimatedCode_1308622862(event_452985950_469762243.fragment))) {
+ var index_452985951_469762244 = getFragmentIndex_1308622903(event_452985950_469762243.fragment);
+ if ((fragindex_452985942_469762100 == index_452985951_469762244)) {
+ var el_452985949_469762245 = document.getElementById(toJSStr(id_452985940_469762063));
+ el_452985949_469762245.innerHTML = "";
+ i_452985947_469762175[0] = 0;
+ rawEcho(makeNimstrLit("Starting "), HEX24_318767107(fragindex_452985942_469762100));
+ typewriterlocal_452985935_469762177();
}
else {
- var el_452985838_469762246 = document.getElementById(toJSStr(id_452985829_469762063));
- i_452985836_469762175[0] = (localtext_452985830_469762069).length;
- if (!((timeout_452985837_469762176[0] == null))) {
- clearTimeout(timeout_452985837_469762176[0]);
+ var el_452985949_469762246 = document.getElementById(toJSStr(id_452985940_469762063));
+ i_452985947_469762175[0] = (localtext_452985941_469762069).length;
+ if (!((timeout_452985948_469762176[0] == null))) {
+ clearTimeout(timeout_452985948_469762176[0]);
}
- el_452985838_469762246.innerHTML = toJSStr(localtext_452985830_469762069);
+ el_452985949_469762246.innerHTML = toJSStr(localtext_452985941_469762069);
}
}
@@ -4926,10 +4926,10 @@
Typewriter Effect
}
-function lambda_452985827_469762250(event_452985839_469762251) {
- if (!(isAnimatedCode_1308622862(event_452985839_469762251.fragment))) {
- var index_452985840_469762252 = getFragmentIndex_1308622903(event_452985839_469762251.fragment);
- if ((fragindex_452985831_469762100 == index_452985840_469762252)) {
+function lambda_452985938_469762250(event_452985950_469762251) {
+ if (!(isAnimatedCode_1308622862(event_452985950_469762251.fragment))) {
+ var index_452985951_469762252 = getFragmentIndex_1308622903(event_452985950_469762251.fragment);
+ if ((fragindex_452985942_469762100 == index_452985951_469762252)) {
}
}
@@ -4938,14 +4938,14 @@
Typewriter Effect
}
- rawEcho(makeNimstrLit("Loading "), HEX24_318767107(fragindex_452985831_469762100));
- Reveal.on("fragmentshown", lambda_452985826_469762242);
- Reveal.on("fragmenthidden", lambda_452985827_469762250);
+ rawEcho(makeNimstrLit("Loading "), HEX24_318767107(fragindex_452985942_469762100));
+ Reveal.on("fragmentshown", lambda_452985937_469762242);
+ Reveal.on("fragmenthidden", lambda_452985938_469762250);
}
-setRenderer_1140851796(createdom_452985823_469762192, toJSStr(rootid_452985828_469762057), postrendercallback_452985834_469762168[0]);
-window.addEventListener("load", lambda_452985825_469762240, false);
+setRenderer_1140851796(createdom_452985934_469762192, toJSStr(rootid_452985939_469762057), postrendercallback_452985945_469762168[0]);
+window.addEventListener("load", lambda_452985936_469762240, false);