mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-03 07:45:17 +00:00
Documentation: Allow to use asciidoctor for formatting man pages
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@suse.de> Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
committed by
Andrei Vagin
parent
f73e5d181b
commit
0493724c8e
@@ -2,8 +2,13 @@ __nmk_dir ?= ../scripts/nmk/scripts/
|
|||||||
include $(__nmk_dir)include.mk
|
include $(__nmk_dir)include.mk
|
||||||
include $(__nmk_dir)macro.mk
|
include $(__nmk_dir)macro.mk
|
||||||
|
|
||||||
|
ifneq ($(USE_ASCIIDOCTOR),)
|
||||||
|
ASCIIDOC := asciidoctor
|
||||||
|
XMLTO :=
|
||||||
|
else
|
||||||
ASCIIDOC := asciidoc
|
ASCIIDOC := asciidoc
|
||||||
XMLTO := xmlto
|
XMLTO := xmlto
|
||||||
|
endif
|
||||||
|
|
||||||
FOOTER := footer.txt
|
FOOTER := footer.txt
|
||||||
SRC1 += crit.txt
|
SRC1 += crit.txt
|
||||||
@@ -44,13 +49,21 @@ $(FOOTER): ../Makefile.versions
|
|||||||
|
|
||||||
%.1: %.txt $(FOOTER) custom.xsl
|
%.1: %.txt $(FOOTER) custom.xsl
|
||||||
$(call msg-gen, $@)
|
$(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) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.1,%.xml,$@) $<
|
||||||
$(Q) $(XMLTO) man -m custom.xsl $(patsubst %.1,%.xml,$@) 2>/dev/null
|
$(Q) $(XMLTO) man -m custom.xsl $(patsubst %.1,%.xml,$@) 2>/dev/null
|
||||||
|
endif
|
||||||
|
|
||||||
%.8: %.txt $(FOOTER) custom.xsl
|
%.8: %.txt $(FOOTER) custom.xsl
|
||||||
$(call msg-gen, $@)
|
$(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) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.8,%.xml,$@) $<
|
||||||
$(Q) $(XMLTO) man -m custom.xsl $(patsubst %.8,%.xml,$@) 2>/dev/null
|
$(Q) $(XMLTO) man -m custom.xsl $(patsubst %.8,%.xml,$@) 2>/dev/null
|
||||||
|
endif
|
||||||
|
|
||||||
%.ps: %.1
|
%.ps: %.1
|
||||||
$(call msg-gen, $@)
|
$(call msg-gen, $@)
|
||||||
|
@@ -1,5 +1,10 @@
|
|||||||
|
ifneq ($(USE_ASCIIDOCTOR),)
|
||||||
|
ASCIIDOC := asciidoctor
|
||||||
|
XMLTO :=
|
||||||
|
else
|
||||||
ASCIIDOC := asciidoc
|
ASCIIDOC := asciidoc
|
||||||
XMLTO := xmlto
|
XMLTO := xmlto
|
||||||
|
endif
|
||||||
PS2PDF := ps2pdf
|
PS2PDF := ps2pdf
|
||||||
|
|
||||||
SRC += nmk.txt
|
SRC += nmk.txt
|
||||||
@@ -25,8 +30,12 @@ check:
|
|||||||
|
|
||||||
%.8: %.txt
|
%.8: %.txt
|
||||||
$(call msg-gen, $@)
|
$(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) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.8,%.xml,$@) $<
|
||||||
$(Q) $(XMLTO) man --skip-validation $(patsubst %.8,%.xml,$@) 2>/dev/null
|
$(Q) $(XMLTO) man --skip-validation $(patsubst %.8,%.xml,$@) 2>/dev/null
|
||||||
|
endif
|
||||||
|
|
||||||
%.ps: %.8
|
%.ps: %.8
|
||||||
$(call msg-gen, $@)
|
$(call msg-gen, $@)
|
||||||
|
@@ -8,8 +8,13 @@ endif
|
|||||||
|
|
||||||
export E Q
|
export E Q
|
||||||
|
|
||||||
|
ifneq ($(USE_ASCIIDOCTOR),)
|
||||||
|
ASCIIDOC := asciidoctor
|
||||||
|
XMLTO :=
|
||||||
|
else
|
||||||
ASCIIDOC := asciidoc
|
ASCIIDOC := asciidoc
|
||||||
XMLTO := xmlto
|
XMLTO := xmlto
|
||||||
|
endif
|
||||||
|
|
||||||
SRC += bers.txt
|
SRC += bers.txt
|
||||||
XMLS := $(patsubst %.txt,%.xml,$(SRC))
|
XMLS := $(patsubst %.txt,%.xml,$(SRC))
|
||||||
@@ -17,8 +22,12 @@ MANS := $(patsubst %.txt,%.8,$(SRC))
|
|||||||
|
|
||||||
%.8: %.txt
|
%.8: %.txt
|
||||||
$(E) " GEN " $@
|
$(E) " GEN " $@
|
||||||
|
ifneq ($(USE_ASCIIDOCTOR),)
|
||||||
|
$(Q) $(ASCIIDOC) -b manpage -d manpage -o $@ $<
|
||||||
|
else
|
||||||
$(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.8,%.xml,$@) $<
|
$(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.8,%.xml,$@) $<
|
||||||
$(Q) $(XMLTO) man --skip-validation $(patsubst %.8,%.xml,$@) 2>/dev/null
|
$(Q) $(XMLTO) man --skip-validation $(patsubst %.8,%.xml,$@) 2>/dev/null
|
||||||
|
endif
|
||||||
|
|
||||||
docs: $(MANS)
|
docs: $(MANS)
|
||||||
@true
|
@true
|
||||||
|
Reference in New Issue
Block a user