diff options
| Commit | 147e2923478959bc3cfa1cae37ada14a3b99fbe4 (patch) | |
|---|---|---|
| Author | 2022-09-29 10:16:47 +0300 | |
| Committer | 2022-09-29 17:40:10 +0300 | |
| Files | af4f366a2c7e509f3ea8826b29b541479137dd2e | |
| syndamia.com-147e2923478959bc3cfa1cae37ada14a3b99fbe4.tar syndamia.com-147e2923478959bc3cfa1cae37ada14a3b99fbe4.tar.gz syndamia.com-147e2923478959bc3cfa1cae37ada14a3b99fbe4.zip | ||
| Parent | 9d3fdda42187fccdbd7cdeadd58ae0d28653c052 (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.awk | 37 |
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] = "&&" nam[i] + } +} + +function substitute(ind) { + gsub(/(<p>|<\/p>)/, "") + gsub(pat[ind], rep[ind]) +} + +/^[ \t]*(<p>|)&&/ { + for (i = 1; i <= length(nam); i++) { + if (index($0, nam[i]) != 0) + substitute(i) + } +} + { - gsub(/&&nos/, "<table class=\"file-list\"><tr>") - gsub(/^<p>&&fos$/, "<details class=\"file-wrapper\"><summary>") - gsub(/^&&fs0$/, "</summary><table class=\"file-list\"><tr>") - gsub(/^&&fs$/, "</tr><tr>") - gsub(/^&&nod<\/p>$/, "</tr></table>") - gsub(/^&&fod<\/p>$/, "</tr></table></details>") print } |