From fc8de2a8f48485ad8b035a4e76098c4a7dbadb05 Mon Sep 17 00:00:00 2001 From: merakor Date: Fri, 12 Mar 2021 13:58:36 +0000 Subject: docs: update FossilOrigin-Name: 143ea57c3d8309faf15399199d0e2930f07371a34c08ff16e9a9f5fbb0be6a23 --- tools/tool2man.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/tool2man.sh b/tools/tool2man.sh index 9111243..38cdbf4 100755 --- a/tools/tool2man.sh +++ b/tools/tool2man.sh @@ -8,7 +8,10 @@ # Syntax: # Every line starts with two hashes and a space ('## '). If the line ends with a # colon (':'), it is assumed to be a section header. Subsections follow the same -# convention, but uses three hashes instead of two. An empty '## ' line will +# convention, but uses three hashes instead of two. If the line ends with two +# colons ('::'), the last colon will be removed. +# +# An empty '## ' line will # start a new paragraph (.Pp). Otherwise, mdoc(7) syntax is used as is. # Headers are generated using the script's name, and the docstring is used from # the line following the shebang. @@ -40,6 +43,10 @@ out \ while read -r line; do case $line in + '##'*::) + line=${line%:} line=${line#'##'} line=${line#'#'} line=${line#' '} + out "$line" + ;; '###'*:) line=${line%:} out ".Ss ${line#'### '}" @@ -56,9 +63,7 @@ while read -r line; do out ".Pp" ;; '##'*) - line=${line#'##'} - line=${line#'#'} - line=${line# } + line=${line#'##'} line=${line#'#'} line=${line# } out "$line" ;; esac -- cgit v1.2.3