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

Add the posibility to pass the edition as an attribute #19

Closed
Closed
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
20 changes: 20 additions & 0 deletions doc/asciidoc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,26 @@ DocBook::
distribution. The rendering of meta-data elements (or not) is
DocBook processor dependent.

Passing the Edition as an attribute
+++++++++++++++++++++++++++++++++++

You can pass the `edition` of the book as an attribute:

$ a2x -f pdf -a edition="Second" book.txt

[WARNING]
If you are planning using it as an attribute, and were using it inside
<<X97,docinfo.xml>> you should remove the `edition` tag from there.
Asciidoc doesn't do any check, if you using it in both places (docinfo
and attribute) the generated xml will have two `edition` tags at the
`bookinfo` xml section.

If you are writting your book in a version control systems you can
extract a 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 edition=`git describe --tags` book.txt


[[X86]]
Preamble
Expand Down
3 changes: 3 additions & 0 deletions docbook45.conf
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,9 @@ template::[header-declarations]
<book lang="{lang=en}">
<bookinfo>
template::[docinfo]
# If you have specified the edition in your docinfo,
# docbook uses the last one, defined here:
{edition? <edition>{edition}</edition>}
</bookinfo>

[footer]
Expand Down