Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit625c998619eeb8d95a4693bd9eb947a16e7367ba (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-11-17 15:39:47 +0200
Committer
 Syndamia <kamen@syndamia.com>
2023-11-17 15:39:47 +0200
Filesedb4ee4f0308b1ba490db42354057de8f5d3bb34
syndamia.com-625c998619eeb8d95a4693bd9eb947a16e7367ba.tar
syndamia.com-625c998619eeb8d95a4693bd9eb947a16e7367ba.tar.gz
syndamia.com-625c998619eeb8d95a4693bd9eb947a16e7367ba.zip
Parentd45b8f18e16047cebd102434837d667ce2d6bb82 (diff)
[styles,Heading-anchors] Removed gap above contents
2 files changed, 6 insertions, 4 deletions
-rw-r--r--awk-edits/Heading-anchors.awk8
-rw-r--r--src/styles.css2
diff --git a/awk-edits/Heading-anchors.awk b/awk-edits/Heading-anchors.awk
index ee69043..10f4aa9 100644
--- a/awk-edits/Heading-anchors.awk
+++ b/awk-edits/Heading-anchors.awk
@@ -7,8 +7,10 @@
# hyperlink is required (except for h1).
/[ \t]*<h[23456]/ {
- match($0, /<h./)
- headerLevel = (substr($0, RSTART + 2, 1) == 2) ? "" : "-small"
+ if (match($0, /<h2 id="contents"/) == 0) {
+ match($0, /<h./)
+ gap = "<div class=\"gap" ((substr($0, RSTART + 2, 1) == 2) ? "" : "-small") "\"></div>" ORS
+ }
match($0, /id="[^"]*"/)
- $0 = "<div class=\"gap" headerLevel "\"></div>" ORS $0 ORS "<a class=\"h-anchor\" href=\"#" substr($0, RSTART + 4, RLENGTH - 5) "\" aria-hidden=\"true\">&#x00A7;</a>"
+ $0 = gap $0 ORS "<a class=\"h-anchor\" href=\"#" substr($0, RSTART + 4, RLENGTH - 5) "\" aria-hidden=\"true\">&#x00A7;</a>"
}
diff --git a/src/styles.css b/src/styles.css
index 6d22681..c12deda 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -401,7 +401,7 @@ dt, dd {
margin-left: auto;
margin-right: auto;
}
- #contents-container { float: right; margin-left: 2.5em; }
+ #contents-container { float: right; margin-left: 2.5em; background-color: var(--bg-color); padding-right: 0.5em; }
#contents-container > h2 { margin-top: -1rem; }
#pagenav {
filter: opacity(64%);