[CRIU] [PATCH 3/4] Documentation: prettify the man page

Kir Kolyshkin kir at openvz.org
Mon Sep 19 13:58:18 PDT 2016


This adds a way to re-enable justification and hyphenation for
the man page (which in enabled by default in troff but then
Docbook explicitly disables it). The man page looks better this way.

The reason why hyphenation for man pages is disabled by Docbook is
"The problem is that groff is not particularly smart about how it
does hyphenation; it can end up hyphenating a lot of things that you
don't want hyphenated".

The reason why justification for man pages is disabled by Docbook is
"justified text looks good only when it is also hyphenated.
Without hyphenation, excessive amounts of space often end up
getting between words, in order to "pad" lines out to align
on the right margin".

I carefully checked the resuling man page using both terminal output
on 80 columns and the PS/PDF generated. In both cases hyphenation
looks normal, i.e. I don't see any unwanted cases of extra hyphenation.
Same for justification.

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 Documentation/Makefile   | 2 +-
 Documentation/custom.xsl | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/custom.xsl

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 34f611f..77c4281 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -41,7 +41,7 @@ $(SRC): $(FOOTER)
 %.8: %.txt
 	$(call msg-gen, $@)
 	$(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.8,%.xml,$@) $<
-	$(Q) $(XMLTO) man --skip-validation $(patsubst %.8,%.xml,$@) 2>/dev/null
+	$(Q) $(XMLTO) man -m custom.xsl $(patsubst %.8,%.xml,$@) 2>/dev/null
 
 %.ps: %.8
 	$(call msg-gen, $@)
diff --git a/Documentation/custom.xsl b/Documentation/custom.xsl
new file mode 100644
index 0000000..0826f7c
--- /dev/null
+++ b/Documentation/custom.xsl
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+ <xsl:param name="man.hyphenate">1</xsl:param>
+ <xsl:param name="man.justify">1</xsl:param>
+
+</xsl:stylesheet>
-- 
2.7.4



More information about the CRIU mailing list