aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-10-13 18:21:09 +0200
committerbptato <nincsnevem662@gmail.com>2023-10-13 18:21:09 +0200
commit04cbc981edb8edc586d06ce804c24951dd1badd6 (patch)
treef4aa577e29d3ee34d16e85ab20961b94ae8a74f9
parent1cfe1655e1ef6f7ae69b9c87731d571e1ef3ca8c (diff)
downloadchawan-04cbc981edb8edc586d06ce804c24951dd1badd6.tar.gz
slightly refactor md to man preprocessing, update manpage
-rw-r--r--Makefile5
-rw-r--r--doc/cha.17
-rwxr-xr-xmd2manpreproc (renamed from table_rewrite.sh)6
3 files changed, 9 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 85c6ee87..787a789b 100644
--- a/Makefile
+++ b/Makefile
@@ -55,10 +55,7 @@ clean:
rm -f lib/libquickjs.a
$(OBJDIR)/man/cha-%.md: doc/%.md | $(OBJDIR)/man/
- sed -e '/<!-- MANOFF -->/,/<!-- MANON -->/d' \
- -e '/^<!-- MANON$$/d' \
- -e '/^MANOFF -->$$/d' $< | \
- ./table_rewrite.sh > $@
+ ./md2manpreproc $< > $@
$(OBJDIR)/man/cha-%.5: $(OBJDIR)/man/cha-%.md | $(OBJDIR)/man/
pandoc --standalone --to man $< -o $@
diff --git a/doc/cha.1 b/doc/cha.1
index d8de5fc2..008fd884 100644
--- a/doc/cha.1
+++ b/doc/cha.1
@@ -47,7 +47,7 @@ valid TOML.
(The sole exception is quoting: to ease specifying string
parameters, unrecognized bare keywords are converted to strings. So this
-works: \fB--opt\fR \fIabcd.option-name\fR=\fIoption-value\fR. However, symbols must
+works: \fB--opt\fR abcd.option-name=\fIoption-value\fR. However, symbols must
still be quoted.)
.TP
\fB\-c, \-\-css\fR \fIstylesheet\fR
@@ -67,11 +67,11 @@ often, consider changing the default input charset recognition list
.TP
\fB\-O, \-\-output-charset\fR \fIcharset\fR
Override the output character set. This is a shortcut for
-\fB\-o \fIencoding.display\-charset\fR=\fIcharset\fR.
+\fB\-o encoding.display\-charset=\fIcharset\fR.
.TP
\fB\-M, \-\-monochrome\fR
Override the output character set. This is a shortcut for
-\fB\-o \fIdisplay.color\-mode\fR=\fIansi\fR.
+\fB\-o display.color\-mode=\fIansi\fR.
.TP
\fB\-V, \-\-visual\fR
Start in visual mode: the page specified in \fIstart.visual-home\fR is opened.
@@ -124,4 +124,5 @@ Configuration options are described in \fBcha-config\fR(5).
.SH SEE ALSO
\fBcha-mailcap\fR(5), \fBcha-mime.types\fR(5), \fBcha-config\fR(5),
+.br
\fBcha-localcgi\fR(5) \fBcha-urimethodmap\fR(5)
diff --git a/table_rewrite.sh b/md2manpreproc
index dcf51edb..35ce815b 100755
--- a/table_rewrite.sh
+++ b/md2manpreproc
@@ -36,10 +36,12 @@ format_table() {
-e 's/^ *//g;s/ *$//g'
}
+sed -e '/<!-- MANOFF -->/,/<!-- MANON -->/d' \
+ -e '/^<!-- MANON$/d' \
+ -e '/^MANOFF -->$/d' "$@" | \
while read line
do if test "$line" = "<table>"
then format_table
- else
- printf '%s\n' "$line"
+ else printf '%s\n' "$line"
fi
done