discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: "Anthony J. Bentley" <anthony@anjbe.name>
To: discuss@mdocml.bsd.lv
Subject: Re: Identifying doc formats
Date: Tue, 07 Jul 2015 11:30:57 -0600	[thread overview]
Message-ID: <15279.1436290257@CATHET.us> (raw)
In-Reply-To: <alpine.BSF.2.20.1507071100420.91939@wonkity.com>

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.

> 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

-- 
Anthony J. Bentley
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

  reply	other threads:[~2015-07-07 17:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-07 17:23 Warren Block
2015-07-07 17:30 ` Anthony J. Bentley [this message]
2015-07-07 22:22   ` Warren Block

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15279.1436290257@CATHET.us \
    --to=anthony@anjbe.name \
    --cc=discuss@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).