Skip to content

Commit b9a9862

Browse files
committed
How to use attributes inside docinfo asciidoc-py#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.
1 parent 051faf6 commit b9a9862

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

doc/asciidoc.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,30 @@ DocBook::
719719
distribution. The rendering of meta-data elements (or not) is
720720
DocBook processor dependent.
721721

722+
Using attributes inside docinfo
723+
+++++++++++++++++++++++++++++++
724+
725+
You can use attributes inside your `docinfo`:
726+
727+
----
728+
<edition>{edition}</edition>
729+
----
730+
731+
And then:
732+
733+
$ a2x -f pdf -a docinfo -a edition="Second" book.txt
734+
735+
[TIP]
736+
====
737+
With this, if you are writting your book in a version control system
738+
you can extract the build number and use it as the Edition. Here's an
739+
example
740+
http://git-scm.com/book/en/Distributed-Git-Maintaining-a-Project#Generating-a-Build-Number[with
741+
git]:
742+
743+
$ a2x -f pdf -a docinfo -a edition=`git describe --tags` book.txt
744+
745+
====
722746

723747
[[X86]]
724748
Preamble

doc/book-docinfo.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<edition>{edition}</edition>

0 commit comments

Comments
 (0)