From 521af751f3ce676ce1b75978eae7d7705e380b50 Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 28 Nov 2023 17:00:28 -0500 Subject: [PATCH] more issue #1153 Some changes to achieve the following MAN2TXT commands... If groff version is 1.23 or greater: nroff -man -Tascii -P -cbou If groff version is less than 1.23: nroff -man -Tascii -c | col -b If non-groff nroff: nroff -man | col -b Closes #1153 again. --- sys/unix/Makefile.doc | 9 ++++++--- sys/unix/hints/include/misc.370 | 10 ++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/sys/unix/Makefile.doc b/sys/unix/Makefile.doc index d43acfcdf..5beb3f9a0 100644 --- a/sys/unix/Makefile.doc +++ b/sys/unix/Makefile.doc @@ -115,11 +115,14 @@ Guidebook.dat : Gbk-1pg-pfx.mn Gbk-1pg-sfx.mn $(GUIDEBOOK_MN) tmac.n tmac.nh \ $(ONEPAGECMD) > $@ # plain text output -# MORE_MAN2TXT_FLAGS is included so that a hints file can alter the options -MAN2TXT = $(NHGREP) | nroff -man $(MORE_MAN2TXT_FLAGS) +# +# MAN2TXTPRE and MAN2TXTPOST are included so that a hints file can alter +# both of them as required +MAN2TXTPOST ?= | col -b +MAN2TXT = $(NHGREP) | nroff -man $(MAN2TXTPRE) $(MAN2TXTPOST) # If you aren't using a hints file, you can uncomment the following # line if you have groff 1.23 or greater. -#MAN2TXT = $(NHGREP) | nroff -man -Tascii -P -cbou +#MAN2TXT = $(NHGREP) | groff -man -Tascii -P -cbou nethack.txt : nethack.6 cat nethack.6 | $(MAN2TXT) > nethack.txt recover.txt : recover.6 diff --git a/sys/unix/hints/include/misc.370 b/sys/unix/hints/include/misc.370 index 973473444..1fc313a8a 100644 --- a/sys/unix/hints/include/misc.370 +++ b/sys/unix/hints/include/misc.370 @@ -75,14 +75,16 @@ endif # NROFFISGROFF ifneq "$(NROFFISGROFF)" "" # It's groff # add the -Tascii flag used by groff -MORE_MAN2TXT_FLAGS += -Tascii +MAN2TXTPRE += -Tascii ifneq "$(GROFFGE123)" "" # It's groff 1.23 or greater #$(info GROFFGE123=$(GROFFGE123)) # add the groff 1.23 specific plain text flag -P -MORE_MAN2TXT_FLAGS += -P +MAN2TXTPRE += -P -cbou +MAN2TXTPOST= +else +MAN2TXTPRE += -c +# groff less than 1.23 endif -# add more plain text flags used by groff -MORE_MAN2TXT_FLAGS += -cbou endif # end groff-specific #end of hints/include/misc.370