summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2018-02-02 20:51:25 +0100
committerDavid Sterba <dsterba@suse.com>2018-02-02 21:02:13 +0100
commit652544f4c01b8b1a2ab1705cec33af337ffae2ff (patch)
tree1cf2285c536c52af817dd444ab34cc347386c429 /Documentation
parent4523dc2776783ecd2fb1e3c72997f23ac2c3b975 (diff)
btrfs-progs: build: add support for asciidoctor doc generator
We've been using asciidoc that's written in python2, which is going to be phased out and deprecated next year. There's a replacement, asciidoctor. Add a configure-time detection which tool is available, update Documentation/Makefile.in. The original asciidoc tool is still preferred as it produces slightly better output. The file asciidoc.conf does not have a direct equivalten in asciidoct and would need to be replaced by extension written in ruby. The differences: - the <literal> are not automatically underlined and are less visible in the generated manual page, but it's still acceptable - the inline CSS for the html output looks subjectively worse, is less compact and colourful Issue: #89 Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/Makefile.in27
1 files changed, 18 insertions, 9 deletions
diff --git a/Documentation/Makefile.in b/Documentation/Makefile.in
index 8668e0ed..64947afb 100644
--- a/Documentation/Makefile.in
+++ b/Documentation/Makefile.in
@@ -46,8 +46,21 @@ man3dir = $(mandir)/man3
man5dir = $(mandir)/man5
man8dir = $(mandir)/man8
+ifeq (@ASCIIDOC_TOOL@,asciidoc)
ASCIIDOC = @ASCIIDOC@
-ASCIIDOC_EXTRA =
+ASCIIDOC_ARGS = -abtrfs_version=$(BTRFS_VERSION) -f asciidoc.conf
+ASCIIDOC_HTML = html
+ASCIIDOC_DOCBOOK = docbook
+ASCIIDOC_DEPS = asciidoc.conf
+endif
+ifeq (@ASCIIDOC_TOOL@,asciidoctor)
+ASCIIDOC = @ASCIIDOCTOR@
+ASCIIDOC_ARGS = -abtrfs_version=$(BTRFS_VERSION)
+ASCIIDOC_HTML = xhtml5
+ASCIIDOC_DOCBOOK = docbook45
+ASCIIDOC_DEPS =
+endif
+
MANPAGE_XSL = manpage-normal.xsl
XMLTO = @XMLTO@
XMLTO_EXTRA =
@@ -121,16 +134,12 @@ clean:
$(QUIET_XMLTO)$(RM) -f $@ && \
$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
-%.xml : %.asciidoc asciidoc.conf
+%.xml : %.asciidoc $(ASCIIDOC_DEPS)
$(QUIET_ASCIIDOC)$(RM) -f $@+ $@ && \
- $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
- $(ASCIIDOC_EXTRA) -abtrfs_version=$(BTRFS_VERSION) \
- -o $@+ $< && \
+ $(ASCIIDOC) $(ASCIIDOC_ARGS) -b $(ASCIIDOC_DOCBOOK) -d manpage -o $@+ $< && \
$(MV) $@+ $@
-%.html : %.asciidoc asciidoc.conf
+%.html : %.asciidoc $(ASCIIDOC_DEPS)
$(QUIET_ASCIIDOC)$(RM) -f $@+ $@ && \
- $(ASCIIDOC) -b html -d article -f asciidoc.conf \
- $(ASCIIDOC_EXTRA) -abtrfs_version=$(BTRFS_VERSION) \
- -o $@+ $< && \
+ $(ASCIIDOC) $(ASCIIDOC_ARGS) -b $(ASCIIDOC_HTML) -d article -o $@+ $< && \
$(MV) $@+ $@