Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

How to use attributes inside docinfo #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions doc/asciidoc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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>{edition}</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
Expand Down
1 change: 1 addition & 0 deletions doc/book-docinfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<edition>{edition}</edition>