[CRIU] [PATCH 2/2] Documentation: Allow to use asciidoctor for formatting man pages

Takashi Iwai tiwai at suse.de
Wed Jan 16 12:27:47 MSK 2019


Since asciidoc is based on Phyton 2, we want to move to alternative,
and a promising one is asciidoctor.  This patch allows to use
asciidoctor for formatting man pages instead of asiidoc, by passing
a make option, USE_ASCIIDOCTOR=yes.

Although asciidoctor is almost compatible with asciidoc, it can
produce a man page directly from a text file without XML, which is
more efficiently.  So in asciidoctor mode, we don't require xmlto.

Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
 Documentation/Makefile | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 3c93ec8a4083..aa5d3ebbf652 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -2,8 +2,13 @@ __nmk_dir ?= ../scripts/nmk/scripts/
 include $(__nmk_dir)include.mk
 include $(__nmk_dir)macro.mk
 
+ifneq ($(USE_ASCIIDOCTOR),)
+ASCIIDOC	:= asciidoctor
+XMLTO		:=
+else
 ASCIIDOC	:= asciidoc
 XMLTO		:= xmlto
+endif
 
 FOOTER		:= footer.txt
 SRC1		+= crit.txt
@@ -44,13 +49,21 @@ $(FOOTER): ../Makefile.versions
 
 %.1: %.txt $(FOOTER) custom.xsl
 	$(call msg-gen, $@)
+ifneq ($(USE_ASCIIDOCTOR),)
+	$(Q) $(ASCIIDOC) -b manpage -d manpage -o $@ $<
+else
 	$(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.1,%.xml,$@) $<
 	$(Q) $(XMLTO) man -m custom.xsl $(patsubst %.1,%.xml,$@) 2>/dev/null
+endif
 
 %.8: %.txt $(FOOTER) custom.xsl
 	$(call msg-gen, $@)
+ifneq ($(USE_ASCIIDOCTOR),)
+	$(Q) $(ASCIIDOC) -b manpage -d manpage -o $@ $<
+else
 	$(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.8,%.xml,$@) $<
 	$(Q) $(XMLTO) man -m custom.xsl $(patsubst %.8,%.xml,$@) 2>/dev/null
+endif
 
 %.ps: %.1
 	$(call msg-gen, $@)
-- 
2.20.1



More information about the CRIU mailing list