1.\" $Id: demandoc.1,v 1.9 2022/03/20 15:41:47 schwarze Exp $ 2.\" 3.\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: March 20 2022 $ 18.Dt DEMANDOC 1 19.Os 20.Sh NAME 21.Nm demandoc 22.Nd emit only text of UNIX manuals 23.Sh SYNOPSIS 24.Nm demandoc 25.Op Fl w 26.Op Ar 27.Sh DESCRIPTION 28The 29.Nm 30utility emits only the text portions of well-formed 31.Xr mdoc 7 32and 33.Xr man 7 34.Ux 35manual files. 36.Pp 37By default, 38.Nm 39parses standard input and outputs only text nodes, preserving line 40and column position. 41Escape sequences are omitted from the output. 42.Pp 43Its arguments are as follows: 44.Bl -tag -width Ds 45.It Fl w 46Output a word list. 47This outputs each word of text on its own line. 48A 49.Qq word , 50in this case, refers to whitespace-delimited terms beginning with at 51least two letters and not consisting of any escape sequences. 52Words have their leading and trailing punctuation 53.Pq double-quotes, sentence punctuation, etc. 54stripped. 55.It Ar 56The input files. 57.El 58.Pp 59If a document is not well-formed, it is skipped. 60.Pp 61The 62.Fl i , 63.Fl k , 64.Fl m , 65and 66.Fl p 67flags are silently discarded for calling compatibility with the 68historical deroff. 69.Sh EXIT STATUS 70The 71.Nm 72utility exits with one of the following values: 73.Pp 74.Bl -tag -width Ds -compact 75.It 0 76No errors occurred. 77.It 6 78An operating system error occurred, for example memory exhaustion or an 79error accessing input files. 80Such errors cause 81.Nm 82to exit at once, possibly in the middle of parsing or formatting a file. 83.El 84.Sh EXAMPLES 85The traditional usage of 86.Nm 87is for spell-checking manuals on 88.Bx . 89This is accomplished as follows (assuming British spelling): 90.Pp 91.Dl $ demandoc -w file.1 | spell -b 92.Sh SEE ALSO 93.Xr mandoc 1 , 94.Xr man 7 , 95.Xr mdoc 7 96.Sh HISTORY 97.Nm 98replaces the historical deroff utility for handling modern 99.Xr man 7 100and 101.Xr mdoc 7 102documents. 103.Sh AUTHORS 104The 105.Nm 106utility was written by 107.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv . 108