Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit147e2923478959bc3cfa1cae37ada14a3b99fbe4 (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-09-29 10:16:47 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-09-29 17:40:10 +0300
Filesaf4f366a2c7e509f3ea8826b29b541479137dd2e
syndamia.com-147e2923478959bc3cfa1cae37ada14a3b99fbe4.tar
syndamia.com-147e2923478959bc3cfa1cae37ada14a3b99fbe4.tar.gz
syndamia.com-147e2923478959bc3cfa1cae37ada14a3b99fbe4.zip
Parent9d3fdda42187fccdbd7cdeadd58ae0d28653c052 (diff)
[hooks/filelists] Made it more flexible and now there can be multiple ftags on a single line
1 files changed, 31 insertions, 6 deletions
-rw-r--r--generate-hooks/create-file-lists.awk37
diff --git a/generate-hooks/create-file-lists.awk b/generate-hooks/create-file-lists.awk
index 4a0f2f6..086d9dd 100644
--- a/generate-hooks/create-file-lists.awk
+++ b/generate-hooks/create-file-lists.awk
@@ -46,12 +46,37 @@
# &&nod no folder end (end file list, without having made a folder)
# &&fod folder end
+BEGIN {
+ nam[1] = "nos"
+ rep[1] = "<table class=\"file-list\"><tr>"
+ nam[2] = "fos"
+ rep[2] = "<details class=\"file-wrapper\"><summary>"
+ nam[3] = "fs0"
+ rep[3] = "</summary><table class=\"file-list\"><tr>"
+ nam[4] = "fs"
+ rep[4] = "</tr><tr>"
+ nam[5] = "nod"
+ rep[5] = "</tr></table>"
+ nam[6] = "fod"
+ rep[6] = "</tr></table></details>"
+
+ for (i = 1; i <= length(nam); i++) {
+ pat[i] = "&#38;&#38;" nam[i]
+ }
+}
+
+function substitute(ind) {
+ gsub(/(<p>|<\/p>)/, "")
+ gsub(pat[ind], rep[ind])
+}
+
+/^[ \t]*(<p>|)&#38;&#38;/ {
+ for (i = 1; i <= length(nam); i++) {
+ if (index($0, nam[i]) != 0)
+ substitute(i)
+ }
+}
+
{
- gsub(/&#38;&#38;nos/, "<table class=\"file-list\"><tr>")
- gsub(/^<p>&#38;&#38;fos$/, "<details class=\"file-wrapper\"><summary>")
- gsub(/^&#38;&#38;fs0$/, "</summary><table class=\"file-list\"><tr>")
- gsub(/^&#38;&#38;fs$/, "</tr><tr>")
- gsub(/^&#38;&#38;nod<\/p>$/, "</tr></table>")
- gsub(/^&#38;&#38;fod<\/p>$/, "</tr></table></details>")
print
}