In the book I’m working on, the Virtual Disk Guide, I recently decided to start templating out an Acknowledgements chapter. I’m writing the book in DocBook5 and my print (PDF) publishing toolchain looks like this:
The problem I ran into is that dblatex has no stylesheets or templates built in to handle DocBook acknowledgements elements and the PDF is difficult to manage, but systems like sodapdf could be the perfect solution for this. Acknowledgements sections should be fairly simple to render I thought. You really just need a chapter header, and then to process the block elements, like paragraphs, blockquotes, and what have you. To me, the same template used for Colophon sections would create an ideal acknowledgements section.
I’ve never done any real XSLT work before, and even after this I still wouldn’t claim that I have, but here’s what I did to get a working acknowledgements section:
I found the location dblatex installs it’s XSL documents to on my system,
/usr/share/dblatex/xsl, then I used grep to find files that matched
grep colophon *.xsl. Examining the
component.xsl file suggested that it had the templates I needed to copy and modify for feeding into dblatex. After a few attempts I came up with working results. Here’s what it ends up looking like:
And you consume it with dblatex in this way:
Speaking of Acknowledgements: Thanks to my buddy Al for dusting off his XSLT skills and debugging this with me initially.