Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Man output gives font warning with latest man and groff #9020

Closed
hickford opened this issue Aug 24, 2023 · 27 comments
Closed

Man output gives font warning with latest man and groff #9020

hickford opened this issue Aug 24, 2023 · 27 comments
Labels

Comments

@hickford
Copy link

Explain the problem.

Pandoc's man output for code blocks and inline code is incompatible with the latest man and groff, giving warnings about fonts such as "warning: cannot select font 'CB'" and "warning: cannot select font 'C'".

I am using GNU troff (groff) version 1.23.0. This issue did not occur with earlier versions of groff.

Pandoc command pandoc example.1.md -t man -o example.1 --standalone

Input example.1.md:

Paragraph with `inline code`

```
Code block line 1
Code block line 2
Code block line 3
```

Output example.1:

.\" Automatically generated by Pandoc 3.1.6.1
.\"
.\" Define V font for inline verbatim, using C font in formats
.\" that render this, and otherwise B font.
.ie "\f[CB]x\f[]"x" \{\
. ftr V B
. ftr VI BI
. ftr VB B
. ftr VBI BI
.\}
.el \{\
. ftr V CR
. ftr VI CI
. ftr VB CB
. ftr VBI CBI
.\}
.TH "" "" "" "" ""
.hy
.PP
Paragraph with \f[V]inline code\f[R]
.IP
.nf
\f[C]
Code block line 1
Code block line 2
Code block line 3
\f[R]
.fi

Run man command with warnings man -l example.1 | grep warn

troff:<standard input>:5: warning: cannot select font 'CB'
troff:<standard input>:23: warning: cannot select font 'C'

This warning is non-fatal. The man page looks okay to me.

Pandoc version?

pandoc 3.1.6.1 on Linux

@hickford hickford added the bug label Aug 24, 2023
@jgm
Copy link
Owner

jgm commented Aug 24, 2023

That's quite weird, but I can't see how it could be a bug in pandoc. You should report this to groff. Looking quickly at the changelog for 1.23, I didn't see anything relevant, but you might look more carefully before reporting.

@hickford
Copy link
Author

hickford commented Aug 24, 2023

@jgm Thanks for taking a look. Reported to groff https://savannah.gnu.org/bugs/index.php?64594

@ischwarze
Copy link

Pandoc is obviously generating lots of bogus code.

  1. No manual page should ever attempt to fiddle with low-level formatting details like setting font names. Preferably, use font macros like .B and .I and font alternation macros. On those output lines where that isn't possible, which happens in man(7) code generators in some situations, use the standard font escapes: \fB \fI \fR \fP \f(CB \f(CI \f(CR. Using .ftr is always an extremely bad idea. For example, mandoc(1) completely ignores that request, meaning that none of the fonts you desire will be used in any output mode, all text will always end up in \fR.

  2. In general, avoid conditionals in manual pages. Do not use .if and .ie. If you feel a temptation to insert a conditional request into the source code of a manual page, it's usually a symptom of a layering violation, a warning sign that you are about to manipulate low-level implementation details that are better left to the formatter. When people try to use such low-level roff requests, the end result is almost never portable.

  3. Never insert any hyphenation request into the source code of any manual page. That's a detail that should be left to the formatter.

  4. Emitting .PP right after .TH or .SH is a no-op with groff and mandoc. With other formatters, it could potentially create excessive vertical spacing.

  5. A font named "C" usually does not exit, on no formatter and in no output mode. There may be rare exceptions where it happens to be defined for some weird reason, but in most cases, it is not.

Fiddling with such low-level implementation details guarantees that your output is not portable, neither between different formatters nor between subsequent releases of the same formatter.

While not quite as dire as the above points, using the GNU escape syntax \f[...] is not a particularly good idea. While most modern formatters support that, it is less portable than using the standard syntax \fB and \f(BI. Finally, note that while the CB CI CR fonts will usually be available on most modern formatters, using them is more risky than using \fB \fI \fR only. The C fonts are notoriously error-prone. Whenever you can, use semantic markup like .EX/.EE. Yes, that is also slightly risky because a few very uncommon formatters might not provide it, but it is still significantly more robust than trying to manually fiddle with CX fonts.

The discussion whether the particular regressions you see here are pandoc's fault or groff's fault is partially moot. As long as you poke so deeply into language internals and implementation details, you can bet that you will often see all kinds of misformatting and regressions.

Maintainer of mandoc(1) and maintainer of the groff(1) port in OpenBSD speaking, see: https://mandoc.bsd.lv/

@jgm
Copy link
Owner

jgm commented Aug 25, 2023

Perhaps there are ways to improve pandoc's man output, and we're happy to hear them. But this doesn't explain why this warning is suddenly popping up after this particular groff release. I'd like to understand that.

My main resource in designing the current man and ms writers were the man pages themselves. groff_man(7) refers you to groff(7). groff(7) lists both \f(fo and \f[font] as syntaxes for changing fonts. It also says that CB is the font name for constant-width boldface. So the man page itself certainly suggests that \f[CB] should work. So, why the warning about this (which is just coming up now and has not been reported before)? What changed in this groff release?

I take the point that C is not one of the standard font names, and I will fix that.

Regarding the conditional and low-level formatting you object to at the beginning: the motivation for this is described in #7506, in response to a request from @joeyh, who quite reasonably wanted a visible distinction between code blocksspans and regular text in a terminal viewer. I wanted to accommodate that by displaying code in boldface, but I didn't want to give up displaying code in a typewriter font when the man page was rendered to HTML. So the intent of this code was to define a font for code that will render as boldface when viewed in the terminal but as monospace when the man page is rendered to HTML. Perhaps this is too fancy a thing to want, but groff man does ship with an HTML renderer. Probably we should revert this fanciness and just use \f(CB.

The .hy is conditional on the hyphenate variable. We are defaulting this to true but should probably default it to false, given what you say.

@jgm
Copy link
Owner

jgm commented Aug 25, 2023

Using .EX/.EE is also a good idea and I can't recall now whether we didn't do that for a reason or out of ignorance.

@jgm
Copy link
Owner

jgm commented Aug 25, 2023

Experimented with using

.IP
.EX
....
.EE

for a code block. Unfortunately, when you process it with groff -man -Thtml, it renders as a regular paragraph in the normal font rather than a <pre> in a monospace font. That may be why I didn't use it in the first place.

@jgm
Copy link
Owner

jgm commented Aug 25, 2023

Looking at some man pages on my system, I note that zipinfo.1 actually defines the .EX/.EE macros itself:

.de EX
.in +4n
.nf
.ft CW
..
.de EE
.ft
.fi
.in -4n

The awk.1 man page also defines .EX itself, and then uses it in conjunction with low-level font commands like .ft CW.

certtool.1 man page also defines .EX and .EE before using them.

The perl man pages start with huge conditional macros. For code blocks they use a custom macro .Vb that they define in the page itself, using again .ft CW.

Nobody seems to rely on .EX without defining their own...

@jgm
Copy link
Owner

jgm commented Aug 25, 2023

I remembered why we use the \f[CR] form instead of \f(CR.
We sometimes need three letters, e.g. for text that is bold, italic, and monospace we use \f[CBI]. This seems to work -- although the monospace/non-monospace distinction isn't visible in the terminal, groff -Thtml -man yields <tt><i><b>...

@ischwarze
Copy link

Hello John,

for the latest groff release, G. Branden Robinson, among other things, did lots of work improving warnings. For example, \f[C] never really worked reliably, but groff did not warn. Now, you get the warning because groff now warns about something that didn't work in the past, either. mandoc(1) has also been warning about that for some time:

 $ echo '\\f[C]' | mandoc -T lint
mandoc: <stdin>:1:1: WARNING: invalid escape sequence argument: \f[C]

I'm not quite sure why you get a warning about CB. Then again, that's on the .ie line, and comparing strings with and without font escapes to find out anything about those font escapes is totally non-portable in the first place. For example, mandoc won't even consider "\fRtext\fP" equal to "text". So i don't think you should worry about that specific CB warning.

Regarding following groff(7) documentation - obviously, GNU troff documentation documents GNU features, and those are portable to varying degrees, some more, some less. All the same, groff_man(7), in addition to documentating than man(7) language itself, also contains various bits of portability advice. For example, groff_man(7) talks about single-letter \fB \fI \fR \fP but not about \f[] for a reason. Also note that groff_man(7) does not even mention \f(CB, let alone \f[CB]. If you rely on groff(7) in addition to groff_man(7), it should not come as a surprise that your output will be GNU-specific and not portable.

The groff HTML output device produces output of atrocious quality. That's due to technical limitations in the fundamental way roff works and very hard to improve. In particular, grohtml(1) cannot produce "pre"-tags or any other semantic HTML. The best ist can do it produce physical formatting tags like "B" and "I" tags. If you try to tweak low-level details of your output to work better with grohtml(1), that's guaranteed to ruin the quality of your code, but won't result in good HTML output either way. If you want good HTML output from manual pages, you really have to use mandoc(1) - for example, mandoc -Thtml produces "pre"-tags from .EX, leaving font selection to CSS (and browser defaults, which are usually reasonable). Trying to manually tweak fonts in the manual pages source code in order to get good HTML output is completely hopeless.

Regarding .hy - just leave it out completely in all cases, no matter whether some "hyphenate" variable is set in your pandoc input or not. Maybe in your pandoc input language, it makes sense to give users a choice whether they want automatic hyphenation or not. But in man(7) code, any attempt to translate that choice will not be portable, most likely have no effect whatsoever, or possibly even cause trouble with some formatters. Not every feature can reasonably be translated from one language to another.

The reason why you did not use .EX probably is (just guessing!) that twenty years ago, it was not particularly portable. Few people used AT&T Ninth Edition Unix which invented it, so around 1995-2000, it was mostly available via esr@'s man-ext package and in GNU troff. But nowadays, it is relatively widely supported - certainly less fragile than trying to manually manipulate fonts, in particular C fonts.

Defining .EX in individual manual pages was what esr@ recommended twenty years ago. I never considered that particularly sustainable advice. Back than, you could perhaps argue that it helped some formatters some people used back then, but it always was a terrible kludge at best. Today, formatters that might profit in any way are extremely rare, but you risk trouble with modern formatters that include good implementations of .EX. Redefining something that is already part of the language risks clashes, and even worse, bundled implementations are almost never maintained, get outdated when the formatters are improved, so you end up with worse output on the most common formatters if your own bad implementation overrides the good implementation in the formatter.

CW ("constant width") is a historical name for CR that was widely used before people started also using CB and CI. If all you want is one C font, than (CW could possibly be minimally more portable than (CR, but i don't really know whether any formatters still exist that understand (CW but not (CR. If you use (CB or (CI, than using (CW makes no sense because it is extremely unlikely that any formatter understands (CB but not (CR.

Yes, the perl manual pages contain a huge preamble generated by the pod2man(1). According to what i said, it should not be there. However, that's the only instance of such a low-level roff preamble i have ever seen that causes relatively little trouble in practice. I'm unsure why that is. Probably a combination of that particular code being extremely stable - the pod2man(1) maintenance team almost never tinkers with it, certainly not in ways causing new compatibility issues - and Russ Allbery commanding exceptional roff skills. Certainly not everything in that preamble works on all formatters, but somehow, it seems very carefully crafted such that even if some parts of it don't work somewhere, the fallout is relatively harmless and the page still mostly readable. I have often seem other teams attempt similar feats, but none ever managed to. Certainly not the DocBook team, certainly not pandoc, certainly not rst2man, and i think there are several others the names of which i don't recall right now...

@ischwarze
Copy link

I remembered why we use the \f[CR] form instead of \f(CR. We sometimes need three letters, e.g. for text that is bold, italic, and monospace we use \f[CBI]. This seems to work -- although the monospace/non-monospace distinction isn't visible in the terminal, groff -Thtml -man yields <tt><i><b>...

I wouldn't be surprised if GNU troff is the only formatter supporting a CBI font. Regarding portability, that's significantly worse than even \f[CB]. For example, in mandoc(1), \f[CBI] is the same as \fR:

 $ echo '\\f[CBI]' | mandoc -T lint
mandoc: <stdin>:1:1: WARNING: invalid escape sequence argument: \f[CBI]

Besides, for which semantic purpose would you want to use a font that is CW, bold and italic at the same time? Off the top of my head, i can't think of any reasonable use case. Probably, the reason why mandoc(1) does not support it is that i have never seen it used in practice, whereas CB, CI, CR (and CW) do occasionally occur in real-world manual pages.
Not every feature that can be constructed by generalizing some physical formatting rules actually makes sense for practical purposes...

@g-branden-robinson
Copy link

Perhaps there are ways to improve pandoc's man output, and we're happy to hear them. But this doesn't explain why this warning is suddenly popping up after this particular groff release. I'd like to understand that.

Hi jgm,

I replied at some length at https://savannah.gnu.org/bugs/index.php?64594 .

@jgm
Copy link
Owner

jgm commented Aug 25, 2023

Thank you both for the detailed explanations and advice!

I would very much like to use .EX/.EE, but when I try it on my system (macos), it doesn't seem to give me the formatting I want. It doesn't give me a blank line between it and surrounding content, or indentation, or (I think) a monospace font. (That's a bit hard to tell just from the terminal, but I tested with -Thtml which does seem to make the distinction.) I wonder what the default definition of these macros is? I tried redefining them but the definition I provided was simply ignored (maybe because you can't redefine built-in macros?). I can define a macro with a new name, and that works. Am I missing something?

Besides, for which semantic purpose would you want to use a font that is CW, bold and italic at the same time?

I'm sure you can get by very well without this in man pages, but pandoc is charged with converting things, and these things might include bold italicized monospace content. So, I'm faced with the question what to do if the content I'm converting has all three properties. I can produce non-portable \f[CBI] or I can simply ignore one of the features and produce something more portable. I'm not sure what's best here.

(Also, I should mention that I share some of the font handling code between the man and ms writers, in Text.Pandoc.Writers.Roff. Certainly in ms we want to support CBI.)

@jgm
Copy link
Owner

jgm commented Aug 25, 2023

As for V, it's still kind of nice to allow users to change the rendering of inline code by modifying something in the template, so I like the idea of this "font alias" if there's a way to make it work portably.

The suggestion

.\" Automatically generated by Pandoc IN AN IMAGINED FUTURE
.\"
.\" Remap Courier family to bold styles on terminals for
.\" visibility inline.
.if \n(.g .if n \{\
. do ftr CR B
. do ftr CI BI
. do ftr CB B
. do ftr CBI BI
.\}

does not give us quite the same flexibility, because it will also affect code blocks (not just inline code). The current behavior boldfaces inline code but not code blocks -- aesthetically, bolding whole code blocks is pretty heavy and it's not necessary for distinguishing them from regular text, because they're indented and set off.

jgm added a commit that referenced this issue Aug 25, 2023
regardless of setting of `hyphenate` variable.  See #9020.
@g-branden-robinson
Copy link

g-branden-robinson commented Aug 25, 2023

Hi John,

I hope I can be of further assistance! Let's find out...

I would very much like to use .EX/.EE, but when I try it on my system (macos), it doesn't seem to give me the formatting I want. It doesn't give me a blank line between it and surrounding content, or indentation,

These are deliberate. Ninth Edition Unix EX/EE didn't work that way, so ours doesn't, and sometimes you don't want vertical space or increased indentation. You can compose what you need with the existing macros.

For spacing, use P (or PP, or LP) macros.

RS and RE are for relative insets. They do indent but they can be counterintuitive to use in one common application: setting a code example "within" an indented paragraph. groff_man(7) in groff 1.22.4 speaks to this issue a little bit (".RS doesn’t indent relative to my indented paragraph") and the groff_man_style(7) page in groff 1.23.0 at much greater length, with examples ("Horizontal and vertical spacing").

Long story short (I hope): keep track of whether your previous paragraph used TP or IP (or not). If it did, indent twice, then undo the indentation once after the end of the code block, then a second time at the end of the paragraph.

$ nroff -k -man <<EOF
.TH foo 1 2023-08-25 "groff test suite"
.SH Description
Foobar.
.IP
Blah blah blah.
You can fribulate the gonkulator like this.
.RS
.RS
.P
.EX
x[⍋x←6?40]
.EE
.RE
.
.P
Wasn't that great?
.RE
.P
Bazqux.

I apologize for the weirdness of it; it's compatible with Doug McIlroy's design of the man package in 1979 (probably 1978, actually) for Seventh Edition Unix. There is another approach you might like (or be able to transform to) better discussed in the groff_man_style(7) page that would have you using RS more frequently but also more symmetrically.

or (I think) a monospace font. (That's a bit hard to tell just from the terminal, but I tested with -Thtml which does seem to make the distinction.)

Yeah, on the terminal everything is monospaced, unless you hate your eyeballs. ;-)

I wonder what the default definition of these macros is?

You can find groff's in its an-ext.tmac file. It has some extra complexity involving register tests to (1) make it easy to run our automated test suite on it and (2) accept a proposal from Ingo that the EE macro be forgiving of user error.

I tried redefining them but the definition I provided was simply ignored (maybe because you can't redefine built-in macros?). I can define a macro with a new name, and that works. Am I missing something?

You can redefine them (except for TH, to which you can only append), but you have to do so after calling TH or the andoc.tmac macro file, which is a recommended best practice for everyday man page viewing, will clobber them.

groff_man_style(7) says:

      Except for .SB, definitions of macros described above as
      extensions are contained in this file; in some cases, they are
      simpler versions of definitions appearing in an.tmac, and are
      ignored if the formatter is GNU troff.  They are written to be
      compatible with AT&T troff and permissively licensed—not
      copylefted.  To reduce the risk of name space collisions,
      string and register names begin only with “m”.  We encourage
      man page authors who are concerned about portability to legacy
      Unix systems to copy these definitions into their pages, and
      maintainers of troff implementations or work‐alike systems
      that format man pages to re‐use them.

      The definitions for these macros are read after a page calls
      .TH, so they will replace any macros of the same names
      preceding it in your file.  If you use your own
      implementations of these macros, they must be defined after
      .TH is called to have any effect.  Furthermore, it is wise to
      define such page‐local macros (if at all) after the “Name”
      section to accommodate timid makewhatis or mandb
      implementations that may give up their scan for indexing
      material early.

Besides, for which semantic purpose would you want to use a font that is CW, bold and italic at the same time?

I'm sure you can get by very well without this in man pages, but pandoc is charged with converting things, and these things might include bold italicized monospace content. So, I'm faced with the question what to do if the content I'm converting has all three properties. I can produce non-portable \f[CBI] or I can simply ignore one of the features and produce something more portable. I'm not sure what's best here.

I think you can go ahead with the CBI font for non-man-page purposes. Getting that combination to port to any non-groff-compatible implementation is going to be a tough row to hoe for more reasons than just the "long" 3-character name.

(Also, I should mention that I share some of the font handling code between the man and ms writers, in Text.Pandoc.Writers.Roff. Certainly in ms we want to support CBI.)

Yes indeed. Device-independent troff was a handful of years too early for the PostScript revolution, with its standardized families and styles, to impact its design.

Regards,
Branden

@g-branden-robinson
Copy link

g-branden-robinson commented Aug 25, 2023

As for V, it's still kind of nice to allow users to change the rendering of inline code by modifying something in the template, so I like the idea of this "font alias" if there's a way to make it work portably.

The question that we have to address is: how portable do you seek to be?

AT&T troff didn't have any concept of document-defined fonts. The font repertoire was a property of specific output devices (driver programs), and it had no facility for querying that repertoire or even reporting what the currently selected font was by name. I think it was the Python Docutils maintainer who said recently that portability to the aforementioned trio (groff, Heirloom Doctools troff, and mandoc) was a comfortable horizon for him. If you want to reach Plan 9 and Solaris troff formatters, or Documenter's Workbench 3.3 troff, more work will be cut out for you. Maybe I can think of some tricks--but I fear they will look ugly, confusing, and unmotivated in the output. ('Course, you can always write roff comments to accompany the cleverness.)

Let me know how ambitious you want to be and I'll offer the best advice I can.

The suggestion

.\" Automatically generated by Pandoc IN AN IMAGINED FUTURE
.\"
.\" Remap Courier family to bold styles on terminals for
.\" visibility inline.
.if \n(.g .if n \{\
. do ftr CR B
. do ftr CI BI
. do ftr CB B
. do ftr CBI BI
.\}

does not give us quite the same flexibility, because it will also affect code blocks (not just inline code).

That's true. I wince to suggest it, but I suppose you could stuff the above into a macro, write another to unwind it, and then call them in inverted order by appending to the existing EX and EE macros. Details available on request.

The current behavior boldfaces inline code but not code blocks -- aesthetically, bolding whole code blocks is pretty heavy and it's not necessary for distinguishing them from regular text, because they're indented and set off.

I agree. It would make for eye strain, or at least give typographically sensitive people the vapors.

Regards,
Branden

@g-branden-robinson
Copy link

g-branden-robinson commented Aug 25, 2023

@jgm -- I never did answer this question with precision.

Perhaps there are ways to improve pandoc's man output, and we're happy to hear them. But this doesn't explain why this warning is suddenly popping up after this particular groff release. I'd like to understand that.

This is it.

commit 1986da1d4bb11dc0421e004b153729b3d2a2a3ca
Author: G. Branden Robinson <[email protected]>
Date:   Mon Jun 20 14:15:38 2022 -0500

    [troff]: Warn if nonexistent font name selected.
    
    * src/roff/troff/env.cpp (font_change):
    * src/roff/troff/input.cpp (token::next): Warn upon selection of a
      nonexistent font name.
    
    Fixes <https://savannah.gnu.org/bugs/?62656>.
    
    Also annotate a null pointer to ease any future transition to C++11,
    which defines a keyword for it.

 ChangeLog                |  7 +++++++
 src/roff/troff/env.cpp   |  7 +++++--
 src/roff/troff/input.cpp | 12 +++++++++---
 3 files changed, 21 insertions(+), 5 deletions(-)
[...]
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 7aeb5bd22..c564ebc82 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -1202,10 +1202,13 @@ void font_change()
        break;
       }
   }
+  // environment::set_font warns if a bogus mounting position is
+  // requested.  We must warn here if a bogus font name is selected.
   if (is_number)
-    curenv->set_font(atoi(s.contents()));
+    (void) curenv->set_font(atoi(s.contents()));
   else
-    curenv->set_font(s);
+    if (!curenv->set_font(s))
+      warning(WARN_FONT, "cannot select font '%1'", s.contents());
   skip_line();
 }
 
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 5a299121d..8aadc243a 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -2052,10 +2052,16 @@ void token::next()
          for (p = s.contents(); *p != '\0'; p++)
            if (!csdigit(*p))
              break;
-         if (*p || s.is_empty())
-           curenv->set_font(s);
+         // environment::set_font warns if a bogus mounting position is
+         // requested.  We must warn here if a bogus font name is
+         // selected.
+         if (*p != 0 /* nullptr */ || s.is_empty()) {
+           if (!curenv->set_font(s))
+             warning(WARN_FONT, "cannot select font '%1'",
+                     s.contents());
+         }
          else
-           curenv->set_font(atoi(s.contents()));
+           (void) curenv->set_font(atoi(s.contents()));
          if (!compatible_flag)
            have_input = 1;
          break;

@jgm
Copy link
Owner

jgm commented Aug 25, 2023

Thanks very much for all of that; it really clears up a lot of my questions! Am I understanding correctly that, if I just want to target the trio groff / mandoc / heirloom doctools troff, then defining a custom font V for inline verbatim is still okay? That seems cleaner than the unwinding-macro approach you sketch above.

(EDIT: Of course, another alternative would be for pandoc just to hardcode CB for inline verbatim code; the only disadvantage this has is that this decision couldn't be changed by modifying the template.)

@ischwarze
Copy link

I would very much like to use .EX/.EE, but when I try it on my system (macos), it doesn't seem to give me the formatting I want.

Didn't MacOS recently switch from using man-db+groff by default to using mandoc by default? Consequently, unless you tell me otherwise, i'll assume that all you are saying in the comment i'm replying to here refers to the behaviour of mandoc(1).

It doesn't give me a blank line between it and surrounding content, or indentation,

No, mandoc(1) does not produce vertical spacing or indentation around .EX because it strives for compatibility with groff, and Branden already explained groff's choices.

or (I think) a monospace font. (That's a bit hard to tell just from the terminal, but I tested with -Thtml which does seem to make the distinction.)

For terminal output, mandoc(1) discards the font family "C" and maps CB -> B, CI -> I, CR -> R.
For HTML output, mandoc generates "pre"-tags from .EX, so the font depends on whatever CSS you are using, or on your browser defaults.

I wonder what the default definition of these macros is?

In mandoc, there is no such concept as "default definition of a standard macro". Instead, and in utter contrast to what groff does, the standard high-level macros (like .EX) are represented as nodes in an abstract syntax tree (AST), which enables high-quality HTML output.

I tried redefining them but the definition I provided was simply ignored (maybe because you can't redefine built-in macros?). I can define a macro with a new name, and that works. Am I missing something?

You can redefine standard macros in mandoc(1), but it's an absolutely terrible idea. The consequence is that instead of using the normal AST approach, the AST will contain low-level roff(7) nodes even in mandoc, resulting in atrocious HTML output even from mandoc.

Besides, for which semantic purpose would you want to use a font that is CW, bold and italic at the same time?

I'm sure you can get by very well without this in man pages, but pandoc is charged with converting things, and these things might include bold italicized monospace content. So, I'm faced with the question what to do if the content I'm converting has all three properties. I can produce non-portable \f[CBI] or I can simply ignore one of the features and produce something more portable. I'm not sure what's best here.

If you are producing man(7) output, i think it's better to emit \f(BI, which will work on most modern formatters, rather than emitting \f[CBI], which is equivalent to \fR on some widely used formatters and likely to cause warnings on top of that.

(Also, I should mention that I share some of the font handling code between the man and ms writers, in Text.Pandoc.Writers.Roff. Certainly in ms we want to support CBI.)

I'm not sure what people use ms(7) for nowadays, and which software they use for that. Your argument that you want to support \f[CBI] in ms(7) output may be fair enough: i guess that most people using ms(7) are likely using groff, where that works. My first idea of a user group where \f[CBI] might cause trouble even in ms(7) output is Plan 9 users. There may be other examples, for example commercial UNIX systems like Solaris, HP-UX, or AIX. Then again, i know little about both ms(7) and Plan 9, and i stopped using commercial UNIX systems around 1998-2003, even before getting involved with free software documentation.

Either way, using one feature in one output language doesn't imply that using the same feature in another output language is necessarily a good idea. I have a hard time thinking of any users who might profit from having \f[CBI] in manual pages, but i can easily think of lots of users who will be hurt by that.

@g-branden-robinson
Copy link

g-branden-robinson commented Aug 25, 2023

For terminal output, mandoc(1) discards the font family "C" and maps CB -> B, CI -> I, CR -> R. For HTML output, mandoc generates "pre"-tags from .EX, so the font depends on whatever CSS you are using, or on your browser defaults.

That's what grohtml does, and I am not sure of the wisdom of that choice; for things that aren't man pages, changing the semantics of input line breaks (meaning: in the HTML document) seems like a terrible idea.

If you are producing man(7) output, i think it's better to emit \f(BI, which will work on most modern formatters,

Yes. I resort to it myself in groff man and in a very few cases in our man pages (the only example I can think of is in grotty(1), to illustrate that face's availability with that driver). It's not portable to Seventh Edition Unix or Unix System III. But those are 40+ year old systems. The PostScript revolution I mentioned above did have an impact, so I've never seen an instance of a missing BI face come up in practice. Except...

The exception is formatting for TeX DVI; Knuth's Computer Modern faces have constant-width upright and italic forms, but not heavy (bold) variants thereof. We have bespoke logic in groff's an.tmac to cope with this, since it's the only output driver thus afflicted. So far, no one using alternative fonts with grodvi(1) has complained that we're cramping their style.

Heck, if someone is using grodvi at all, I'd like to hear from them.

EDIT: Actually there is another exception. The grolbp(1) output driver for Canon LBP-4 and LBP-8 laser printers also has a Courier family but, according to our man page, lacks the bold-italic style for it. I am inclined to simply leave this situation alone. I have no way to troubleshoot this output driver on real (or even emulated) hardware, the devices it supported would appear to have been out of production for decades, and I don't know if Canon or any other printer manufacturer still supports the data stream format. By contrast, grolj4(1), which is of similar vintage, continues to work fine, as I learned to my delight last year when I got my hands on a Brother laser printer for testing. If a grolbp user shows up complaining of these missing font diagnostic messages, I will be thrilled to hear from them.

rather than emitting \f[CBI], which is equivalent to \fR on some widely used formatters

I trust you mean that it produces equivalent output, because the font selection can't be honored.

and likely to cause warnings on top of that.

And thus do we get squarely back on topic. ;-)

I'm not sure what people use ms(7) for nowadays, and which software they use for that. Your argument that you want to support \f[CBI] in ms(7) output may be fair enough: i guess that most people using ms(7) are likely using groff, where that works. My first idea of a user group where \f[CBI] might cause trouble even in ms(7) output is Plan 9 users.

I expect ms document authors on Plan 9 use its troff, since groff's ms implementation is hopelessly entangled with GNU troff extensions. When updating Larry Kollar's ms.ms document, I was careful to document all extensions in the macro language itself. John, you might be interested in that document as well.

There may be other examples, for example commercial UNIX systems like Solaris, HP-UX, or AIX.

Interestingly all of these have come up on the groff list in the last few months.

We know that Solaris dropped its troff for groff in Solaris 11, which was released...over a decade ago now? Solaris 10 is in hospice care; its date of execution has been postponed to January 2025--I think by the personal command of Larry Ellison specifically to spite my plans for designating a portable dialect of roff.

>shakes fist impotently<

I don't know if HP-UX still supports its Unix System V troff, but I can say that they got groff 1.23.0 ported really fast. Like, within a week. I once could say I had friends at HP, but I think they're all retired now. The more likely explanation is that they actually care about it, maybe because they use it.

Mike Fulton of IBM has been in touch with us, too, and I don't remember if he said they still had their System V troff, too--I was too gobsmacked by the fact that we could get rid of CCSID ("code page") 1047 support.

Either way, using one feature in one output language doesn't imply that using the same feature in another output language is necessarily a good idea. I have a hard time thinking of any users who might profit from having \f[CBI] in manual pages, but i can easily think of lots of users who will be hurt by that.

It does seem like an unusual case. If one follows my recommendations in groff_man_style(7), one would need to have an I/O example that was parameterized in user input. Typically, man page examples are not that demanding of the reader's metacognition.

John, please rein me in at any time--I know I have a tendency to ramble.

@ischwarze
Copy link

Thanks very much for all of that; it really clears up a lot of my questions! Am I understanding correctly that, if I just want to target the trio groff / mandoc / heirloom doctools troff, then defining a custom font V for inline verbatim is still okay?

No, you misunderstand: mandoc(1) does not support .ftr at all:
https://man.openbsd.org/roff.7#ftr says:

ftr newname [oldname]
    Translate font name. This is a groff extension and currently ignored.

Consequently, with mandoc, \fV is the same as \fR and also causes a warning message.

The mdoc(7) macro package provides the .Ql macro exactly for this purpose: https://man.openbsd.org/mdoc.7#Ql
In terminal output, .Ql encloses in single quotes. In typeset (e.g. PDF) output, it uses a CW font and additionally encloses in single quotes if the argument is very short because the reader might then overlook the font change. In HTML output (of course, mandoc(1) only, as groff doesn't provide a HTML output device good enough for real-world use), .Ql produces an element (code class="Li"). The "code"-tag provides reasonable (typical CW) formatting by default, and the "class"-attribute allows additional customization using CSS.

But the older man(7) language does not provide any similar functionality, not even if you are willing to aggressively use all GNU extensions. Consequently, the best solution i can think of would look something like this:

.PP
This paragraph contains
\(oq\f(CRinline code\fP\(cq
in the middle.
.PP

I expect that to be quite portable, even beyond the big three.
Obviously, mandoc cannot produce a "code"-tag from that, but that's a limitation of the man(7) language and not mandoc(1)'s fault.

That seems cleaner than the unwinding-macro approach you sketch above.

Indeed, defining your own macros in a manual page sets you up for a trip on the highway to hell (pod2man being the singular exception that confirms the rule rather than casting doubt on it, as discussed), and defining a custom macro to wrap standard ones sounds even worse. Even Branden, who usually tends be bolder and less timid with respect to compatibility questions than i am, was visibly shaking when reluctantly considering whether he should really provide such advice. :-o

(EDIT: Of course, another alternative would be for pandoc just to hardcode CB for inline verbatim code; the only disadvantage this has is that this decision couldn't be changed by modifying the template.)

I think enclosing in single quotes is less intrusive and less confusing than switching to CB, and will also feel familiar to people used to pages written in mdoc(7).

@g-branden-robinson
Copy link

g-branden-robinson commented Aug 25, 2023

The mdoc(7) macro package provides the .Ql macro exactly for this purpose: https://man.openbsd.org/mdoc.7#Ql In terminal output, .Ql encloses in single quotes. In typeset (e.g. PDF) output, it uses a CW font and additionally encloses in single quotes if the argument is very short because the reader might then overlook the font change. In HTML output (of course, mandoc(1) only, as groff doesn't provide a HTML output device good enough for real-world use),

I'd love to argue here, but I can't. The line of attack I have in mind is to give tbl direct HTML output support, use GNU eqn's long-standing MathML output mode, and add an SVG output mode to GNU pic. If I understand aright, these would eliminate all of the reasons for the pre-grohtml preprocessor. That, in turn, would make groff -Thtml run faster and, most importantly of all, make the output driver way easier to debug. It seems like every damn time I have attacked a grohtml problem, it has arisen first in pre-grohtml running troff -Tps, and unfortunately that preprocessor is diligent about destroying as much evidence at the crime scene as it can. For a long time it even lied about troff's exit status.

This is a long-term project.

.Ql produces an element (code class="Li"). The "code"-tag provides reasonable (typical CW) formatting by default, and the "class"-attribute allows additional customization using CSS.

But the older man(7) language does not provide any similar functionality, not even if you are willing to aggressively use all GNU extensions. Consequently, the best solution i can think of would look something like this:

.PP
This paragraph contains
\(oq\f(CRinline code\fP\(cq
in the middle.
.PP

I expect that to be quite portable, even beyond the big three.

There is the problem of the oq and cq special character identifiers not being portable beyond that horizon, which in turn is the fault of AT&T troff for deciding, as with font identifiers, that no portability was required for such things.

This one is a more superable problem (with string definitions in the man document, as Thomas Dickey does, or by trivial edits to font description files in troff implementations), however.

Obviously, mandoc cannot produce a "code"-tag from that, but that's a limitation of the man(7) language and not mandoc(1)'s fault.

I'd be remiss if I didn't point out my ambition to add a quotation macro to man(7).

Indeed, defining your own macros in a manual page sets you up for a trip on the highway to hell (pod2man being the singular exception that confirms the rule rather than casting doubt on it, as discussed), and defining a custom macro to wrap standard ones sounds even worse. Even Branden, who usually tends be bolder and less timid with respect to compatibility questions than i am, was visibly shaking when reluctantly considering whether he should really provide such advice. :-o

:-P

I think enclosing in single quotes is less intrusive and less confusing than switching to CB, and will also feel familiar to people used to pages written in mdoc(7).

Double quotes will feel more familiar to North Americans. ;-)

In any case, you want to be quoting multi-word inline literals, particularly in case formatting gets stripped, as happens when people forget to run mandoc(1)'s output through ul(1), or paste man page contents into emails.

I would also add that I find inline family changes a bit uncomfortable to read. Worse than bold? I'm not sure.

@jgm
Copy link
Owner

jgm commented Aug 25, 2023

I think enclosing in single quotes is less intrusive and less confusing than switching to CB, and will also feel familiar to people used to pages written in mdoc(7).

I'm not sure I like this as a general solution, because

  1. the inline code you're writing might contain ' characters and then it could be very confusing -- though it's unlikely that it would contain curly quotes
  2. authors might manually include quotes, e.g. markdown '`foo`', and then we'll get them doubled.

@jgm
Copy link
Owner

jgm commented Aug 25, 2023

Looks like the best solution might be using \f(CB or \f[CB] for inline code. The drawback is that users wouldn't be able to change that with a change to the template.

@ischwarze
Copy link

I think enclosing in single quotes is less intrusive and less confusing than switching to CB, and will also feel familiar to people used to pages written in mdoc(7).

I'm not sure I like this as a general solution, because
1. the inline code you're writing might contain ' characters and then it could be very confusing -- though it's unlikely that it would contain curly quotes
2. authors might manually include quotes, e.g. markdown '`foo`', and then we'll get them doubled.

Well, you are writing a translation tool, so the tool can parse the content and decide accordingly.
For example, if the inline code in question has already been enclosed in any kind of quotes by the document author, your tool can skip writing the (oq(cq. Or if the inline code contains single quotes, your tool could issue (lq(rq instead of the normal (oq(cq. I'm not saying that must be done, but if you worry about such corner cases, that's one way out, and you can adapt the amount of effort you put into that according to how much you worry about potential ugliness. The main point to remember here is that it's fine if your tool makes such conditional decisions and then emits characters that fit the situation - but that you should not attempt to code conditionals by abusing low-level roff(7) code, which doesn't belong in manual page source code.

Of course, going for \f(CB for inline code is not out of the question either. I have occasionally seen printed books use bold face for sample code. Then again, manual pages usually do not use bold face for such purposes, so it might perhaps confuse some readers, and besides, it's also slightly confusing if inline code samples end up using a different font compared to displayed code samples - and displayed code samples should almost certainly use .EX without any manual font fiddling.

jgm added a commit that referenced this issue Aug 26, 2023
The aim here (see #9020) is to produce more standard and more
portable man pages.  To that end:

- We revert the fanciness introduced in #7506, which employs a
  custom font name V and a macro that makes this act like boldface
  in a terminal and monospace in other formats.  Unfortunately,
  this code uses a mechanism that is not portable (and does not
  work in mandoc).

- Instead of using V for inline code, we simply use CR.
  Note that `\f[CR]` is emitted instead of plain `\f[C]`,
  because there is no C font in man.  (This produces warnings
  in recent versions of groff.)

- For code blocks, we now use the `.EX` and `.EE` macros,
  together with `.IP` for spacing and indentation.  This gives
  more standard code that can be better interpreted e.g. by mandoc.
jgm added a commit that referenced this issue Aug 26, 2023
This is at best a no-op (in groff man and mandoc) and at worst
(in some formatters) may create extra whitespace.
See #9020.
@jgm
Copy link
Owner

jgm commented Aug 26, 2023

I've just push a couple changes that implement some of the suggestions made here.
The sample above now becomes

.PP
Paragraph with \f[CR]inline code\f[R]
.IP
.EX
Code block line 1
Code block line 2
Code block line 3
.EE

jgm added a commit that referenced this issue Aug 27, 2023
See #9031 and discussion in #9020. This will give us better
accessibility; when tagging is enabled, the citation can be
linked to the bibliography entry.

This changes some of the details of the layout and the default
template. We now use a special enumitem list for the bibliography
items, instead of the old CSLReferences environment.

Internal links to ids beginning in `ref-` are assumed to be
links to bibliography items, and put inside a `\cite` instead
of `\hyperref`.  This may be a bit fragile, so we should probably
add something to citeproc to more definitely identify citation
links.
jgm added a commit that referenced this issue Aug 29, 2023
See #9031 and discussion in #9020. This will give us better
accessibility; when tagging is enabled, the citation can be
linked to the bibliography entry.

This changes some of the details of the layout and the default
template. We now use a special enumitem list for the bibliography
items, instead of the old CSLReferences environment.

Internal links to ids beginning in `ref-` are assumed to be
links to bibliography items, and put inside a `\cite` instead
of `\hyperref`.  This may be a bit fragile, so we should probably
add something to citeproc to more definitely identify citation
links.
jgm added a commit that referenced this issue Aug 29, 2023
See #9031 and discussion in #9020. This will give us better
accessibility; when tagging is enabled, the citation can be
linked to the bibliography entry.

This changes some of the details of the layout and the default
template. We now use a special enumitem list for the bibliography
items, instead of the old CSLReferences environment.

Internal links to ids beginning in `ref-` are assumed to be
links to bibliography items, and put inside a `\cite` instead
of `\hyperref`.  This may be a bit fragile, so we should probably
add something to citeproc to more definitely identify citation
links.
jgm added a commit that referenced this issue Aug 29, 2023
See #9031 and discussion in #9020. This will give us better
accessibility; when tagging is enabled, the citation can be
linked to the bibliography entry.

This changes some of the details of the layout and the default
template. We now make CSLReferences a special enumitem list
that will contain `\bibitem`s.

Internal links inside citations to ids beginning in `ref-` are
put inside a `\cite` instead of `\hyperref`.
jgm added a commit that referenced this issue Aug 29, 2023
See #9031 and discussion in #9020. This will give us better
accessibility; when tagging is enabled, the citation can be
linked to the bibliography entry.

This changes some of the details of the layout and the default
template. We now make CSLReferences a special enumitem list
that will contain `\bibitem`s.

Internal links inside citations to ids beginning in `ref-` are
put inside a `\cite` instead of `\hyperref`.

Closes #9031.
@jgm jgm closed this as completed Aug 31, 2023
@hickford
Copy link
Author

hickford commented Sep 9, 2023

@jgm @ischwarze @g-branden-robinson thank you for your thorough collaboration and prompt fix!

I regenerated with my man page, fixing the warnings hickford/git-credential-oauth@99abc35

kristapsdz added a commit to kristapsdz/lowdown that referenced this issue Sep 12, 2023
This has been many-times discussed online, e.g.:

jgm/pandoc#9020

The issue at heart is that the "C" font for roff (mandoc, groff, etc.)
is non-standard across output devices.  Prior to this change, lowdown
was emitting the "C" font for constant-width fonts (those `in
backticks`).  These were being discarded by mandoc and groff when on the
terminal, where "C" is unnecessary because everything is "C".  Mandoc
warned about it, but groff just silently let it go by until a recent
version displayed a warning message.

This introduces some changes.  First, "C" is retained by default for
-tms, although output as "CR" instead of "C".  The rationale is that
-ms is mostly used for formatting PDF/PS, which have the "C" font.
Second, "C" is no longer used for -tman: instead, a bold font is used.

However, the user can override this behaviour.  (This will be documented
in subsequent checkins.)  The --nroff-code-font (not yet finalised)
accepts a 4-tuple describing the constant width fonts, specifically
"regular,bold,italic,bold-italic".  This lets the user override the font
that will be coded into the output.  Three aliases exist: "none",
"bold", and "code".  "None" does not render a constant-width font at
all, and simply uses the regular font.  "Bold" uses a bold font
(obviously if it's a **`situation like this`**, the bold is kept as-is).
Finally, "code" uses the constant-width variants.

References #123
@ischwarze
Copy link

I regenerated with my man page, fixing the warnings hickford/git-credential-oauth@99abc35

Indeed, the man(7) code generated by Pandoc 3.1.7 is massively better regarding style, reliability, and portability than what you got from Pandoc 3.1.2 in the past. Really glad that so much progress was made here, this will probably save other Pandoc users quite some grief as well.

cjp256 added a commit to cjp256/azure-vm-utils that referenced this issue Jun 6, 2024
As pointed out by Noah in Azure#15, Debian packaging lints issues in the
generated manpage due to formatting emitted by older versions of pandoc:
jgm/pandoc#9020

While changes in recent versions of pandoc have improved the output,
let's just take the generated output from pandoc 3.2 as a starting point
and maintain it manually for the time being.  This reduces friction for
packaging and gives us flexibility if we wanted to do something in the
manpage that pandoc doesn't support.

Signed-off-by: Chris Patterson <[email protected]>
cjp256 added a commit to cjp256/azure-vm-utils that referenced this issue Jun 6, 2024
As pointed out by Noah in Azure#15, Debian packaging lints issues in the
generated manpage due to formatting emitted by older versions of pandoc:
jgm/pandoc#9020

While changes in recent versions of pandoc have improved the output,
let's just take the generated output from pandoc 3.2 as a starting point
and maintain it manually for the time being.  This reduces friction for
packaging and gives us flexibility if we wanted to do something in the
manpage that pandoc doesn't support.

Allow manpages to be generated at build-time with -DGENERATE_MANPAGES=1.

Signed-off-by: Chris Patterson <[email protected]>
cjp256 added a commit to cjp256/azure-vm-utils that referenced this issue Jun 6, 2024
As pointed out by Noah in Azure#15, Debian packaging lints issues in the
generated manpage due to formatting emitted by older versions of pandoc:
jgm/pandoc#9020

While changes in recent versions of pandoc have improved the output,
let's just take the generated output from pandoc 3.2 as a starting point
and maintain it manually for the time being.  This reduces friction for
packaging and gives us flexibility if we wanted to do something in the
manpage that pandoc doesn't support.

Allow manpages to be generated at build-time with -DGENERATE_MANPAGES=1
which will make it easy to sync.

Signed-off-by: Chris Patterson <[email protected]>
cjp256 added a commit to cjp256/azure-vm-utils that referenced this issue Jun 6, 2024
As pointed out by Noah in Azure#15, Debian packaging lints issues in the
generated manpage due to formatting emitted by older versions of pandoc:
jgm/pandoc#9020

While changes in recent versions of pandoc have improved the output,
let's just take the generated output from pandoc 3.2 as a starting point
and maintain it manually for the time being.  This reduces friction for
packaging and gives us flexibility if we wanted to do something in the
manpage that pandoc doesn't support.

Allow manpages to be generated at build-time with -DGENERATE_MANPAGES=1
which will make it easy to sync.

Signed-off-by: Chris Patterson <[email protected]>
cjp256 added a commit to cjp256/azure-vm-utils that referenced this issue Jun 6, 2024
As pointed out by Noah in Azure#15, Debian packaging lints issues in the
generated manpage due to formatting emitted by older versions of pandoc:
jgm/pandoc#9020

While changes in recent versions of pandoc have improved the output,
let's just take the generated output from pandoc 3.2 as a starting point
and maintain it manually for the time being.  This reduces friction for
packaging and gives us flexibility if we wanted to do something in the
manpage that pandoc doesn't support.

Allow manpages to be generated at build-time with -DGENERATE_MANPAGES=1
which will make it easy to sync.

Signed-off-by: Chris Patterson <[email protected]>
cjp256 added a commit to cjp256/azure-vm-utils that referenced this issue Jun 6, 2024
As pointed out by Noah in Azure#15, Debian packaging lints issues in the
generated manpage due to formatting emitted by older versions of pandoc:
jgm/pandoc#9020

While changes in recent versions of pandoc have improved the output,
let's just take the generated output from pandoc 3.2 as a starting point
and maintain it manually for the time being.  This reduces friction for
packaging and gives us flexibility if we wanted to do something in the
manpage that pandoc doesn't support.

Allow manpages to be generated at build-time with -DGENERATE_MANPAGES=1
which will make it easy to sync.

Signed-off-by: Chris Patterson <[email protected]>
cjp256 added a commit to cjp256/azure-vm-utils that referenced this issue Jun 6, 2024
As pointed out by Noah in Azure#15, Debian packaging lints issues in the
generated manpage due to formatting emitted by older versions of pandoc:
jgm/pandoc#9020

While changes in recent versions of pandoc have improved the output,
let's just take the generated output from pandoc 3.2 as a starting point
and maintain it manually for the time being.  This reduces friction for
packaging and gives us flexibility if we wanted to do something in the
manpage that pandoc doesn't support.

Allow manpages to be generated at build-time with -DGENERATE_MANPAGES=1
which will make it easy to sync.

Signed-off-by: Chris Patterson <[email protected]>
cjp256 added a commit to cjp256/azure-vm-utils that referenced this issue Jun 6, 2024
As pointed out by Noah in Azure#15, Debian packaging lints issues in the
generated manpage due to formatting emitted by older versions of pandoc:
jgm/pandoc#9020

While changes in recent versions of pandoc have improved the output,
let's just take the generated output from pandoc 3.2 as a starting point
and maintain it manually for the time being.  This reduces friction for
packaging and gives us flexibility if we wanted to do something in the
manpage that pandoc doesn't support.

Allow manpages to be generated at build-time with -DGENERATE_MANPAGES=1
which will make it easy to sync.

Signed-off-by: Chris Patterson <[email protected]>
cjp256 added a commit to cjp256/azure-vm-utils that referenced this issue Jun 6, 2024
As pointed out by Noah in Azure#15, Debian packaging lints issues in the
generated manpage due to formatting emitted by older versions of pandoc:
jgm/pandoc#9020

While changes in recent versions of pandoc have improved the output,
let's just take the generated output from pandoc 3.2 as a starting point
and maintain it manually for the time being.  This reduces friction for
packaging and gives us flexibility if we wanted to do something in the
manpage that pandoc doesn't support.

Allow manpages to be generated at build-time with -DGENERATE_MANPAGES=1
which will make it easy to sync.

Signed-off-by: Chris Patterson <[email protected]>
cjp256 added a commit to cjp256/azure-vm-utils that referenced this issue Jun 6, 2024
As pointed out by Noah in Azure#15, Debian packaging lints issues in the
generated manpage due to formatting emitted by older versions of pandoc:
jgm/pandoc#9020

While changes in recent versions of pandoc have improved the output,
let's just take the generated output from pandoc 3.2 as a starting point
and maintain it manually for the time being.  This reduces friction for
packaging and gives us flexibility if we wanted to do something in the
manpage that pandoc doesn't support.

Allow manpages to be generated at build-time with -DGENERATE_MANPAGES=1
which will make it easy to sync.

Signed-off-by: Chris Patterson <[email protected]>
cjp256 added a commit to cjp256/azure-vm-utils that referenced this issue Jun 10, 2024
As pointed out by Noah in Azure#15, Debian packaging lints issues in the
generated manpage due to formatting emitted by older versions of pandoc:
jgm/pandoc#9020

While changes in recent versions of pandoc have improved the output,
let's just take the generated output from pandoc 3.2 as a starting point
and maintain it manually for the time being.  This reduces friction for
packaging and gives us flexibility if we wanted to do something in the
manpage that pandoc doesn't support.

Allow manpages to be generated at build-time with -DGENERATE_MANPAGES=1
which will make it easy to sync.

Signed-off-by: Chris Patterson <[email protected]>
cjp256 added a commit to Azure/azure-vm-utils that referenced this issue Jun 10, 2024
As pointed out by Noah in #15, Debian packaging lints issues in the
generated manpage due to formatting emitted by older versions of pandoc:
jgm/pandoc#9020

While changes in recent versions of pandoc have improved the output,
let's just take the generated output from pandoc 3.2 as a starting point
and maintain it manually for the time being.  This reduces friction for
packaging and gives us flexibility if we wanted to do something in the
manpage that pandoc doesn't support.

Allow manpages to be generated at build-time with -DGENERATE_MANPAGES=1
which will make it easy to sync.

Signed-off-by: Chris Patterson <[email protected]>
saschalucas added a commit to saschalucas/ganeti that referenced this issue Jul 30, 2024
In certain pandoc versions invalid fonts in groff output are
generated[1]. Upstream seems to have fixed the issue[2], but as of now
this issue is present in Debian testing+sid and Ubuntu 24.04. Besides
the invalid fonts, the generated man-pages look fine. So ignore this
warning as a workaround.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1062045
[2] jgm/pandoc#9020

Signed-off-by: Sascha Lucas <[email protected]>
saschalucas added a commit to ganeti/ganeti that referenced this issue Aug 1, 2024
In certain pandoc versions invalid fonts in groff output are
generated[1]. Upstream seems to have fixed the issue[2], but as of now
this issue is present in Debian testing+sid and Ubuntu 24.04. Besides
the invalid fonts, the generated man-pages look fine. So ignore this
warning as a workaround.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1062045
[2] jgm/pandoc#9020

Signed-off-by: Sascha Lucas <[email protected]>
technomancy added a commit to bakpakin/Fennel that referenced this issue Aug 7, 2024
Older versions of pandoc try to set the font to a font that doesn't
actually exist. Older versions of groff don't care, but newer ones
will catch the mistake.

This has been fixed in pandoc 3 but we're not ready to declare a
dependency on a newer version since installing the whole haskell
toolchain is a lot for something that can be fixed with a trivial
sed.

jgm/pandoc#9020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants