From b9a9862de2070c283f5274ef6b76db6a7695c5c1 Mon Sep 17 00:00:00 2001 From: Eduardo de Santana Medeiros Alexandre Date: Sat, 19 Apr 2014 11:01:25 -0300 Subject: [PATCH] How to use attributes inside docinfo #19 I have created a `book-docinfo.xml` file because when people are going to try this with the book inside doc it will work. --- doc/asciidoc.txt | 24 ++++++++++++++++++++++++ doc/book-docinfo.xml | 1 + 2 files changed, 25 insertions(+) create mode 100644 doc/book-docinfo.xml diff --git a/doc/asciidoc.txt b/doc/asciidoc.txt index 4665dcf..e973729 100644 --- a/doc/asciidoc.txt +++ b/doc/asciidoc.txt @@ -719,6 +719,30 @@ DocBook:: distribution. The rendering of meta-data elements (or not) is DocBook processor dependent. +Using attributes inside docinfo ++++++++++++++++++++++++++++++++ + +You can use attributes inside your `docinfo`: + +---- +{edition} +---- + +And then: + + $ a2x -f pdf -a docinfo -a edition="Second" book.txt + +[TIP] +==== +With this, if you are writting your book in a version control system +you can extract the build number and use it as the Edition. Here's an +example +http://git-scm.com/book/en/Distributed-Git-Maintaining-a-Project#Generating-a-Build-Number[with +git]: + + $ a2x -f pdf -a docinfo -a edition=`git describe --tags` book.txt + +==== [[X86]] Preamble diff --git a/doc/book-docinfo.xml b/doc/book-docinfo.xml new file mode 100644 index 0000000..c0d66ee --- /dev/null +++ b/doc/book-docinfo.xml @@ -0,0 +1 @@ +{edition}