Summary Files Commits Branches @commit @diff @stats
path: root / awk-edits / Group-contents.awk
diff options
context:
space:
mode:
Commit0187e255a811bebb0dad3624f2c6d78b829d15c5 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-01-17 16:15:28 +0200
Committer
 Syndamia <kamen@syndamia.com>
2023-01-17 16:15:28 +0200
Files68efd3520e72c8c8c553fdda7b9391d9ec4e9feb /awk-edits/Group-contents.awk
syndamia.com-0187e255a811bebb0dad3624f2c6d78b829d15c5.tar
syndamia.com-0187e255a811bebb0dad3624f2c6d78b829d15c5.tar.gz
syndamia.com-0187e255a811bebb0dad3624f2c6d78b829d15c5.zip
Parentda000c477625bb533688df84bd95ba3a3aff3246 (diff)
[awk] Reworked generation to happen via a combined script, updated scripts and added info in scripts readme
1 files changed, 20 insertions, 0 deletions
-rw-r--r--awk-edits/Group-contents.awk20
diff --git a/awk-edits/Group-contents.awk b/awk-edits/Group-contents.awk
new file mode 100644
index 0000000..d984eef
--- /dev/null
+++ b/awk-edits/Group-contents.awk
@@ -0,0 +1,20 @@
+#
+# == 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
+}