dotfiles

Dotfiles for my OpenBSD environment.
git clone https://git.mtkn.jp/dotfiles
Log | Files | Refs

commit 58818a8b7d9a9bfa267da9720e81895922f614ba
parent eace54b9744533c907fb00ddf633edfa3e639d64
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Wed, 21 Dec 2022 12:08:42 +0900

modify to delete newlines with slash and following
white spaces in src file are to be deleted while rendering

Diffstat:
Mbin/kagero | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bin/kagero b/bin/kagero @@ -1,6 +1,10 @@ #!/bin/sh -e +# kagero: render webpages. +# newlines with slash and following white spaces (tabs and spaces) are to be +# deleted. #TODO: stat(1) is not in POSIX: 7/14 removed stat(1) but not yet tested well. # pathnames should not contain white spaces +# strftime() in awk is not POSIX. #BUG: non html files are not copied after changed its directory. # strftime() for awk is not POSIX compliant @@ -41,7 +45,8 @@ list_files_to_replace(){ render_html(){ title=$(grep '<h1>' "$man/$1" | sed 's;^.*<h1>\(.*\)</h1>.*$;\1;' | sed 's;/;\\/;g') - cat "$header" "$man/$1" "$footer" | + cat "$header" "$man/$1" "$footer" | + sed '/\\$/{:a;N;/\\$/{$!ba;};s/\\\n[ ]*//g;}' | sed 's/<!--title-->/'"$title"'/' }