summaryrefslogtreecommitdiff
path: root/md.sh
diff options
context:
space:
mode:
Diffstat (limited to 'md.sh')
-rwxr-xr-xmd.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/md.sh b/md.sh
index 86de05b..8ba076f 100755
--- a/md.sh
+++ b/md.sh
@@ -85,6 +85,7 @@ printf "[ok] \tmeta description\n"
if [ -f $(echo $IN | cut -f 1 -d /)/nav.html ] ; then
NAVLINE=$(grep -n '<nav>' $OUT | cut -f 1 -d :) ;
sed "${NAVLINE}r $(echo $OUT | cut -f 1 -d /)/nav.html" -i'' $OUT ;
+sed '/^<!--title:/d' -i'' $OUT ;
printf "[ok] \tsitemap\n" ;
fi
@@ -135,7 +136,7 @@ cat $tmp | while IFS='' read -r data ; do
# 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 :) ;
if [ "$IDLINE" ] ; then
- sed -e "${IDLINE}s;id=\".*\">.*</h;id=\"${ID}\">${HEADER}</h;" -i'' $OUT ;
+ sed "${IDLINE}s;id=\".*\">.*</h;id=\"${ID}\">${HEADER}</h;" -i'' $OUT ;
printf "\tassembled header: %s\n" "$(echo $HEADER | unesc)" ;
fi ;
done
@@ -147,7 +148,7 @@ echo '</nav>' >> $tmp
# get toc line number in output, insert data from tempfile
-TOCLINE=$(grep -n 'end of header' $OUT | cut -f 1 -d :)
+TOCLINE=$(grep -n '<!-- end of header -->' $OUT | cut -f 1 -d :)
sed "${TOCLINE}r $tmp" -i'' $OUT
rm $tmp # cleanup