summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Letan <lthms@soap.coffee>2023-01-14 16:55:14 +0100
committerThomas Letan <lthms@soap.coffee>2023-01-14 16:55:14 +0100
commitcc17ae7dec8bcee2c3c82bd9ad497e683451f699 (patch)
treec83fd7484b4ecfaa05846221ecdaa4fdfa68f03b
parentMonthly retrospective: October and November 2022 (diff)
Move side and margin notes around
-rw-r--r--plugins/notes.lua24
-rw-r--r--soupault.conf3
-rw-r--r--style.css4
3 files changed, 29 insertions, 2 deletions
diff --git a/plugins/notes.lua b/plugins/notes.lua
new file mode 100644
index 0000000..bfaa3e2
--- /dev/null
+++ b/plugins/notes.lua
@@ -0,0 +1,24 @@
+notes = HTML.select_all_of(page, {".marginnote", ".sidenote"})
+
+local index = 1
+while notes[index] do
+ local note = notes[index]
+
+ HTML.add_class(note, "note")
+
+ index = index + 1
+end
+
+notes = HTML.select(page, ".note")
+index = 1
+while notes[index] do
+ local note = notes[index]
+
+ if index % 2 == 0 then
+ HTML.add_class(note, "note-right")
+ else
+ HTML.add_class(note, "note-left")
+ end
+
+ index = index + 1
+end \ No newline at end of file
diff --git a/soupault.conf b/soupault.conf
index 0601acd..eddc21d 100644
--- a/soupault.conf
+++ b/soupault.conf
@@ -95,3 +95,6 @@ widget = "css"
[widgets.clean-up]
widget = "clean-up"
+
+[widgets.notes]
+widget = "notes" \ No newline at end of file
diff --git a/style.css b/style.css
index 4a3e22c..96e4596 100644
--- a/style.css
+++ b/style.css
@@ -137,13 +137,13 @@ dd {
width: var(--margin-width);
}
-.sidenote {
+.note-right {
margin-right: calc(-1 * (var(--margin-width) + var(--gutter-width)));
float: right;
clear: right;
}
-.marginnote {
+.note-left {
float: left;
clear: left;
margin-left: calc(-1 * (var(--margin-width) + var(--gutter-width)));