From 59e3915e5ca57b7a1be87a01f909929d554d6626 Mon Sep 17 00:00:00 2001 From: Guangyuan Yang Date: Sat, 28 Nov 2020 06:38:37 +0000 Subject: Add a Testing section for manpages in the FDP Primer. Move the relative information from the Tip section about testing manpages to the new section, along with information about mandoc(1)'s linter, igor, etc. It now covers quite a few cases and common mistakes. Submitted by: fernape Reviewed by: debdrup, ygy Differential Revision: https://reviews.freebsd.org/D27386 --- .../books/fdp-primer/manpages/chapter.xml | 58 ++++++++++++++++------ 1 file changed, 43 insertions(+), 15 deletions(-) (limited to 'en_US.ISO8859-1/books') diff --git a/en_US.ISO8859-1/books/fdp-primer/manpages/chapter.xml b/en_US.ISO8859-1/books/fdp-primer/manpages/chapter.xml index e866470d81..44cf03be22 100644 --- a/en_US.ISO8859-1/books/fdp-primer/manpages/chapter.xml +++ b/en_US.ISO8859-1/books/fdp-primer/manpages/chapter.xml @@ -115,21 +115,6 @@ including PostScript for printing or PDF generation. See &man.man.1;. - - Testing a new manual page can be challenging when it is - not located in the normal manual page search path. - &man.man.1; also does not look in the current directory. If - the new manual page is in the current directory, prefix - the filename with a ./: - - &prompt.user; man ./mynewmanpage.8 - - An absolute path can also be used: - - &prompt.user; man /home/xsmith/mynewmanpage.8 - - - Manual Page Sections @@ -645,6 +630,49 @@ is an example configuration file. + + Testing + + Testing a new manual page can be challenging. Fortunately + there are some tools that can assist in the task. Some of them, + like &man.man.1;, do not look in the current directory. It is a + good idea to prefix the filename with ./ if + the new manual page is in the current directory. An absolute + path can also be used. + Use &man.mandoc.1;'s linter to check for parsing + errors: + + &prompt.user; mandoc -T lint ./mynewmanpage.8 + + Use textproc/igor to proofread the + manual page: + + &prompt.user; igor ./mynewmanpage.8 + + Use &man.man.1; to check the final result of your + changes: + + &prompt.user; man ./mynewmanpage.8 + + You can use &man.col.1; to filter the output of + &man.man.1; and get rid of the backspaces characters before + loading the result in your favorite editor for + spell checking: + + &prompt.user; man ./mynewmanpage.8 | col -b | vim -R - + + Spell-checking with fully-featured dictionaries is + encouraged, and can be accomplished by using + textproc/hunspell or + textproc/aspell combined with + textproc/en-hunspell or + textproc/en-aspell, respectively. + For instance: + + &prompt.user; aspell check --lang=en --mode=nroff ./mynewmanpage.8 + + + Example Manual Pages to Use as Templates -- cgit v1.2.3