diff options
author | merakor <cem@ckyln.com> | 2021-03-12 13:58:36 +0000 |
---|---|---|
committer | merakor <cem@ckyln.com> | 2021-03-12 13:58:36 +0000 |
commit | fc8de2a8f48485ad8b035a4e76098c4a7dbadb05 (patch) | |
tree | 8334227f749afc03c992f7d17edbf72cb5bd6ba8 /tools | |
parent | f7d3e9f6771a75bff790c569a149f0fee1d28f41 (diff) | |
download | cpt-fc8de2a8f48485ad8b035a4e76098c4a7dbadb05.tar.gz |
docs: update
FossilOrigin-Name: 143ea57c3d8309faf15399199d0e2930f07371a34c08ff16e9a9f5fbb0be6a23
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/tool2man.sh | 13 |
1 files changed, 9 insertions, 4 deletions
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 |