summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreudoxia <uplink@distress.network>2021-07-03 04:21:56 -0400
committereudoxia <uplink@distress.network>2021-07-03 04:21:56 -0400
commitdb6a8466df0414b27d857a8d3d995950e51fd7e8 (patch)
tree686628c22b2a86408a2d57feaa393796da3a35e9
parentd2692b2c8d6402e906667d052c6f23df14f38198 (diff)
md.sh: replaced fzf dependency with fzy
-rwxr-xr-xmd.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/md.sh b/md.sh
index c5578f4..90f94c4 100755
--- a/md.sh
+++ b/md.sh
@@ -7,7 +7,7 @@ usage="usage:
# input: <target dir>/src.md ./md-header ./md-footer <site root>/nav.html
# output: <target dir>/index.html
-# dependencies: lowdown fzf ./urlencode
+# dependencies: lowdown, fzy, ./urlencode
# Copyright 2019-2021 DistressNetwork° <uplink@distress.network>
#
@@ -111,7 +111,7 @@ done
toc() {
-[ "$(which fzf)" ] || { printf "[warn] \tfzf not found, skipping toc\n" ; return ; }
+[ "$(which fzy)" ] || { printf "[warn] \tfzy not found, skipping toc\n" ; return ; }
[ -f ./urlencode ] || { printf "[warn] \turlencode not found, skipping toc\n" ; return ; }
tmp=$(mktemp -p /tmp) # using a tempfile, more convenient for storage and operations
@@ -134,7 +134,7 @@ cat $tmp | while IFS='' read -r data ; do
sed -e "s;^<li>\(${ID}\);<li><a href=\"#\1\">${HEADER};" -e "s;\([[:alnum:]]\)</li>$;\1</a></li>;" -i'' $tmp ;
# find old id in output, replace with new id
- IDLINE=$(grep -ne "^<h[[:digit:]] id=" $OUT | fzf -f "$(echo $HEADER | unesc)" | head -n 1 | cut -f 1 -d :) ;
+ IDLINE=$(grep -ne "^<h[[:digit:]] id=" $OUT | fzy -e "$(echo $HEADER | unesc)" | head -n 1 | cut -f 1 -d :) ;
if [ "$IDLINE" ] ; then
sed "${IDLINE}s;id=\".*\">.*</h;id=\"${ID}\">${HEADER}</h;" -i'' $OUT ;
printf "\tassembled header: %s\n" "$(echo $HEADER | unesc)" ;