From c4ee49840e6233047717851e7731477481500f44 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Tue, 17 May 2016 19:30:39 -0400 Subject: [PATCH] doc/man: put AsciiDoc attributes in their own file MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This facilitates the generation of man pages using another asciidoc.conf file, but keeping the same attributes, without having to split the generated configuration file. Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- .gitignore | 2 +- configure.ac | 2 +- doc/man/Makefile.am | 6 +- ...sciidoc.conf.in => asciidoc-attrs.conf.in} | 119 ------------------ doc/man/asciidoc.conf | 118 +++++++++++++++++ 5 files changed, 124 insertions(+), 123 deletions(-) rename doc/man/{asciidoc.conf.in => asciidoc-attrs.conf.in} (56%) create mode 100644 doc/man/asciidoc.conf diff --git a/.gitignore b/.gitignore index f9fd809e2..ac78292e8 100644 --- a/.gitignore +++ b/.gitignore @@ -113,7 +113,7 @@ tests/regression/ust/python-logging/test_python_logging /doc/man/*.8 /doc/man/*.xml /doc/man/*.html -/doc/man/asciidoc.conf +/doc/man/asciidoc-attrs.conf !/doc/man/lttng-health-check.3 /benchmark/ diff --git a/configure.ac b/configure.ac index ddb294b21..c94da7adc 100644 --- a/configure.ac +++ b/configure.ac @@ -931,7 +931,7 @@ AC_CONFIG_FILES([ Makefile doc/Makefile doc/man/Makefile - doc/man/asciidoc.conf + doc/man/asciidoc-attrs.conf include/Makefile extras/Makefile extras/bindings/Makefile diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am index 22f569c5c..860c8be20 100644 --- a/doc/man/Makefile.am +++ b/doc/man/Makefile.am @@ -53,6 +53,7 @@ COMMON_TXT = \ # config ASCIIDOC_CONF = $(builddir)/asciidoc.conf +ASCIIDOC_ATTRS_CONF = $(builddir)/asciidoc-attrs.conf XSL_FILES = \ manpage.xsl \ manpage-callouts.xsl \ @@ -76,7 +77,7 @@ if MAN_PAGES_OPT # at this point, we know the user asked to build the man pages if HAVE_ASCIIDOC_XMLTO # tools -ADOC = $(ASCIIDOC) -f $(ASCIIDOC_CONF) -d manpage +ADOC = $(ASCIIDOC) -f $(ASCIIDOC_CONF) -f $(ASCIIDOC_ATTRS_CONF) -d manpage ADOC_DOCBOOK = $(ADOC) -b docbook XTO = $(XMLTO) -m $(firstword $(XSL_SRC_FILES)) man @@ -140,4 +141,5 @@ dist-hook: endif # !MAN_PAGES_OPT # always distribute the source files -EXTRA_DIST = $(MAN_TXT) $(COMMON_TXT) $(XSL_SRC_FILES) $(ASCIIDOC_CONF).in +EXTRA_DIST = $(MAN_TXT) $(COMMON_TXT) $(XSL_SRC_FILES) \ + $(ASCIIDOC_CONF) $(ASCIIDOC_ATTRS_CONF).in diff --git a/doc/man/asciidoc.conf.in b/doc/man/asciidoc-attrs.conf.in similarity index 56% rename from doc/man/asciidoc.conf.in rename to doc/man/asciidoc-attrs.conf.in index 3da5ac81c..83f59cd72 100644 --- a/doc/man/asciidoc.conf.in +++ b/doc/man/asciidoc-attrs.conf.in @@ -1,122 +1,3 @@ -[macros] - -# man macro -# -# Inspired by linkgit macro: -# -# -# Usage: man:command(manpage-section) -(?su)[\\]?(?Pman):(?P\S*?)\((?P.*?)\)= - -# linkgenoptions macro -# -# Usage: linkgenoptions:(text) -(?su)[\\]?(?Plinkgenoptions):\((?P.*?)\)= - -# no link option macro -# -# Usage: nloption:--option-name -(?su)[\\]?(?Pnloption):(?P--?[a-zA-Z0-9-]*)= - -# lttng(1) general option macro -# -# Usage: genoption:--option-name -(?su)[\\]?(?Pgenoption):(?P--?[a-zA-Z0-9-]*)= - -# option macro -# -# Usage: option:--option-name -(?su)[\\]?(?Poption):(?P--?[a-zA-Z0-9-]*)= - -# not macro -# -# Usage: :not: -:not:=not - -# escwc macro -# -# Usage: :escwc: -:escwc:=escwc - -# man macro expansions -ifdef::doctype-manpage[] -ifdef::backend-docbook[] -[man-inlinemacro] -{0%{target}} -{0#} -{0#{target}{0}} -{0#} -endif::backend-docbook[] -endif::doctype-manpage[] - -# linkgenoptions macro expansions -ifdef::doctype-manpage[] -ifdef::backend-docbook[] -[linkgenoptions-inlinemacro] -{text} -endif::backend-docbook[] -endif::doctype-manpage[] - -# option macro expansions -ifdef::doctype-manpage[] -ifdef::backend-docbook[] -[option-inlinemacro] -{opt} -endif::backend-docbook[] -endif::doctype-manpage[] - -# no link option macro expansions -ifdef::doctype-manpage[] -ifdef::backend-docbook[] -[nloption-inlinemacro] -{opt} -endif::backend-docbook[] -endif::doctype-manpage[] - -# lttng(1) general option macro expansions -ifdef::doctype-manpage[] -ifdef::backend-docbook[] -[genoption-inlinemacro] -{opt} -endif::backend-docbook[] -endif::doctype-manpage[] - -# not macro expansions -ifdef::doctype-manpage[] -ifdef::backend-docbook[] -[not-inlinemacro] -NOT -endif::backend-docbook[] -endif::doctype-manpage[] - -# escwc macro expansions -ifdef::doctype-manpage[] -ifdef::backend-docbook[] -[escwc-inlinemacro] -\e* -endif::backend-docbook[] -endif::doctype-manpage[] - -# configure XML man page header -ifdef::doctype-manpage[] -ifdef::backend-docbook[] -[header] -template::[header-declarations] - - -{mantitle} -{manvolnum} -LTTng -{lttng_version} -LTTng Manual - - - {manname} - {manpurpose} - -endif::backend-docbook[] -endif::doctype-manpage[] - [attributes] # default values default_agent_tcp_port="@DEFAULT_AGENT_TCP_PORT@" diff --git a/doc/man/asciidoc.conf b/doc/man/asciidoc.conf new file mode 100644 index 000000000..70bd7d68a --- /dev/null +++ b/doc/man/asciidoc.conf @@ -0,0 +1,118 @@ +[macros] + +# man macro +# +# Inspired by linkgit macro: +# +# +# Usage: man:command(manpage-section) +(?su)[\\]?(?Pman):(?P\S*?)\((?P.*?)\)= + +# linkgenoptions macro +# +# Usage: linkgenoptions:(text) +(?su)[\\]?(?Plinkgenoptions):\((?P.*?)\)= + +# no link option macro +# +# Usage: nloption:--option-name +(?su)[\\]?(?Pnloption):(?P--?[a-zA-Z0-9-]*)= + +# lttng(1) general option macro +# +# Usage: genoption:--option-name +(?su)[\\]?(?Pgenoption):(?P--?[a-zA-Z0-9-]*)= + +# option macro +# +# Usage: option:--option-name +(?su)[\\]?(?Poption):(?P--?[a-zA-Z0-9-]*)= + +# not macro +# +# Usage: :not: +:not:=not + +# escwc macro +# +# Usage: :escwc: +:escwc:=escwc + +# man macro expansions +ifdef::doctype-manpage[] +ifdef::backend-docbook[] +[man-inlinemacro] +{0%{target}} +{0#} +{0#{target}{0}} +{0#} +endif::backend-docbook[] +endif::doctype-manpage[] + +# linkgenoptions macro expansions +ifdef::doctype-manpage[] +ifdef::backend-docbook[] +[linkgenoptions-inlinemacro] +{text} +endif::backend-docbook[] +endif::doctype-manpage[] + +# option macro expansions +ifdef::doctype-manpage[] +ifdef::backend-docbook[] +[option-inlinemacro] +{opt} +endif::backend-docbook[] +endif::doctype-manpage[] + +# no link option macro expansions +ifdef::doctype-manpage[] +ifdef::backend-docbook[] +[nloption-inlinemacro] +{opt} +endif::backend-docbook[] +endif::doctype-manpage[] + +# lttng(1) general option macro expansions +ifdef::doctype-manpage[] +ifdef::backend-docbook[] +[genoption-inlinemacro] +{opt} +endif::backend-docbook[] +endif::doctype-manpage[] + +# not macro expansions +ifdef::doctype-manpage[] +ifdef::backend-docbook[] +[not-inlinemacro] +NOT +endif::backend-docbook[] +endif::doctype-manpage[] + +# escwc macro expansions +ifdef::doctype-manpage[] +ifdef::backend-docbook[] +[escwc-inlinemacro] +\e* +endif::backend-docbook[] +endif::doctype-manpage[] + +# configure XML man page header +ifdef::doctype-manpage[] +ifdef::backend-docbook[] +[header] +template::[header-declarations] + + +{mantitle} +{manvolnum} +LTTng +{lttng_version} +LTTng Manual + + + {manname} + {manpurpose} + +endif::backend-docbook[] +endif::doctype-manpage[] -- 2.34.1