From c4540712975055327e69e807d565cba94d7b1606 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Sat, 6 Feb 2021 19:43:44 +0000 Subject: [PATCH] manpp: add support for .EX and .EE code blocks as used by linux manpages with code examples. --- manpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/manpp b/manpp index 1fd716c..684daff 100755 --- a/manpp +++ b/manpp @@ -198,8 +198,16 @@ BEGIN { } } - if(0) ; - else if(current_var) { + if(0) { + } else if($1 == ".EX") { + example_block = 1; + $0 = ".sp\n.RS\n.nf\n\\fB" + } else if(example_block) { + if($1 == ".EE") { + example_block = 0; + $0 = "\\fP\n.fi\n.RE"; + } + } else if(current_var) { #process multiline groff string vars. update_var(current_var, $0) $0 = "" -- 2.11.4.GIT