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

Hyphenation in the man page #131

Open
d-e-s-o opened this issue Oct 4, 2020 · 7 comments
Open

Hyphenation in the man page #131

d-e-s-o opened this issue Oct 4, 2020 · 7 comments

Comments

@d-e-s-o
Copy link
Owner

d-e-s-o commented Oct 4, 2020

Here is what a certain page of the manual currently looks like:
pdf

To me, it's confusing and actively wrong to hyphenate "code snippets" (whatever you may call them) the way it is happening. I even saw NITROCLI_ being hyphenated.

I found this manual page on how to control hyphenation.

It seems we could actually define hyphenation for words including their formatting:

.hw \fBnitrocli\fR \fB\-\-login\fR

And it appears as if that may be working. But of course...oh this pain. Maintaining a list of all bold/italic words... And then there is the issue that \fB\-\-no\-capslock\fR actually has a more or less natural hyphenation point (at the third hyphen), but if we wanted to honor that the result won't be displayed as intended:
hyphen

Any other ideas? I think we could hack together infrastructure that generates a list of all bold/italic words as part of make doc and includes them from the "main" man page file.

@d-e-s-o
Copy link
Owner Author

d-e-s-o commented Oct 4, 2020

Oh, well, it seems that we can use \% for that purpose.

\%\fB\-\-login\fR

That may be good enough then. I wonder when we reach a point where the actual text can no longer be deciphered from all the cryptic !#&*(!@# surrounding it.

@robinkrahl
Copy link
Collaborator

robinkrahl commented Oct 4, 2020 via email

@d-e-s-o
Copy link
Owner Author

d-e-s-o commented Oct 4, 2020

  • Even worse than this wrapping problem are the code examples. My suggestion would be to hard-wrap them at 80 characters because this is a typical width for man viewers and it should also work for the PS/PDF output.

Yeah. I was just experimenting with .EX & .EE but they just blow through any margins:
screen
(first two are wrapped in these macros, the third isn't)

  • groff recommends that sentences are separated by multiple spaces or by a newline (see groff(7)). This enables cool features like better spacing when filling lines.

Interesting. Which section is that in? Can't find it off hand.

Perhaps we should get back to the initial discussion of whether we should really be writing in groff directly. If there was a neat higher level language that would just spit out that stuff and take care of the fine details itself, that would be my preferred choice.

@robinkrahl
Copy link
Collaborator

robinkrahl commented Oct 4, 2020 via email

@robinkrahl
Copy link
Collaborator

I had another look at the two options. As far as I see, scdoc does not support manipulating the hyphenation settings. pod2man just disables hyphenation for the entire manpage. The result does not look as bad as I thought, but I’d still prefer proper hyphenation if possible.

By the way, would you consider automatically generating the PDF file (and possibly an HTML version?) and pushing it to some webspace, e. g. GitHub Pages? Shouldn’t be too difficult with GitHub Actions.

@d-e-s-o
Copy link
Owner Author

d-e-s-o commented Apr 18, 2021

Yeah, no hyphenation may be better than what we currently have.

By the way, would you consider automatically generating the PDF file (and possibly an HTML version?) and pushing it to some webspace, e. g. GitHub Pages? Shouldn’t be too difficult with GitHub Actions.

Yeah, we could do that. Ideally it would at least use the same commands / Makefile magic as we would use locally.

@robinkrahl
Copy link
Collaborator

For reference, sequoia uses this tool to generate man pages from clap (output).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants