From 02130d044ad367b97acb3a6d7a47283059521c45 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 10 Jan 2023 12:18:59 +0200 Subject: [hooks] Added a hook that groups contents header and list, and added custom styling for it to float right --- generate-hooks/group-contents.awk | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 generate-hooks/group-contents.awk (limited to 'generate-hooks') 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 "
" + started = 1 +} + +started == 1 && /

/ { + print "

" + started = 0 +} + +{ + print +} -- cgit v1.3.1-26-gb76a