Summary Files Commits Branches @commit @diff @stats
path: root / generate-hooks
diff options
context:
space:
mode:
Commit02130d044ad367b97acb3a6d7a47283059521c45 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-01-10 12:18:59 +0200
Committer
 Syndamia <kamen@syndamia.com>
2023-01-10 12:18:59 +0200
Files01bd3e9d296686c585d7edc49c35000ae412ecbd /generate-hooks
syndamia.com-02130d044ad367b97acb3a6d7a47283059521c45.tar
syndamia.com-02130d044ad367b97acb3a6d7a47283059521c45.tar.gz
syndamia.com-02130d044ad367b97acb3a6d7a47283059521c45.zip
Parent561fd2acabaf3e58ac60185a3f53e7c70b823a87 (diff)
[hooks] Added a hook that groups contents header and list, and added custom styling for it to float right
1 files changed, 24 insertions, 0 deletions
-rw-r--r--generate-hooks/group-contents.awk24
diff --git a/generate-hooks/group-contents.awk b/generate-hooks/group-contents.awk
new file mode 100644
index 0000000..f71e93d
--- /dev/null
+++ b/generate-hooks/group-contents.awk
@@ -0,0 +1,24 @@
+#
+# == About ==
+#
+# This script surrounds the "Contents" heading, as well as the list itself, in a div wrapper element
+# For it to work properly, the contents heading must be h2 and have it's id as "contents",
+# and there must be a paragraph element after the item list
+
+BEGIN {
+ started = 0
+}
+
+/h2 id="contents"/ {
+ print "<div id=\"contents-container\">"
+ started = 1
+}
+
+started == 1 && /<p>/ {
+ print "</div>"
+ started = 0
+}
+
+{
+ print
+}