Login  Register

Re: Adding Document Control to title page

Posted by rockyallen on Apr 12, 2019; 5:57pm
URL: https://discuss.asciidoctor.org/Adding-Document-Control-to-title-page-tp6841p6844.html

Metro's route assumes you are using Docbook, but it sounds like you want to do it through asciidoctor-pdf.

For docbook all you need is the docinfo.xml file and a bit of xsl:

1. Create a docinfo.xml file. Asciidoctor automatically replaces attribute references like {author} in the docinfo file from your .adoc file.
2. Create a stylesheet with a modified title-page template that displays the data from the docinfo. This becomes a standard template that you can use for all documents.
3. Create a customisation layer that imports the docbook fo stylesheet, then imports your custom title page template, then has xsl:params for any metadata that you can't pack into the docinfo element (manager, approver etc).
4. Generate your document from your customisation layer.

This has the disadvantage that your metadata is spread over 2 files (attributes in master.adoc and xsl:param in the customisation layer), but you only type it once, and you don't need any programming.

For asciidoctor-pdf I don't know an easy way. One thing I haven't tried but might work is to create an SVG that contains the table data, then tell asciidoctor to use that file as a background image for the title page. You might need to play with the yml to move the title up the page enough to clear space for your table. For a one off you could handcraft the SVG (the SVG file format is trivial), or for many documents you could make a template for it.