Trouble trying to get DocInfo to work...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Trouble trying to get DocInfo to work...

steveg
I am creating a DocBook from my adoc and having trouble getting DocInfo to work.   Unless I am mistaken, the DocInfo feature should allow me to insert elements into the <info> tag of the created DocBook.

To test this I have created the following test case (uploaded as files) .

test.adoc - Contains main document
docinfo.xml - Infomation to be included

I am creating the DocBook using the following command (using the ruby Asciidoctor 2.0.10 version running on windows).

asciidoctor --backend docbook --doctype book --out-file .\test.docbook .\test.adoc

The resulting file test.docbook, does not contain the information from docinfo.xml.

I have tried several variants (private vs shared, header with no footer etc) and have been unable to get this to work.  This test case uses  shared-head 

Any help would be appreciated.

Cheers
Steve


Reply | Threaded
Open this post in threaded view
|

Re: Trouble trying to get DocInfo to work...

Andrew Carver
Would you please double-check that your XML file is well-formed? When I clicked on the link for it, my browser reported:

This page contains the following errors:
error on line 2 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.
This is the subtitle
Reply | Threaded
Open this post in threaded view
|

Re: Trouble trying to get DocInfo to work...

steveg
Thanks for the reply.   Yes, the XML is invalid, as it does not have a root node.

<subtitle>This is the subtitle</subtitle>
<productname>Product Name</productname>
<productnumber>Product Number</productnumber>

Instead of

<info>
<subtitle>This is the subtitle</subtitle>
<productname>Product Name</productname>
<productnumber>Product Number</productnumber>
</info>

I did this as the documentation did not include the <info> tag, and that is also how the real life example worked.  I will see if adding in the info tag makes a difference.
Reply | Threaded
Open this post in threaded view
|

Re: Trouble trying to get DocInfo to work...

steveg
I tried the following enclosing the XML in a <info> tag with no change in behavior.

The content is still not being included.

For completeness, here is the new docinfo.xml file with the <info> tags.

docinfo.xml

Reply | Threaded
Open this post in threaded view
|

Re: Trouble trying to get DocInfo to work...

mojavelinux
Administrator
In reply to this post by steveg
In order for docinfo to be picked up, you have to enable it. See https://asciidoctor.org/docs/user-manual/#naming-docinfo-files

Best Regards,

-Dan

On Fri, Sep 11, 2020 at 7:26 PM steveg [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I am creating a DocBook from my adoc and having trouble getting DocInfo to work.   Unless I am mistaken, the DocInfo feature should allow me to insert elements into the <info> tag of the created DocBook.

To test this I have created the following test case (uploaded as files) .

test.adoc - Contains main document
docinfo.xml - Infomation to be included

I am creating the DocBook using the following command (using the ruby Asciidoctor 2.0.10 version running on windows).

asciidoctor --backend docbook --doctype book --out-file .\test.docbook .\test.adoc

The resulting file test.docbook, does not contain the information from docinfo.xml.

I have tried several variants (private vs shared, header with no footer etc) and have been unable to get this to work.  This test case uses  shared-head 

Any help would be appreciated.

Cheers
Steve





If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Trouble-trying-to-get-DocInfo-to-work-tp8239.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Trouble trying to get DocInfo to work...

steveg
Dan - thanks for the reply.

I think I have in that my main ascii.doc file (test.adoc) has the following attribute set.

:docinfo: shared-head

on line 2

Is there more that I need to do?

Cheers
Steve
Reply | Threaded
Open this post in threaded view
|

Re: Trouble trying to get DocInfo to work...

mojavelinux
Administrator
The problem is that you are modifying the extension of the output file (from .xml to .docbook). As a result, you must also rename your docinfo file from docinfo.xml to docinfo.docbook.

Best Regards,

-Dan

On Sat, Sep 12, 2020 at 2:58 AM steveg [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Dan - thanks for the reply.

I think I have in that my main ascii.doc file (test.adoc) has the following attribute set.

:docinfo: shared-head

on line 2

Is there more that I need to do?

Cheers
Steve



If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Trouble-trying-to-get-DocInfo-to-work-tp8239p8244.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Trouble trying to get DocInfo to work...

steveg
Many thanks - I just tried it and it works.

I have been stuck trying to resolve this for way too long!

Cheers
Steve