gbranden pushed a commit to branch master
in repository groff.
commit 37a5793e31cdc009c29ee2413e105b09eaf55846
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Jul 13 11:57:38 2026 -0500
[grohtml]: Ameliorate horrible UX.
* src/devices/grohtml/post-html.cpp (html_printer::writeHeadMetaStyle):
grohtml(1) has ignored the media width configured by the full-service
macro package or document forever, but employing a CSS 'max-width'
of--effectively--infinity, makes for painful reading. Configure the
`body` element with a `max-width` of `80ch`, which is a little wide
but congrues well with the default width used by groff man(7) and
mdoc(7). Moreover, these packages render nearly all of their content
indented, which brings the effective line length down to the 65n-75n
range advised by typography experts. Employ automatic margins on the
left and right to center the text on wide browser windows, and a
`padding` of 1em for ergonomics on "swipey" devices like tablets.
---
ChangeLog | 17 +++++++++++++++++
src/devices/grohtml/post-html.cpp | 2 ++
2 files changed, 19 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 340efd966..c0a76f2b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2026-07-13 G. Branden Robinson <[email protected]>
+
+ * src/devices/grohtml/post-html.cpp
+ (html_printer::writeHeadMetaStyle): Ameliorate horrible UX.
+ grohtml(1) has ignored the media width configured by the
+ full-service macro package or document forever, but employing a
+ CSS 'max-width' of--effectively--infinity, makes for painful
+ reading. Configure the `body` element with a `max-width` of
+ `80ch`, which is a little wide but congrues well with the
+ default width used by groff man(7) and mdoc(7). Moreover, these
+ packages render nearly all of their content indented, which
+ brings the effective line length down to the 65n-75n range
+ advised by typography experts. Employ automatic margins on the
+ left and right to center the text on wide browser windows, and a
+ `padding` of 1em for ergonomics on "swipey" devices like
+ tablets.
+
2026-07-13 G. Branden Robinson <[email protected]>
* tmac/an.tmac (EX, EE): When formatting for HTML, begin and
diff --git a/src/devices/grohtml/post-html.cpp
b/src/devices/grohtml/post-html.cpp
index 527c33a36..e6ddfbf29 100644
--- a/src/devices/grohtml/post-html.cpp
+++ b/src/devices/grohtml/post-html.cpp
@@ -5711,6 +5711,8 @@ void html_printer::writeHeadMetaStyle (void)
fputs(" table { margin-top: 0; margin-bottom: 0; "
"vertical-align: top }\n", stdout);
fputs(" h1 { text-align: center }\n", stdout);
+ fputs(" body { max-width: 80ch; margin-left: auto; "
+ "margin-right: auto; padding: 1em; }\n", stdout);
fputs(" .code-display { display: block; "
"font-family: monospace; }\n", stdout);
fputs(" .code-display p { margin-top: 0; margin-bottom: 0;"
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit