From ec96c38d56e89a1c0dfed7b9a0fc436d19d67f2b Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 26 Sep 2015 12:56:04 +0000 Subject: briefly document -T tree output --- mandoc.1 | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/mandoc.1 b/mandoc.1 index 477b8c95..ea095d4c 100644 --- a/mandoc.1 +++ b/mandoc.1 @@ -284,6 +284,8 @@ See .Sx PostScript Output . .It Fl T Cm tree Produce an indented parse tree. +See +.Sx Syntax tree output . .It Fl T Cm utf8 Encode output in the UTF\-8 multi-byte format. See @@ -490,6 +492,44 @@ to force a UTF\-8 locale. See .Sx Locale Output for details and options. +.Ss Syntax tree output +Use +.Fl T Cm tree +to show a human readable representation of the syntax tree. +It is useful for debugging the source code of manual pages. +The exact format is subject to change, don't write parsers for it. +Each output line shows one syntax tree node. +Child nodes are indented with respect to their parent node. +The columns are: +.Pp +.Bl -enum -compact +.It +For macro nodes, the macro name; for text and +.Xr tbl 7 +nodes, the content. There is a special format for +.Xr eqn 7 +nodes. +.It +Node type (text, elem, block, head, body, body-end, tail, tbl, eqn). +.It +Flags: +.Bl -dash -compact +.It +An opening parenthesis if the node is an opening delimiter. +.It +An asterisk if the node starts a new input line. +.It +The input line number (starting at one). +.It +A colon. +.It +The input column number (starting at one). +.It +A closing parenthesis if the node is a closing delimiter. +.It +A full stop if the node ends a sentence. +.El +.El .Sh ENVIRONMENT .Bl -tag -width MANPAGER .It Ev MANPAGER -- cgit