Summary Files Commits Branches @commit @diff @stats
path: root / awk-edits / File-lists.awk
diff options
context:
space:
mode:
Commita81dafef9fd78fd446f63b6590b659674508d24e (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-09-11 17:10:36 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-09-11 17:22:32 +0300
Filesab593f8d61a6a4dea3bf924ef6e1166784886070 /awk-edits/File-lists.awk
syndamia.com-a81dafef9fd78fd446f63b6590b659674508d24e.tar
syndamia.com-a81dafef9fd78fd446f63b6590b659674508d24e.tar.gz
syndamia.com-a81dafef9fd78fd446f63b6590b659674508d24e.zip
Parent812419f117b2ace7bf1b38c7878eaaf0fba843a2 (diff)
(File-type) Removed everything from File-lists, except the file type ftags
1 files changed, 0 insertions, 135 deletions
-rw-r--r--awk-edits/File-lists.awk135
diff --git a/awk-edits/File-lists.awk b/awk-edits/File-lists.awk
deleted file mode 100644
index b952b55..0000000
--- a/awk-edits/File-lists.awk
+++ /dev/null
@@ -1,135 +0,0 @@
-#
-# == About ==
-#
-# Each file list is a "details" element, that contains a table, each row being a different file
-# or alternatively, just the table on it's own.
-#
-# -- Result HTML --
-#
-# <details>
-# <summary>Folder Info</summary>
-# <table>
-# <tr>File Data</tr>
-# </table>
-# </details>
-# or
-# <table>
-# <tr>File Data</tr>
-# </table>
-
-#
-# == ftags ==
-#
-# &&folder The text right afterwards is the title of the folder. All files
-# are hidden inside the collapsed details tag (click to show).
-# The file table is indented. You cannot have a folder inside a folder.
-# It can be omitted, and the files table will be shown as-is.
-#
-# &&file Everything that follows this tag is the data for a file. You should
-# use &&fd to specify columns of information! Depending on the context,
-# it might be flrepllaced with the start of a table, closing the summary
-# and starting table, or closing and opening a table row.
-#
-# &&/files This tag must exist at the bottom of a file list, no matter if it was
-# started with or without a &&folder.
-#
-# &&fd Defines a column of information for a file (row). Practically, it is
-# flrepllaced with <td>, and </td> is added to the end of the line.
-# If you don't use it, make sure to have the leading and trailing td tags!
-#
-# &&ft-TYPE Depending on TYPE, it inserts an image tag that contains the file "icon"
-# for the corresponding type.
-# Available values for TYPE: photo, text, zip, movie, markdown
-#
-# -- Placement/Flow --
-#
-# All ftags, except &&fd, can be placed on their own line (empty line above and below)
-# or before/after another ftag.
-# Folder title must be inside the same paragraph as the ftag itself. This means that,
-# after
-# every &&folder ftag, the text can continue directly next to it and/or on new lines,
-# without there being any empty lines (you can add those with <br> or two spaces at
-# line end).
-#
-# -- Example Usage --
-#
-# (I like to indent a bit &&fd ftags, for readability's sake, but you don't have to)
-#
-# &&file
-# &&ft-text
-# &&fd Notes
-# &&fd 10 KB
-# &&/files
-#
-# &&folder Math
-# &&file
-# &&ft-text
-# &&fd Homework 1
-# &&file
-# &&ft-text
-# &&fd Homework 2
-# &&/files
-#
-# &&folder Art Project<br>
-# Status: 70% complete<br>
-# Note: Reserach Van Gogh paintings
-#
-# &&file
-# &&fd Painting 1
-# &&fd 100% Complete
-#
-# &&file
-# &&fd Painting 2
-# &&fd 40% Complete
-#
-# &&/files
-
-function flSub(name, repl, isft) {
- if (isft)
- repl = "<td><div class=\"file-icon\">" repl "</div></td>"
- sub("&#38;&#38;" name, repl)
- fl_rmPar = 1
-}
-
-/&#38;&#38;folder/ {
- flSub("folder", "<details class=\"file-wrapper\"><summary>")
- fl_folder = 1
-}
-/&#38;&#38;file/ {
- # if inside folder and not the first &&file
- if (fl_folder == 2)
- flSub("file", "</tr><tr>")
-
- # if inside folder and being the first &&file
- else if (fl_folder == 1) {
- flSub("file", "</summary><table class=\"file-list\"><tr>")
- fl_folder = 2
- }
-
- # if not inside folder (standalone)
- else
- flSub("file", "<table class=\"file-list\"><tr>")
-}
-/&#38;&#38;&#47;files/ {
- # if inside folder
- if (fl_folder) {
- flSub("&#47;files", "</tr></table></details>")
- fl_folder = 0
- }
-
- else
- flSub("&#47;files", "</tr></table>")
-}
-/&#38;&#38;fd/ {
- sub(/&#38;&#38;fd[ \t]*/, "<td>")
- $0 = $0 "</td>"
- fl_rmPar = 1
-}
-/&#38;&#38;ft-photo/ { flSub("ft-photo", "\\&#xeb0a;", 1) }
-/&#38;&#38;ft-text/ { flSub("ft-text", "\\&#xeaa2;", 1) }
-/&#38;&#38;ft-zip/ { flSub("ft-zip", "\\&#xed4e;", 1) }
-/&#38;&#38;ft-movie/ { flSub("ft-movie", "\\&#xeafa;", 1) }
-/&#38;&#38;ft-markdown/ { flSub("ft-markdown", "\\&#xec41;", 1) }
-
-/<p>/ && fl_rmPar { sub(/<p>/, "") }
-/<\/p>/ && fl_rmPar { sub(/<\/p>/, "") ; fl_rmPar = 0 }