help / color / mirror / Atom feed
From: Jan Stary <hans@stare.cz>
To: discuss@mandoc.bsd.lv
Subject: Re: Mandoc for oil
Date: Fri, 14 Jun 2019 14:03:48 +0200	[thread overview]
Message-ID: <20190614120348.GC77287@www.stare.cz> (raw)
In-Reply-To: <20190614095405.qtqxhqmu5yq6m3ib@BlackBox>

> Jan's reply has all the details you need for the above. But lets suppose
> you wanted to install manpages in the right format.  One solution would
> be to convert the mdoc(7) sources to man(7) - using mandoc -Tman foo.1 -
> when creating a release tarball. Then, in your configure script you can
> check if there is a manpage formatter available that can read mdoc.
> If true, install the mdoc sources, else install the man sources.

For completeness, note that you can even output ascii manpages
(losing all of the markup force of course) with

	mandoc -Tascii page.1

(or -Tpdf or -Thtml) for target systems that don't even have
a manpage formatter (every unix does, though).

> This is what openssh-portable does with their manpages in their
> configure script[4] and Makefile[5]. In your case, you would probably
> just check for mandoc "$(command -v mandoc)" or if {g,n}roff -mdoc
> doesn't throw an error.

Looking at that Makefile, it does

	$(AWK) -f $(srcdir)/mdoc2man.awk

i.e. it translates the mdoc(7) page to a man(7) page with an awk script,
not with mandoc(1). Arguably, awk is everywhere while mandoc isn't;
generally, the output of such script is far from good.
(However, looking at it's output on MacOS's ls.1 as an example,
it passes mandoc -Tlint except STYLE).

> Honestly though, mdoc support is pretty widespread. mandoc and groff are
> the two major manpage formatters used in modern systems today, and both
> fully support rendering mdoc documents.  I'm not sure when groff did,
> but I imagine it was at least a decade ago.

	The mdoc language first appeared as a troff macro package in 4.4BSD.
	It was later significantly updated by Werner Lemberg and Ruslan
	Ermilov in groff-1.17.  The standalone implementation that is part
	of the mandoc(1) utility written by Kristaps Dzonsons appeared in
	OpenBSD 4.6.

4.4BSD was released in 1977.


 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv

      reply	other threads:[~2019-06-14 12:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14  8:16 Matthew Singletary
2019-06-14  8:43 ` Jan Stary
2019-06-14  8:54   ` Jan Stary
2019-06-14  9:24     ` Matthew Singletary
2019-06-14 11:40       ` Jan Stary
2019-06-14 12:29       ` Ingo Schwarze
2019-06-14 13:08         ` Jan Stary
2019-06-14 14:27         ` Jan Stary
2019-06-14 14:54           ` Ingo Schwarze
2019-06-16  2:39             ` Matthew Singletary
2019-06-16 17:08               ` Ingo Schwarze
2019-06-14  9:54 ` Stephen Gregoratto
2019-06-14 12:03   ` Jan Stary [this message]

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:

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

  git send-email \
    --in-reply-to=20190614120348.GC77287@www.stare.cz \
    --to=hans@stare.cz \
    --cc=discuss@mandoc.bsd.lv \


* 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).