From a81dafef9fd78fd446f63b6590b659674508d24e Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 11 Sep 2023 17:10:36 +0300 Subject: (File-type) Removed everything from File-lists, except the file type ftags --- awk-edits/File-lists.awk | 135 ----------------------------------------------- awk-edits/File-type.awk | 95 +++++++++++++++++++++++++++++++++ src/styles.css | 7 ++- 3 files changed, 98 insertions(+), 139 deletions(-) delete mode 100644 awk-edits/File-lists.awk create mode 100644 awk-edits/File-type.awk 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 -- -# -#
-# Folder Info -# -# File Data -#
-#
-# or -# -# File Data -#
- -# -# == 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 , and 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
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
-# Status: 70% complete
-# 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 = "
" repl "
" - sub("&&" name, repl) - fl_rmPar = 1 -} - -/&&folder/ { - flSub("folder", "
") - fl_folder = 1 -} -/&&file/ { - # if inside folder and not the first &&file - if (fl_folder == 2) - flSub("file", "") - - # if inside folder and being the first &&file - else if (fl_folder == 1) { - flSub("file", "") - fl_folder = 2 - } - - # if not inside folder (standalone) - else - flSub("file", "
") -} -/&&/files/ { - # if inside folder - if (fl_folder) { - flSub("/files", "
") - fl_folder = 0 - } - - else - flSub("/files", "") -} -/&&fd/ { - sub(/&&fd[ \t]*/, "") - $0 = $0 "" - fl_rmPar = 1 -} -/&&ft-photo/ { flSub("ft-photo", "\\", 1) } -/&&ft-text/ { flSub("ft-text", "\\", 1) } -/&&ft-zip/ { flSub("ft-zip", "\\", 1) } -/&&ft-movie/ { flSub("ft-movie", "\\", 1) } -/&&ft-markdown/ { flSub("ft-markdown", "\\", 1) } - -/

/ && fl_rmPar { sub(/

/, "") } -/<\/p>/ && fl_rmPar { sub(/<\/p>/, "") ; fl_rmPar = 0 } diff --git a/awk-edits/File-type.awk b/awk-edits/File-type.awk new file mode 100644 index 0000000..6d2a839 --- /dev/null +++ b/awk-edits/File-type.awk @@ -0,0 +1,95 @@ +# +# == 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 -- +# +#

+# Folder Info +# +# File Data +#
+#
+# or +# +# File Data +#
+ +# +# == 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 , and 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
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
+# Status: 70% complete
+# Note: Reserach Van Gogh paintings +# +# &&file +# &&fd Painting 1 +# &&fd 100% Complete +# +# &&file +# &&fd Painting 2 +# &&fd 40% Complete +# +# &&/files + +function flSub(name, repl) { + sub("&&" name, "" repl "") +} + +/&&ft-photo/ { flSub("ft-photo", "\\") } +/&&ft-text/ { flSub("ft-text", "\\") } +/&&ft-zip/ { flSub("ft-zip", "\\") } +/&&ft-movie/ { flSub("ft-movie", "\\") } +/&&ft-markdown/ { flSub("ft-markdown", "\\") } diff --git a/src/styles.css b/src/styles.css index 420cde4..ec60458 100644 --- a/src/styles.css +++ b/src/styles.css @@ -140,8 +140,8 @@ img { .pixelated-render { image-rendering: pixelated; } .oldschool-badge { height: 38px; } .flag { max-width: 1.3em; } /* Compatibility with Chrome 49.0.2623.112 (for old machines) */ - .file-icon { min-width: 1.3em; vertical-align: text-bottom; } - .borderless, .oldschool-badge, .file-icon { border: none; } + .file-type-icon { min-width: 1.3em; vertical-align: middle; } + .borderless, .oldschool-badge, .file-type-icon { border: none; } .btn, .h-anchor { /* Thanks https://stackoverflow.com/a/4407335/12036073 */ @@ -336,7 +336,7 @@ dt, dd { padding: 1rem 1rem; width: 100%; } - #sidebar > :not(:first-child) { margin-top: 1.5rem; } + #sidebar > :not(:first-child) { margin-top: 8px; } #sidebar a { border: none; } #header { @@ -350,7 +350,6 @@ dt, dd { #settingsWrapper { border-top: none; border-bottom: none; - margin: 0.58em 0 1em 0; font-size: 1.2em; line-height: 1em; } -- cgit v1.3.1-26-gb76a