bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 09/12] man pages: Use tagged paragraphs idiomatically.


From: G. Branden Robinson
Subject: [PATCH 09/12] man pages: Use tagged paragraphs idiomatically.
Date: Thu, 14 Sep 2023 07:49:30 -0500

...not subsectioning macros to fake them!  I guess this was done because
someone didn't understand that `TP` paragraph tags can include macro
calls.  `TP` is more flexible, especially when combined with `RS` and
`RE`.
---
 man/form_field_validation.3x | 26 +++++++++++++++-----------
 man/form_variables.3x        | 18 ++++++++++++------
 man/resizeterm.3x            |  9 ++++++---
 3 files changed, 33 insertions(+), 20 deletions(-)

diff --git a/man/form_field_validation.3x b/man/form_field_validation.3x
index f46abec9..27c78824 100644
--- a/man/form_field_validation.3x
+++ b/man/form_field_validation.3x
@@ -67,14 +67,17 @@ .SH DESCRIPTION
 By default, no validation is done on form fields.
 You can associate a form with with a \fIfield type\fP,
 making the form library validate input.
-.SS field_arg
+.TP
+.B field_arg
 Returns a pointer to the field's argument block.
 The \fIargument block\fP is an opaque structure containing
 a copy of the arguments provided in a \fBset_field_type\fP call.
-.SS field_type
+.TP
+.B field_type
 Returns a pointer to the \fIfield type\fP associated with the form field,
 i.e., by calling \fBset_field_type\fP.
-.SS set_field_type
+.TP
+.B set_field_type
 The function \fBset_field_type\fP associates
 a field type with a given form field.
 This is the type checked by validation functions.
@@ -82,7 +85,8 @@ .SS set_field_type
 via arguments which the caller provides when calling \fBset_field_type\fP.
 .PP
 Several field types are predefined by the form library.
-.SS Predefined types
+.TP
+.B Predefined types
 It is possible to set up new programmer-defined field types.
 Field types are implemented via the \fBFIELDTYPE\fP data
 structure, which contains several pointers to functions.
@@ -93,7 +97,7 @@ .SS Predefined types
 .PP
 The predefined types are as follows:
 .TP 5
-TYPE_ALNUM
+.B TYPE_ALNUM
 Alphanumeric data.
 Required parameter:
 .RS
@@ -101,7 +105,7 @@ .SS Predefined types
 a third \fBint\fP argument, a minimum field width.
 .RE
 .TP 5
-TYPE_ALPHA
+.B TYPE_ALPHA
 Character data.
 Required parameter:
 .RS
@@ -109,7 +113,7 @@ .SS Predefined types
 a third \fBint\fP argument, a minimum field width.
 .RE
 .TP 5
-TYPE_ENUM
+.B TYPE_ENUM
 Accept one of a specified set of strings.
 Required parameters:
 .RS
@@ -127,7 +131,7 @@ .SS Predefined types
 The library copies the string list,
 so you may use a list that lives in automatic variables on the stack.
 .TP 5
-TYPE_INTEGER
+.B TYPE_INTEGER
 Integer data, parsable to an integer by \fBatoi\fP(3).
 Required parameters:
 .RS
@@ -147,7 +151,7 @@ .SS Predefined types
 .IP
 For details of the precision handling see \fBprintf\fP(3).
 .TP 5
-TYPE_NUMERIC
+.B TYPE_NUMERIC
 Numeric data (may have a decimal-point part).
 Required parameters:
 .RS
@@ -169,7 +173,7 @@ .SS Predefined types
 .IP
 For details of the precision handling see \fBprintf\fP(3).
 .TP 5
-TYPE_REGEXP
+.B TYPE_REGEXP
 Regular expression data.
 Required parameter:
 .RS
@@ -191,7 +195,7 @@ .SS Predefined types
 or "^ *[0\-9]* *$" which is good for
 leading and trailing spaces around the digits.
 .TP 5
-TYPE_IPV4
+.B TYPE_IPV4
 An Internet Protocol Version 4 address.
 Required parameter:
 .RS
diff --git a/man/form_variables.3x b/man/form_variables.3x
index 1f97fef4..8845c4e0 100644
--- a/man/form_variables.3x
+++ b/man/form_variables.3x
@@ -60,17 +60,23 @@ .SH DESCRIPTION
 the \fBform_fieldtype\fP(3X) functions.
 Each provides functions for field- and character-validation,
 according to the given datatype.
-.SS TYPE_ALNUM
+.TP
+TYPE_ALNUM
 This holds alphanumeric data.
-.SS TYPE_ALPHA
+.TP
+TYPE_ALPHA
 This holds alphabetic data.
-.SS TYPE_ENUM
+.TP
+TYPE_ENUM
 This holds an enumerated type.
-.SS TYPE_INTEGER
+.TP
+TYPE_INTEGER
 This holds a decimal integer.
-.SS TYPE_IPV4
+.TP
+TYPE_IPV4
 This holds an IPv4 internet address, e.g., "127.0.0.1".
-.SS TYPE_NUMERIC
+.TP
+TYPE_NUMERIC
 This holds a decimal number, with optional sign and decimal point.
 .SS TYPE_REGEXP
 This holds a regular expression.
diff --git a/man/resizeterm.3x b/man/resizeterm.3x
index 3830c92e..cca67d86 100644
--- a/man/resizeterm.3x
+++ b/man/resizeterm.3x
@@ -82,13 +82,15 @@ .SH DESCRIPTION
 can call \fBresizeterm\fP, but in that case, the library will not
 see \fBSIGWINCH\fP, and proper layout will rely upon the application.
 .SH FUNCTIONS
-.SS resizeterm
+.TP
+.B resizeterm
 The function \fBresizeterm\fP resizes the standard and current windows
 (i.e., \fBstdscr\fP and \fBcurscr\fP)
 to the specified dimensions, and adjusts other bookkeeping data used by
 the \fBncurses\fP library that record the window dimensions
 such as the \fBLINES\fP and \fBCOLS\fP variables.
-.SS resize_term
+.TP
+.B resize_term
 Most of the work for \fBresizeterm\fP is
 done by the inner function \fBresize_term\fP.
 The outer function \fBresizeterm\fP adds bookkeeping
@@ -112,7 +114,8 @@ .SS resize_term
 then on resizing the window, \fBresize_term\fP will keep the window
 extending to the corresponding limit, regardless of whether the
 screen has shrunk or grown.
-.SS is_term_resized
+.TP
+.B is_term_resized
 A support function \fBis_term_resized\fP is provided so that applications
 can check if the \fBresize_term\fP function would modify the window structures.
 It returns \fBTRUE\fP if the windows would be modified,
-- 
2.30.2

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]