From: G. B. R. <g.b...@gm...> - 2023-08-12 04:54:17
Attachments:
signature.asc
|
Hi everybody, I just subscribed to this list. I work on groff and would like to help improve rst2man's output. On 2023-08-10 12:32:39, Dmitry Shachnev wrote: > On Thu, Aug 10, 2023 at 10:41:03AM -0000, Guenter Milde via > Docutils-develop wrote: > > On 2023-08-09, Dmitry Shachnev wrote: > > > On Tue, Aug 08, 2023 at 07:58:28AM -0000, Guenter Milde via > > > Docutils-develop wrote: > > > > >> > Another possibility would be using the `.UR` / `.UE` macros to > > >> > produce hyperlinks. They are described in groff_man(7) man > > >> > page. > > ... > > >> How would this be handled by other (t)roff converters? > > > > > What other implementations do we want to support? > > > > I remember discussions about the BSD versions but don't remember the > > outcome. Engelbert is our specialist for the man writer. > > FreeBSD's and OpenBSD's man(7) mention the .UR / .UE macros: > > UR Begin a uniform resource identifier block. This is a > non-standard GNU extension. It has the following syntax: > > .UR uri > link description to be shown > .UE This page is elsewhere available as mandoc_man(7), which reveals its origin. There are some things to know about the material quoted above. 1. mandoc(1)'s documentation takes a fairly partisan attitude toward *roff macro languages; it endorses only mdoc(7), deprecates man(7), and makes no attempt to support anything else. 2. Ingo Schwarze has been the mandoc(1) (formerly "mdocml" project) maintainer for many years now. He is also a groff contributor and committer and we have worked productively together since 2017 to better establish what it means to have portable man pages. 3. There is no such thing as a "standard extension" to man(7), nor even a standard "core" of man(7)--nor of mdoc(7), for that matter. That is because these languages have never been standardized. *roff itself has never been standardized, either. 4. `UR` and `UE` _are_ GNU extensions to man(7), two of several. They have been supported by groff since 2009, and by mandoc(1) for nearly 10 years.[1] Unless one is targeting old proprietary/commercial Unix systems, there is little reason not to use the dialect of man(7) presented in the groff_man(7) page, complete with extensions--with the possible exception of the brand-new `MR` macro, a groff 1.23.0 arrival. On many of those same proprietary/commercial Unix systems, mdoc(7) will not be available at all; that macro package was developed by the UC Berkeley Computing Science Research Group for release in 4.3BSD-Reno (1990), whereas proprietary/commercial Unices were in the Unix System V line of descent. groff and mandoc(1) are both of course available for any flavor of Unix, but such proprietary/commercial Unices as still survive often exhibit diffidence about incorporating them. On the bright side, Solaris 11 replaced its proprietary troff with groff, HP-UX has been packaging groff as an add-on for years (providing 1.23.0 packages within days of upstream release), and Mike Fulton of IBM has been in touch with groff's mailing list to help us address portability issues to AIX/z/OS. (There appear to be no serious problems, thanks to the presence of an extensive POSIX-like layer, much as we can say for Cygwin and MSYS2 on Windows.) The gr...@gn... mailing list is the Internet's water cooler for nearly all public discussion of roff/nroff/troff/groff, leaving aside social media outlets like Reddit and StackExchange which serve as Q&A forums. My impression is that nearly all man page viewing that is observable is done via groff or mandoc(1). Heirloom Doctools troff is probably in third place, but it too supports groff's man(7) extensions, since it incorporates (an old version of) groff's an-ext.tmac file. > Although, they also say "Use the mdoc(7) language, instead", and > mdoc(7) does not mention these macros. mdoc(7) uses a _completely different lexicon_ of macro names. There is literally no overlap between the two. mdoc(7) names are spelled with an initial capital letter and lowercase second letter; man(7) names are spelled with two capital letters. These are what you might call mere conventions, but they have been rigidly held to. The only exception known to me is now-dead commercial Unix system, DEC Ultrix; it had `Ds` and `De` macros for setting "displays", a concept man(7) and mdoc(7) don't otherwise use. mdoc(7)'s macro repertoire is many times the size of man(7)'s, and it also has a unique approach among all *roff macro packages known to me regarding macro argument handling. In a footnote, I'll quote explanation of this in the groff_mdoc(7) page in the groff 1.23.0 release.[2] At any rate, a man page cannot mix man(7) and mdoc(7) macro names and hope to render correctly. > The same for .EX / .EE which we started using recently. By one measure, `EX` and `EE` are of the same vintage as `UR` and `UE`; they have been supported in groff releases for 14 years, and by mandoc(1) for over 11 years.[3] About a year ago, Ingo even conceded their utility.[4] :) By another measure, `EX` and `EE` are 37 years old, since they appeared in Ninth Edition Unix man(7).[5] groff's man(7) extension macros are very permissively licensed. No page author that is concerned about their document remaining portable is subject to any legal restriction on copying and using them.[6] If there's anything I can shed light on, please ask. Regards, Branden [1] https://cvsweb.bsd.lv/mandoc/man.c?sortby=date (revision 1.120) [2] [UTF-8 follows] Most of mdoc’s general text and manual domain macros parse their argument lists for callable macro names. This means that an argument in the list matching a general text or manual domain macro name (and defined to be callable) will be called with the remaining arguments when it is encountered. In such cases, the argument, although the name of a macro, is not preceded by a dot. Macro calls can thus be nested. This approach to macro argument processing is a unique characteristic of the mdoc package, not a general feature of roff syntax. For example, the option macro, .Op, may call the flag and argument macros, .Fl and .Ar, to specify an optional flag with an argument. .Op Fl s Ar bytes → [-s bytes] To prevent a word from being interpreted as a macro name, precede it with the dummy character. .Op \&Fl s \&Ar bytes → [Fl s Ar bytes] In this document, macros whose argument lists are parsed for callable arguments are referred to as parsed, and those that may be called from an argument list are referred to as callable. This usage is a technical faux pas, since all mdoc macros are in fact interpreted (unless prevented with ‘\&’), but as it is cumbersome to constantly refer to macros as “being able to call other macros”, we employ the term “parsed” instead. Except where explicitly stated, all mdoc macros are parsed and callable. In the following, we term an mdoc macro that starts a line (with a leading dot) a command if a distinction from those appearing as arguments of other macros is necessary. [3] https://cvsweb.bsd.lv/mandoc/man.c?sortby=date (revision 1.116) [4] https://lists.gnu.org/archive/html/groff/2022-08/msg00081.html [5] https://lists.gnu.org/archive/html/groff/2019-07/msg00038.html [6] https://git.savannah.gnu.org/cgit/groff.git/tree/tmac/an-ext.tmac?h=1.23.0 |
From: Guenter M. <mi...@us...> - 2023-08-13 09:31:04
|
Hi Branden, welcom to the Docutils developers list. On 2023-08-12, G. Branden Robinson wrote: > I just subscribed to this list. I work on groff and would like to help > improve rst2man's output. This is good news. > 1. mandoc(1)'s documentation takes a fairly partisan attitude toward > *roff macro languages; it endorses only mdoc(7), deprecates man(7), > and makes no attempt to support anything else. If I got it right, "mandoc" tries to provide a "semantic markup" layer for man pages. Docutils aims to provide an alternative easy-to-read semantic markup language for man page sources which works on a wide range of systems. > 2. Ingo Schwarze has been the mandoc(1) (formerly "mdocml" project) > maintainer for many years now. He is also a groff contributor and > committer and we have worked productively together since 2017 to > better establish what it means to have portable man pages. > 3. There is no such thing as a "standard extension" to man(7), nor even > a standard "core" of man(7)--nor of mdoc(7), for that matter. That > is because these languages have never been standardized. *roff > itself has never been standardized, either. > 4. `UR` and `UE` _are_ GNU extensions to man(7), two of several. They > have been supported by groff since 2009, and by mandoc(1) for nearly > 10 years.[1] > Unless one is targeting old proprietary/commercial Unix systems, there > is little reason not to use the dialect of man(7) presented in the > groff_man(7) page, complete with extensions--with the possible exception > of the brand-new `MR` macro, a groff 1.23.0 arrival. Fine. > My impression is that nearly all man page viewing that is observable is > done via groff or mandoc(1). Heirloom Doctools troff is probably in > third place, but it too supports groff's man(7) extensions, since it > incorporates (an old version of) groff's an-ext.tmac file. Sticking to the subset supported by groff, mandoc, and Heirloom Doctools seems to be a reasonable aproach then. Thanks again Günter |
From: G. B. R. <g.b...@gm...> - 2023-08-13 10:11:18
Attachments:
signature.asc
|
At 2023-08-13T09:30:40-0000, Guenter Milde via Docutils-develop wrote: > Hi Branden, > > welcom to the Docutils developers list. Thank you! Glad to be here. > On 2023-08-12, G. Branden Robinson wrote: > > 1. mandoc(1)'s documentation takes a fairly partisan attitude > > toward *roff macro languages; it endorses only mdoc(7), > > deprecates man(7), and makes no attempt to support anything > > else. > > If I got it right, "mandoc" tries to provide a "semantic markup" layer > for man pages. I don't believe that is correct. First, there are a couple of things called "mandoc". It is one way to spell a groff(1) (or troff(1), or nroff(1)) command-line option and argument combination, as in groff -mandoc foo.1 bar.2 for example. This loads a macro file called "andoc.tmac", which uses some *roff language features to relieve man(1) programs from having to read man page sources to determine which macro language, man(7) or mdoc(7), the pages use. This feature dates back to 1991. https://git.savannah.gnu.org/cgit/groff.git/tree/ChangeLog.115#n3526 Around 2008, Kristaps Dzonsons of OpenBSD started the "mdocml" project, an effort to replace the groff (and any other troff) formatter for the purpose of man page rendering. In 2009, this project made the decision to name its formatter program "mandoc", and apparently later that year Ingo Schwarze decided to rename the entire project after the command. https://mandoc.bsd.lv/devhistory.html mandoc, in either meaning, is not a macro language specification or a semantic markup layer. mdoc(7), which in its present form originates in 4.3BSD-Reno (1990),[1] is an alternative to the man(7) macro language for *roff. mdoc(7)'s emphasis is indeed on semantic markup. However, mdoc(7) is not purely semantic, and man(7) is not purely presentational. > Docutils aims to provide an alternative easy-to-read semantic markup > language for man page sources which works on a wide range of systems. Acknowledged. > Sticking to the subset supported by groff, mandoc, and Heirloom > Doctools seems to be a reasonable aproach then. Cool. That baseline will avoid some headaches and ugliness. I can help with translation to either macro package, but as "rst2man" has "man" in its name, and the man(7) and mdoc(7) lexicons cannot be mixed in a single document, is it fair to say that Docutils would like to improve its production of output in the man(7) language where feasible? An "rst2mdoc" is, of course, conceivable. Thank you for putting me in the picture. Regards, Branden [1] Ingo clarified the history recently for me. The mdoc(7) in 4.3BSD-Reno is actually the third version of the macro language (not counting a few extensions later added by the groff and mdocml/mandoc projects). The second version is known as "old mdoc" and while groff, at least, still carries support for it, I don't know if any pages in that form of the language survive anywhere. The first version of mdoc, is, apparently, completely lost. [2] https://minnie.tuhs.org/cgi-bin/utree.pl?file=Net2/usr/src/share/tmac/tmac.doc.old |
From: engelbert g. <eng...@gm...> - 2023-08-14 08:42:16
|
On man 7 man (AFAIR) is a list of safe statements .sp asf which I tried to limit the writer output man 7 groff_man I learned only recent Along the line of the discussion we had with the latex writer … target the structure or use only the type setting (line drawing) Structure it was/is G. Branden Robinson <g.b...@gm...> schrieb am So. 13. Aug. 2023 um 12:11: > At 2023-08-13T09:30:40-0000, Guenter Milde via Docutils-develop wrote: > > Hi Branden, > > > > welcom to the Docutils developers list. > > Thank you! Glad to be here. > > > On 2023-08-12, G. Branden Robinson wrote: > > > 1. mandoc(1)'s documentation takes a fairly partisan attitude > > > toward *roff macro languages; it endorses only mdoc(7), > > > deprecates man(7), and makes no attempt to support anything > > > else. > > > > If I got it right, "mandoc" tries to provide a "semantic markup" layer > > for man pages. > > I don't believe that is correct. First, there are a couple of things > called "mandoc". It is one way to spell a groff(1) (or troff(1), or > nroff(1)) command-line option and argument combination, as in > > groff -mandoc foo.1 bar.2 > > for example. This loads a macro file called "andoc.tmac", which uses > some *roff language features to relieve man(1) programs from having to > read man page sources to determine which macro language, man(7) or > mdoc(7), the pages use. This feature dates back to 1991. > > https://git.savannah.gnu.org/cgit/groff.git/tree/ChangeLog.115#n3526 > > Around 2008, Kristaps Dzonsons of OpenBSD started the "mdocml" project, > an effort to replace the groff (and any other troff) formatter for the > purpose of man page rendering. In 2009, this project made the decision > to name its formatter program "mandoc", and apparently later that year > Ingo Schwarze decided to rename the entire project after the command. > > https://mandoc.bsd.lv/devhistory.html > > mandoc, in either meaning, is not a macro language specification or a > semantic markup layer. > > mdoc(7), which in its present form originates in 4.3BSD-Reno (1990),[1] > is an alternative to the man(7) macro language for *roff. mdoc(7)'s > emphasis is indeed on semantic markup. > > However, mdoc(7) is not purely semantic, and man(7) is not purely > presentational. > > > Docutils aims to provide an alternative easy-to-read semantic markup > > language for man page sources which works on a wide range of systems. > > Acknowledged. > > > Sticking to the subset supported by groff, mandoc, and Heirloom > > Doctools seems to be a reasonable aproach then. > > Cool. That baseline will avoid some headaches and ugliness. I can help > with translation to either macro package, but as "rst2man" has "man" in > its name, and the man(7) and mdoc(7) lexicons cannot be mixed in a > single document, is it fair to say that Docutils would like to improve > its production of output in the man(7) language where feasible? > > An "rst2mdoc" is, of course, conceivable. > > Thank you for putting me in the picture. > > Regards, > Branden > > [1] Ingo clarified the history recently for me. The mdoc(7) in > 4.3BSD-Reno is actually the third version of the macro language (not > counting a few extensions later added by the groff and mdocml/mandoc > projects). The second version is known as "old mdoc" and while > groff, at least, still carries support for it, I don't know if any > pages in that form of the language survive anywhere. The first > version of mdoc, is, apparently, completely lost. > > [2] > https://minnie.tuhs.org/cgi-bin/utree.pl?file=Net2/usr/src/share/tmac/tmac.doc.old > _______________________________________________ > Docutils-develop mailing list > Doc...@li... > https://lists.sourceforge.net/lists/listinfo/docutils-develop > > Please use "Reply All" to reply to the list. > |
From: G. B. R. <g.b...@gm...> - 2023-08-16 03:37:52
Attachments:
signature.asc
|
Hi Engelbert, At 2023-08-14T10:41:58+0200, engelbert gruber wrote: > On man 7 man (AFAIR) is a list of safe statements .sp asf Yes. The man(7) page from the Linux man-pages project does have a list of "safe" formatter requests. Long story short, the current Linux man-pages maintainer would like to withdraw the page and has invited me to submit (the equivalent of) a merge request to do so.[1] mandoc maintainer Ingo Schwarze and I take a pretty different approach to the problem; we agree that minimal use of formatter requests, and sticking to the existing sets of package macros (plus a few escape sequences) is the most reliable route to portable man page rendering. That "minimal" approach also means that people writing man(7) documents or tools to generate them have to master much less material. > which I tried to limit the writer output man 7 groff_man I learned > only recent In my opinion that man page became a more helpful resource with the release of groff 1.22.4 in December 2018, and in groff 1.23.0 (released 5 July) there is a new groff_man_style(7) page that is written for newcomers, and presumes as little knowledge of typesetting and *roff programs as possible. In full disclosure, much of it is my own work. For those whose systems don't have 1.23.0 installed yet, the groff_man_style(7) document can be read in PDF; go to page 253. https://www.gnu.org/software/groff/manual/groff-man-pages.pdf > Along the line of the discussion we had with the latex writer … target > the structure or use only the type setting (line drawing) > > Structure it was/is If I'm understanding you correctly, I agree with the choice. You want to convert ReStructured Text into high-level structural markup as much as the target language allows, and get involved with fiddly details of typesetting as little as possible. Regards, Branden [1] "I want to kill that page" https://lore.kernel.org/linux-man/fe3...@ke.../T/#m124e9719a24560c8ed5526e7464d4a4c311008a7 |
From: engelbert g. <eng...@gm...> - 2023-08-16 08:25:37
|
On Wed, 16 Aug 2023 at 05:38, G. Branden Robinson < g.b...@gm...> wrote: > Hi Engelbert, > > At 2023-08-14T10:41:58+0200, engelbert gruber wrote: > > On man 7 man (AFAIR) is a list of safe statements .sp asf > > Yes. The man(7) page from the Linux man-pages project does have a list > of "safe" formatter requests. Long story short, the current Linux > man-pages maintainer would like to withdraw the page and has invited me > to submit (the equivalent of) a merge request to do so.[1] mandoc > maintainer Ingo Schwarze and I take a pretty different approach to the > problem; we agree that minimal use of formatter requests, and sticking > to the existing sets of package macros (plus a few escape sequences) is > the most reliable route to portable man page rendering. > > > That "minimal" approach also means that people writing man(7) documents > or tools to generate them have to master much less material. > > > > For those whose systems don't have 1.23.0 installed yet, the > groff_man_style(7) document can be read in PDF; go to page 253. > > https://www.gnu.org/software/groff/manual/groff-man-pages.pdf did put it on my list :-) > > > [1] "I want to kill that page" > take him by his word submit a minimal page pointing to the macros actually in my understanding man 7 man should be the man macros groff_man or man_roff or man _groff should container formatter requests cheers > > https://lore.kernel.org/linux-man/fe3...@ke.../T/#m124e9719a24560c8ed5526e7464d4a4c311008a7 > _______________________________________________ > Docutils-develop mailing list > Doc...@li... > https://lists.sourceforge.net/lists/listinfo/docutils-develop > > Please use "Reply All" to reply to the list. > |
From: G. B. R. <g.b...@gm...> - 2023-08-19 23:45:50
Attachments:
signature.asc
|
Hi Engelbert, At 2023-08-16T10:25:19+0200, engelbert gruber wrote: > On Wed, 16 Aug 2023 at 05:38, G. Branden Robinson < > g.b...@gm...> wrote: > > For those whose systems don't have 1.23.0 installed yet, the > > groff_man_style(7) document can be read in PDF; go to page 253. > > > > https://www.gnu.org/software/groff/manual/groff-man-pages.pdf > > did put it on my list :-) Cool. Let me know what points, if any, need to be clarified. > take him by his word submit a minimal page pointing to the macros I guess if someone installs the Linux man-pages package without installing groff, and they get an error message, that a distributor's problem to sort out. > actually in my understanding man 7 man should be the man macros > groff_man or man_roff or man _groff should container formatter > requests I don't think that's correct. My understanding is that groff man pages got prefixes 30+ years ago so that they could be simultaneously installed with AT&T troff. Part of that involved giving the GNU reimplementation of AT&T troff commands a 'g' prefix ("gtroff", "gtbl", "geqn", and so on). But there were also man pages for things that weren't commands, like font(5) in Research Unix, and the macro packages, like man(7), ms(7), and mm(7). So for sections 5 and 7, groff decided to just use its own name as a prefix to avoid collisions. The practice remains useful to distinguish implementations. For instance, on my Debian system there are also mandoc_man(7) and mandoc_roff(7) pages. So both man(7) and groff_man(7) would describe the "man" macro package. To avoid repetition, as you suggest it's better if one just points to the other. The page documenting formatter requests, escape sequences, and predefined register names (as well as, in groff 1.23.0, a lot of specification and conceptual explanation), is groff(7). The end of the groff(1) page attempts to present groff's ~59 man pages in an organized way so that users can find material of interest. Regards, Branden |