From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout-kit-02.scc.kit.edu (scc-mailout-kit-02.scc.kit.edu [129.13.231.82]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 378fd0fd for ; Tue, 13 Nov 2018 05:25:41 -0500 (EST) Received: from asta-nat.asta.uni-karlsruhe.de ([172.22.63.82] helo=hekate.usta.de) by scc-mailout-kit-02.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1gMVt6-0006jM-1j; Tue, 13 Nov 2018 11:25:41 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1gMVt5-0000ch-8A; Tue, 13 Nov 2018 11:25:39 +0100 Received: from athene.usta.de ([172.24.96.10]) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1gMVt5-0006HI-33; Tue, 13 Nov 2018 11:25:39 +0100 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id 484adcac; Tue, 13 Nov 2018 11:25:39 +0100 (CET) Date: Tue, 13 Nov 2018 11:25:39 +0100 From: Ingo Schwarze To: Michael Forney Cc: tech@mandoc.bsd.lv, kristaps@bsd.lv Subject: Re: [texi2mdoc] Documents without @node Message-ID: <20181113102539.GE82487@athene.usta.de> References: X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) Hi Michael, Michael Forney wrote on Mon, Nov 12, 2018 at 05:23:14PM -0800: > First, since ffmpeg.texi[0] does not contain a `@node Top` line, I get > an essentially blank (see below) output. I'm not very familiar with > texinfo, but the manual seems to suggest that this is an invalid > document[1]. Should texi2mdoc try to support documents with no top > node by creating one implicitly upon @top? Probably. According to my understanding, tools in Kristaps' tradition attempt to reach two goals at once: have validating parsers and provide diagnostics about syntax and style problems in the input on the one hand, but also "just work" for stuff commonly encountered in practice, on the other hand. Now, i have no idea whether lack of @node Top is a common problem or not, but i wouldn't want to start an investigation, to not spend too much time. Anyway, the consequence of the syntax issue is drastic, so maybe it would even be worthwhile to handle it if it is not all that common. Even though no longer new, texi2mdoc(1) is still experimental to such a degree that i think moving quickly makes sense, even taking the risk of occasional regressions, so i committed right away, see below. @Kristaps: you are more familiar with the code - if you have concerns, just speak up or fix it, whichever causes less work for you. > If not, should it fail with an error message rather than just > producing an empty document? I think so: mandoc(1) also warns about empty documents; but see above and below. Yours, Ingo Log Message: ----------- If "@node Top" is missing, assume the document starts at "@top". For example, this occurs in ffmpeg(1). Issue reported and workaround proposed by Michael Forney . Modified Files: -------------- texi2mdoc: main.c Revision Data ------------- Index: main.c =================================================================== RCS file: /home/cvs/mdocml/texi2mdoc/main.c,v retrieving revision 1.72 retrieving revision 1.73 diff -Lmain.c -Lmain.c -u -p -r1.72 -r1.73 --- main.c +++ main.c @@ -1988,6 +1988,13 @@ dosection(struct texi *p, enum texicmd c switch (cmd) { case (TEXICMD_TOP): sec = 0; + if (p->nodesz) + break; + texiwarn(p, "@node Top is missing, assuming it implicitly"); + p->nodesz++; + p->ign--; + p->nodecur = texicache(p, "Top", 3); + teximdocopen(p, pos); break; case (TEXICMD_APPENDIX): case (TEXICMD_CHAPTER): -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv