diff --git a/doc/Makefile.am b/doc/Makefile.am
index c5802ca88..a8a00468c 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -87,9 +87,10 @@ all: bemans html-pages
dist_doc_DATA = backend-writing.txt
nobase_dist_doc_DATA = $(BEDOCS)
EXTRA_DIST += descriptions.txt releases.md sane-logo2.jpg sane-logo.png \
- sane.png
+ sane.png man-html.css
MAN2HTML = mandoc -T utf8 -T html \
+ -O style=$(srcdir)/man-html.css -W unsupp -W error -W warning \
| sed 's|\([^<]*\)(\([0-9]\))|\1(\2)|g'
%.1 %.5 %.7 %.8: %.man
@@ -215,7 +216,7 @@ install-data-local: install-beman5
uninstall-local:
rm -rf $(DESTDIR)$(beman5dir)/sane-*.5
-html-man: $(MANPAGES)
+html-man: $(MANPAGES) $(srcdir)/man.css
@for page in $(MANPAGES); do \
echo "translating $${page} to $${page}.html..."; \
cat $${page} | $(MAN2HTML) > $${page}.html; \
diff --git a/doc/man-html.css b/doc/man-html.css
new file mode 100644
index 000000000..30258332a
--- /dev/null
+++ b/doc/man-html.css
@@ -0,0 +1,17 @@
+/* doc/man-html.css -- styling for HTML formatted manual pages
+ Copyright (C) 2021 SANE Project
+
+ SPDX-License-Identifier: CC-BY-SA-4.0
+ */
+
+/* These are the mandoc defaults and still need to be tweaked to
+ something suitable for the project's website. Maybe the SANE
+ Standard style is a good target.
+ */
+
+div.Pp { margin: 1ex 0ex; }
+div.Nd, div.Bf, div.Op { display: inline; }
+span.Pa, span.Ad { font-style: italic; }
+span.Ms { font-weight: bold; }
+dl.Bl-diag > dt { font-weight: bold; }
+code.Nm, code.Fl, code.Cm, code.Ic, code.In, code.Fd, code.Fn, code.Cd { font-weight: bold; font-family: inherit; }