From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from wonkity.com (wonkity.com [67.158.26.137]); by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 7cbb1054; for ; Tue, 7 Jul 2015 17:22:54 -0500 (EST) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.9/8.14.9) with ESMTP id t67MMrtQ073771 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 7 Jul 2015 16:22:53 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.9/8.14.9/Submit) with ESMTP id t67MMn3G073766 for ; Tue, 7 Jul 2015 16:22:53 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Tue, 7 Jul 2015 16:22:49 -0600 (MDT) From: Warren Block To: discuss@mdocml.bsd.lv Subject: Re: Identifying doc formats In-Reply-To: <15279.1436290257@CATHET.us> Message-ID: References: <15279.1436290257@CATHET.us> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) X-Mailinglist: mdocml-discuss Reply-To: discuss@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Tue, 07 Jul 2015 16:22:53 -0600 (MDT) On Tue, 7 Jul 2015, Anthony J. Bentley wrote: > Warren Block writes: >> Can mandoc just detect and display the input format? >> >> file(1) says both tcpdump.1 and ls.1 in FreeBSD are "troff or >> preprocessor input, ASCII text", although one is man and the other is >> mdoc. > > Yes, in -mandoc mode it is automatically detected; see mandoc(1): > > A third option, -mandoc, which is also the default, determines encoding > on-the-fly: if the first non-comment macro is ?Dd? or ?Dt?, the mdoc(7) > parser is used; otherwise, the man(7) parser is used. Right, but that is not the goal. What I'm saying is that file(1) does not tell whether a man page is mdoc or man format. mandoc knows, but can it show just the detected format name rather than parsing and displaying the man page? That would also be a nice addition to file(1). >> In a related note, the mandoc man page is a bit confusing about the >> input format option. The synopsis says that input formats are >> >> [-mformat] >> >> That implies--to me, at least--that it would be used as >> >> -mmdoc >> >> or >> >> -mman >> >> But... >> >> % mandoc -mman tcpdump.1 >> man: Bad argument >> % mandoc -man tcpdump.1 >> (works) >> >> This seems to imply that the input formats could really be "doc", "an", >> and "andoc", and that's obviously not right. > > This is exactly the case. Troff macro sets are specified to troff via the > -m option. For example, if you look at a groff installation, the following > files are used: > > /usr/local/share/groff/1.22.3/tmac/an.tmac > /usr/local/share/groff/1.22.3/tmac/andoc.tmac > /usr/local/share/groff/1.22.3/tmac/doc.tmac That's... well, okay, I believe it. But that is not how those input formats are shown in the mandoc man page currently. And I agree with that, showing "-m(doc|an|andoc)" might be how the program does it internally, but does not help make them mnemonic for the user. -- To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv