Fix md2point title and filename generation.
This commit is contained in:
parent
c9cabf1139
commit
59ccbc5ce8
11
bin/md2point
11
bin/md2point
@ -1,10 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
|
||||||
# See LICENSE for license details.
|
# colors
|
||||||
#
|
reset="$(tput sgr0)"
|
||||||
|
quoteformat="$(tput setaf 6)"
|
||||||
|
|
||||||
mkfilename() {
|
mkfilename() {
|
||||||
printf "%.4d-%s" "$1" "$2" | tr '# :.' '_'
|
printf "%.4d-%s" "$1" "$2" | tr '# :.()/' '_'
|
||||||
printf ".txt"
|
printf ".txt"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,7 +31,7 @@ do
|
|||||||
fname="$(mkfilename "$snum" "$title")"
|
fname="$(mkfilename "$snum" "$title")"
|
||||||
snum=$((snum + 1))
|
snum=$((snum + 1))
|
||||||
printf "\n %s\n %s\n\n" \
|
printf "\n %s\n %s\n\n" \
|
||||||
"$title" "$(mkunderline $titlelen "=")" > $fname
|
"$title" "$(mkunderline $titlelen "=")" >> $fname
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
[ -n "$fname" ] && \
|
[ -n "$fname" ] && \
|
||||||
|
Loading…
Reference in New Issue
Block a user