book-summaries/bin/roff2custom.sh
2022-01-05 07:41:37 +01:00

19 lines
409 B
Bash
Executable File

#!/bin/sh
# HOW TO USE
# . ./$0
# cat file | modernize_roff | remove-eol.pl > file.new
modernize_roff() {
sed \
-e "s/^\.PP/.PARAGRAPH_INDENTED/" \
-e "s/^\.NH 1/.SECTION/" \
-e "s/^\.NH 2/.SUBSECTION/" \
-e "s/^\.NH 3/.SUBSUBSECTION/" \
-e "s/^\.NH 4/.SUBSUBSUBSECTION/" \
-e "s/^\.SH [1-4]/.SECTION_NO_NUMBER/" \
-e "s/^\.SH$/.SECTION_NO_NUMBER/" \
-e "s/^\.LP/.PARAGRAPH_UNINDENTED/"
}