Skip to content

Commit

Permalink
update slides
Browse files Browse the repository at this point in the history
  • Loading branch information
sfreille committed Nov 28, 2024
1 parent 5f281c6 commit 1c2e0bc
Show file tree
Hide file tree
Showing 14 changed files with 1,423 additions and 1,947 deletions.
330 changes: 0 additions & 330 deletions tepm/lect01-24.qmd~

This file was deleted.

1,664 changes: 761 additions & 903 deletions tepm/lect02-24.html

Large diffs are not rendered by default.

1,257 changes: 556 additions & 701 deletions tepm/lect02-24.qmd

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tepm/lect02-24_files/libs/clipboard/clipboard.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tepm/lect02-24_files/libs/quarto-html/light-border.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tepm/lect02-24_files/libs/quarto-html/popper.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tepm/lect02-24_files/libs/quarto-html/quarto-html.min.css
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/*# sourceMappingURL=0a6b880beb84f9b6f36107a76f82c5b1.css.map */

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions tepm/lect02-24_files/libs/revealjs/dist/theme/quarto.css

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ var PdfExport = ( function( _Reveal ){
Reveal = _Reveal;
install();
};
Plugin.togglePdfExport = function () {
togglePdfExport();
};
}

return Plugin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ window.QuartoLineHighlight = function () {
divSourceCode.forEach((el) => {
if (el.hasAttribute(kCodeLineNumbersAttr)) {
const codeLineAttr = el.getAttribute(kCodeLineNumbersAttr);
el.removeAttribute("data-code-line-numbers");
el.removeAttribute(kCodeLineNumbersAttr);
if (handleLinesSelector(deck, codeLineAttr)) {
// Only process if attr is a string to select lines to highlights
// e.g "1|3,6|8-11"
Expand Down Expand Up @@ -165,17 +165,17 @@ window.QuartoLineHighlight = function () {
if (typeof highlight.last === "number") {
spanToHighlight = [].slice.call(
codeBlock.querySelectorAll(
":scope > span:nth-child(n+" +
":scope > span:nth-of-type(n+" +
highlight.first +
"):nth-child(-n+" +
"):nth-of-type(-n+" +
highlight.last +
")"
)
);
} else if (typeof highlight.first === "number") {
spanToHighlight = [].slice.call(
codeBlock.querySelectorAll(
":scope > span:nth-child(" + highlight.first + ")"
":scope > span:nth-of-type(" + highlight.first + ")"
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
max-height: 2.2rem;
height: 100%;
width: auto;
z-index: 2;
}

.reveal .footer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ window.QuartoSupport = function () {
return /print-pdf/gi.test(window.location.search);
}

// helper for theme toggling
function toggleBackgroundTheme(el, onDarkBackground, onLightBackground) {
if (onDarkBackground) {
el.classList.add('has-dark-background')
} else {
el.classList.remove('has-dark-background')
}
if (onLightBackground) {
el.classList.add('has-light-background')
} else {
el.classList.remove('has-light-background')
}
}

// implement controlsAudo
function controlsAuto(deck) {
const config = deck.getConfig();
Expand Down Expand Up @@ -111,8 +125,19 @@ window.QuartoSupport = function () {
}
}

// add footer text
function addFooter(deck) {
// tweak slide-number element
function tweakSlideNumber(deck) {
deck.on("slidechanged", function (ev) {
const revealParent = deck.getRevealElement();
const slideNumberEl = revealParent.querySelector(".slide-number");
const onDarkBackground = Reveal.getSlideBackground(ev.indexh, ev.indexv).classList.contains('has-dark-background');
const onLightBackground = Reveal.getSlideBackground(ev.indexh, ev.indexv).classList.contains('has-light-background');
toggleBackgroundTheme(slideNumberEl, onDarkBackground, onLightBackground);
})
}

// add footer text
function addFooter(deck) {
const revealParent = deck.getRevealElement();
const defaultFooterDiv = document.querySelector(".footer-default");
if (defaultFooterDiv) {
Expand All @@ -127,13 +152,17 @@ window.QuartoSupport = function () {
prevSlideFooter.remove();
}
const currentSlideFooter = ev.currentSlide.querySelector(".footer");
const onDarkBackground = Reveal.getSlideBackground(ev.indexh, ev.indexv).classList.contains('has-dark-background')
const onLightBackground = Reveal.getSlideBackground(ev.indexh, ev.indexv).classList.contains('has-light-background')
if (currentSlideFooter) {
defaultFooterDiv.style.display = "none";
const slideFooter = currentSlideFooter.cloneNode(true);
handleLinkClickEvents(deck, slideFooter);
deck.getRevealElement().appendChild(slideFooter);
toggleBackgroundTheme(slideFooter, onDarkBackground, onLightBackground)
} else {
defaultFooterDiv.style.display = "block";
toggleBackgroundTheme(defaultFooterDiv, onDarkBackground, onLightBackground)
}
});
}
Expand Down Expand Up @@ -272,6 +301,23 @@ window.QuartoSupport = function () {
}
}

function handleWhiteSpaceInColumns(deck) {
for (const outerDiv of window.document.querySelectorAll("div.columns")) {
// remove all whitespace text nodes
// whitespace nodes cause the columns to be misaligned
// since they have inline-block layout
//
// Quarto emits no whitespace nodes, but third-party tooling
// has bugs that can cause whitespace nodes to be emitted.
// See https://github.com/quarto-dev/quarto-cli/issues/8382
for (const node of outerDiv.childNodes) {
if (node.nodeType === 3 && node.nodeValue.trim() === "") {
outerDiv.removeChild(node);
}
}
}
}

return {
id: "quarto-support",
init: function (deck) {
Expand All @@ -280,11 +326,13 @@ window.QuartoSupport = function () {
fixupForPrint(deck);
applyGlobalStyles(deck);
addLogoImage(deck);
tweakSlideNumber(deck);
addFooter(deck);
addChalkboardButtons(deck);
handleTabbyClicks();
handleSlideChanges(deck);
workaroundMermaidDistance(deck);
handleWhiteSpaceInColumns(deck);
},
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ window.RevealMenuToolHandlers = {
downloadDrawings: revealMenuToolHandler(function () {
RevealChalkboard.download();
}),
togglePdfExport: revealMenuToolHandler(function () {
PdfExport.togglePdfExport();
}),
};

0 comments on commit 1c2e0bc

Please sign in to comment.