From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx.stare.cz (mx.stare.cz [79.98.77.229]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id f78fa808 for ; Fri, 14 Jun 2019 07:03:49 -0500 (EST) Received: from www.stare.cz (localhost [127.0.0.1]) by www.stare.cz (OpenSMTPD) with ESMTP id 7cde0129 for ; Fri, 14 Jun 2019 14:03:48 +0200 (CEST) Date: Fri, 14 Jun 2019 14:03:48 +0200 From: Jan Stary To: discuss@mandoc.bsd.lv Subject: Re: Mandoc for oil Message-ID: <20190614120348.GC77287@www.stare.cz> References: <20190614095405.qtqxhqmu5yq6m3ib@BlackBox> X-Mailinglist: mandoc-discuss Reply-To: discuss@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190614095405.qtqxhqmu5yq6m3ib@BlackBox> User-Agent: Mutt/1.7.1 (2016-10-04) > 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. HISTORY 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. Jan -- To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv