]> git.plutz.net Git - shellwiki/commitdiff
introduce css pragma as separate handler
authorPaul Hänsch <paul@plutz.net>
Thu, 18 May 2023 10:59:03 +0000 (12:59 +0200)
committerPaul Hänsch <paul@plutz.net>
Thu, 18 May 2023 10:59:03 +0000 (12:59 +0200)
css.sh [deleted file]

diff --git a/css.sh b/css.sh
deleted file mode 100755 (executable)
index f640905..0000000
--- a/css.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-[ "$include_css" ] && return 0
-include_css="$0"
-
-css(){
-  local path="${1:-${PATH_INFO}}"
-  local pagefile css=''
-  # Get directory part of PATH_INFO
-  path="${path%/*}/./"
-
-  while :; do
-    [ "$path" = / ] && break
-    path="${path%/*/}/"
-
-    if   [ -f "$_DATA/pages/$path/#page.md" ]; then
-      pagefile="$_DATA/pages/$path/#page.md"
-    elif [ -f "$_EXEC/pages/$path/#page.md" ]; then
-      pagefile="$_EXEC/pages/$path/#page.md"
-    else
-      continue
-    fi
-
-    css="$(sed -En '
-      s;\r$;;;
-      /^%css([\t ]+.*)?$/bCSS;
-      20q;
-      b;
-
-      :CSS
-      s;(%(css)?)?[\t ]*;;
-      p; n; s;\r$;;;
-      /^(%[ \t]+|%css[ \t]+|[ \t]+)[^ \t\r]+$/bCSS;
-      /^(%[ \t]*|%css[ \t]*)$/bCSS;
-    ' <"$pagefile")${BR}${css}"
-  done
-
-  printf %s\\n "${css}"
-}