Skip to content

Commit

Permalink
upgrade pandoc to 2.13 and fix plugin breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
vincerubinetti committed Jun 2, 2021
1 parent d3947c3 commit b5233d9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
3 changes: 2 additions & 1 deletion build/plugins/anchors.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<script type="module">
// which types of elements to add anchors next to, in "document.querySelector"
// format
const typesQuery = 'h1, h2, h3, [id^="fig:"], [id^="tbl:"], [id^="eq:"]';
const typesQuery =
'h1, h2, h3, div[id^="fig:"], div[id^="tbl:"], span[id^="eq:"]';

// start script
function start() {
Expand Down
10 changes: 6 additions & 4 deletions build/plugins/jump-to-first.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@

// start script
function start() {
if (references !== "false") makeButtons("ref-", "p", "reference");
if (figures !== "false") makeButtons("fig:", "figcaption", "figure");
if (tables !== "false") makeButtons("tbl:", "caption", "table");
if (references !== "false")
makeButtons(`div[id^="ref-"]`, ".csl-left-margin", "reference");
if (figures !== "false")
makeButtons(`div[id^="fig:"]`, "figcaption", "figure");
if (tables !== "false") makeButtons(`div[id^="tbl:"]`, "caption", "table");
}

// when jump button clicked
Expand Down Expand Up @@ -45,7 +47,7 @@

// add button next to each reference entry, figure, or table
function makeButtons(query, containerQuery, subject) {
const elements = document.querySelectorAll(`[id^="${query}"`);
const elements = document.querySelectorAll(query);
for (const element of elements) {
const id = element.id;
const buttonContainer = element.querySelector(containerQuery);
Expand Down
8 changes: 4 additions & 4 deletions build/plugins/tooltips.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
"data-selected",
"data-highlighted",
"data-glow",
"class",
];
for (const attribute of attributes) {
sourceCopy.removeAttribute(attribute);
Expand Down Expand Up @@ -290,9 +291,8 @@
prevButton.classList.add("icon_button");
nextButton.classList.add("icon_button");
prevButton.innerHTML = document.querySelector(".icon_caret_left").innerHTML;
nextButton.innerHTML = document.querySelector(
".icon_caret_right"
).innerHTML;
nextButton.innerHTML =
document.querySelector(".icon_caret_right").innerHTML;
navBar.appendChild(prevButton);
navBar.appendChild(document.createTextNode(text));
navBar.appendChild(nextButton);
Expand Down Expand Up @@ -336,7 +336,7 @@
if (!target) return;

// if ref or figure, modify target to get expected element
if (id.indexOf("ref-") === 0) target = target.querySelector("p");
if (id.indexOf("ref-") === 0) target = target.querySelector(":nth-child(2)");
else if (id.indexOf("fig:") === 0) target = target.querySelector("figure");

return target;
Expand Down
13 changes: 10 additions & 3 deletions build/themes/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@
}

/* table auto-number */
table > caption > span:first-of-type,
div.table_wrapper > table > caption > span:first-of-type {
table > caption > span:first-of-type {
font-weight: bold;
margin-right: 5px;
}
Expand Down Expand Up @@ -495,6 +494,15 @@
top: 0.125em;
}

/* -------------------------------------------------- */
/* references */
/* -------------------------------------------------- */

.csl-entry {
margin-top: 20px;
margin-bottom: 20px;
}

/* -------------------------------------------------- */
/* print control */
/* -------------------------------------------------- */
Expand Down Expand Up @@ -626,7 +634,6 @@

/* tablenos wrapper */
.tablenos {
/* show scrollbar on tables if necessary to prevent overflow */
width: 100%;
margin: 20px 0;
}
Expand Down

0 comments on commit b5233d9

Please sign in to comment.