-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacros.js
More file actions
23 lines (20 loc) · 735 Bytes
/
macros.js
File metadata and controls
23 lines (20 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function quote(input) {
return `<div class="quote">${input}</div>`;
}
function split(input) {
return `<div style="display: flex; gap: 1rem;">${input}</div>`;
}
function details(input, args) {
console.log("Details macro", args);
return `
<details style="margin-left: 1rem;">
<summary style="font-weight: bold; cursor: pointer;">${args[0]}</summary>
<div style="margin-left: 1rem;">${input}</div>
</details>
`;
}
function scaleDiv(nablaImg, args) {
const [scalePercentage, heightPercentage] = args;
return `<div style="width:${scalePercentage}%; height: ${heightPercentage ?? 100}%; margin-left: auto; margin-right: auto;">${nablaImg}</div>`;
}
MACROS = { quote, split, details, scaleDiv };