doc/asciidoc: always apply Buildroot's AsciiDoc config
authorYann E. MORIN <yann.morin.1998@free.fr>
Fri, 3 Oct 2014 17:01:56 +0000 (19:01 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 12 Oct 2014 05:46:28 +0000 (07:46 +0200)
As suggested by Thomas: the AsciiDoc options we use ensure we get a sane
output of the document. We want that configuration to be applied to
other documents as well.

Up until now, it was implicit that the configuration was applied to
our manual, becasue we only supported document-specific configuration,
and the configuration we had was in our manual dir, so we got to use it.

But now, we can render other documents, especially ones from
br2-external, and we want those to also use the default configuration
from Buildroot, but still be able to provide their own customisation.

So, always add Buildroot's configuration first, if available, before we
append the document's configuration.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Samuel Martin <s.martin49@gmail.com>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Reviewed-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
docs/conf/asciidoc-text.conf [new file with mode: 0644]
docs/manual/asciidoc-text.conf [deleted file]
package/doc-asciidoc.mk

diff --git a/docs/conf/asciidoc-text.conf b/docs/conf/asciidoc-text.conf
new file mode 100644 (file)
index 0000000..470bdec
--- /dev/null
@@ -0,0 +1,23 @@
+# Refer to following asciidoc documentation:
+#     http://www.methods.co.nz/asciidoc/userguide.html
+# In particular sections "Macros" and "Attribute References"
+#
+# For hyperlinks, show 'link text [URL]' (if link text provided) or 'URL'
+[http-inlinemacro]
+{0=}{0? &#91;}{name}:{target}{0?&#93;}
+[https-inlinemacro]
+{0=}{0? &#91;}{name}:{target}{0?&#93;}
+[ftp-inlinemacro]
+{0=}{0? &#91;}{name}:{target}{0?&#93;}
+[file-inlinemacro]
+{0=}{0? &#91;}{name}:{target}{0?&#93;}
+[irc-inlinemacro]
+{0=}{0? &#91;}{name}:{target}{0?&#93;}
+[mailto-inlinemacro]
+{0=}{0? &#91;}{name}:{target}{0?&#93;}
+
+# Hide image representation from text manual
+[image-inlinemacro]
+{empty}
+[image-blockmacro]
+{empty}
diff --git a/docs/manual/asciidoc-text.conf b/docs/manual/asciidoc-text.conf
deleted file mode 100644 (file)
index 470bdec..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# Refer to following asciidoc documentation:
-#     http://www.methods.co.nz/asciidoc/userguide.html
-# In particular sections "Macros" and "Attribute References"
-#
-# For hyperlinks, show 'link text [URL]' (if link text provided) or 'URL'
-[http-inlinemacro]
-{0=}{0? &#91;}{name}:{target}{0?&#93;}
-[https-inlinemacro]
-{0=}{0? &#91;}{name}:{target}{0?&#93;}
-[ftp-inlinemacro]
-{0=}{0? &#91;}{name}:{target}{0?&#93;}
-[file-inlinemacro]
-{0=}{0? &#91;}{name}:{target}{0?&#93;}
-[irc-inlinemacro]
-{0=}{0? &#91;}{name}:{target}{0?&#93;}
-[mailto-inlinemacro]
-{0=}{0? &#91;}{name}:{target}{0?&#93;}
-
-# Hide image representation from text manual
-[image-inlinemacro]
-{empty}
-[image-blockmacro]
-{empty}
index 649ee69c6509e432af1d4c43b563d4ba5207152f..f59f9fa2f4f683e42b808451b656e65e01f581fa 100644 (file)
@@ -31,6 +31,9 @@ asciidoc-check-dependencies-pdf:
 GENDOC_XSLTPROC_IS_BROKEN = \
        $(shell xsltproc --maxvars 0 >/dev/null 2>/dev/null || echo y)
 
+# Apply this configuration to all documents
+BR_ASCIIDOC_CONF = docs/conf/asciidoc.conf
+
 ################################################################################
 # ASCIIDOC_INNER -- generates the make targets needed to build a specific type of
 #                   asciidoc documentation.
@@ -60,10 +63,23 @@ asciidoc-check-dependencies-$(5):
 $(1)-check-dependencies-$(5): asciidoc-check-dependencies-$(5)
        $$(Q)$$(foreach hook,$$($(2)_CHECK_DEPENDENCIES_$$(call UPPERCASE,$(5))_HOOKS),$$(call $$(hook))$$(sep))
 
+# Include Buildroot's AsciiDoc configuration first:
+#  - generic configuration,
+#  - then output-specific configuration
+ifneq ($$(wildcard $$(BR_ASCIIDOC_CONF)),)
+$(2)_$(4)_ASCIIDOC_OPTS += -f $$(BR_ASCIIDOC_CONF)
+endif
+BR_$(4)_ASCIIDOC_CONF = docs/conf/asciidoc-$(4).conf
+ifneq ($$(wildcard $$(BR_$(4)_ASCIIDOC_CONF)),)
+$(2)_$(4)_ASCIIDOC_OPTS += -f $$(BR_$(4)_ASCIIDOC_CONF)
+endif
+
+# Then include the document's AsciiDoc configuration:
+#  - generic configuration,
+#  - then output-specific configuration
 ifneq ($$(wildcard $$($(2)_ASCIIDOC_CONF)),)
 $(2)_$(4)_ASCIIDOC_OPTS += -f $$($(2)_ASCIIDOC_CONF)
 endif
-
 $(2)_$(4)_ASCIIDOC_CONF = $(3)/asciidoc-$(4).conf
 ifneq ($$(wildcard $$($(2)_$(4)_ASCIIDOC_CONF)),)
 $(2)_$(4)_ASCIIDOC_OPTS += -f $$($(2)_$(4)_ASCIIDOC_CONF)