Including (or linking to) XML files in asciidoc

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

Including (or linking to) XML files in asciidoc

m4rt1n
Hi!

I'm converting a rather lengthy guide into asciidoc, which I then want to convert into DocBook XML so it could be built with Publican. Instead of defining an author group within the asciidoc files, I'd love to just link to a static, already-existing Author_Group.xml file that could be linked to from the asciidoc file or simply pointed to (via an xi:include) in the converted output.

Is this possible in asciidoc? I assume linking to an XML file is a no no since that file cannot be read at the time of conversion. And adding something like link:Author_Group.xml[] only creates a ulink, rather than an xi:include.

Thanks for any help!
Martin
Reply | Threaded
Open this post in threaded view
|

Re: Including (or linking to) XML files in asciidoc

nawroth
Hi!

This might help you:

I have no idea about author group files though :-)

/anders

2014-09-09 17:45 GMT+02:00 m4rt1n [via Asciidoctor :: Discussion] <[hidden email]>:
Hi!

I'm converting a rather lengthy guide into asciidoc, which I then want to convert into DocBook XML so it could be built with Publican. Instead of defining an author group within the asciidoc files, I'd love to just link to a static, already-existing Author_Group.xml file that could be linked to from the asciidoc file or simply pointed to (via an xi:include) in the converted output.

Is this possible in asciidoc? I assume linking to an XML file is a no no since that file cannot be read at the time of conversion. And adding something like link:Author_Group.xml[] only creates a ulink, rather than an xi:include.

Thanks for any help!
Martin


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Including-or-linking-to-XML-files-in-asciidoc-tp2160.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Including (or linking to) XML files in asciidoc

mojavelinux
Administrator
There are two ways to embed XML content directly into the generated output. As Anders points out, one way to do this is using a passthrough block.

A passthrough block is the right solution when you need to insert content into the "body" of the document. It won't solve your problem if you need to insert something into the header, like the author group. For that, you'll want to use a docinfo file. In fact, the docinfo files were designed specifically to solve this problem.

Here's an example of the docinfo file for defining the author group and other header content in the RichFaces manual.


On Tue, Sep 9, 2014 at 11:09 AM, nawroth [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi!

This might help you:

I have no idea about author group files though :-)

/anders

2014-09-09 17:45 GMT+02:00 m4rt1n [via Asciidoctor :: Discussion] <[hidden email]>:
Hi!

I'm converting a rather lengthy guide into asciidoc, which I then want to convert into DocBook XML so it could be built with Publican. Instead of defining an author group within the asciidoc files, I'd love to just link to a static, already-existing Author_Group.xml file that could be linked to from the asciidoc file or simply pointed to (via an xi:include) in the converted output.

Is this possible in asciidoc? I assume linking to an XML file is a no no since that file cannot be read at the time of conversion. And adding something like link:Author_Group.xml[] only creates a ulink, rather than an xi:include.

Thanks for any help!
Martin


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Including-or-linking-to-XML-files-in-asciidoc-tp2160.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML




If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Including-or-linking-to-XML-files-in-asciidoc-tp2160p2161.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: Including (or linking to) XML files in asciidoc

mojavelinux
Administrator
In reply to this post by nawroth
Btw, in Asciidoctor, no subs are applied to a passthrough block by default. The subs="none" is only required when using AsciiDoc Python (without the asciidoc.conf file from Asciidoctor).

-Dan

On Tue, Sep 9, 2014 at 4:44 PM, Dan Allen <[hidden email]> wrote:
There are two ways to embed XML content directly into the generated output. As Anders points out, one way to do this is using a passthrough block.

A passthrough block is the right solution when you need to insert content into the "body" of the document. It won't solve your problem if you need to insert something into the header, like the author group. For that, you'll want to use a docinfo file. In fact, the docinfo files were designed specifically to solve this problem.

Here's an example of the docinfo file for defining the author group and other header content in the RichFaces manual.


On Tue, Sep 9, 2014 at 11:09 AM, nawroth [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi!

This might help you:

I have no idea about author group files though :-)

/anders

2014-09-09 17:45 GMT+02:00 m4rt1n [via Asciidoctor :: Discussion] <[hidden email]>:
Hi!

I'm converting a rather lengthy guide into asciidoc, which I then want to convert into DocBook XML so it could be built with Publican. Instead of defining an author group within the asciidoc files, I'd love to just link to a static, already-existing Author_Group.xml file that could be linked to from the asciidoc file or simply pointed to (via an xi:include) in the converted output.

Is this possible in asciidoc? I assume linking to an XML file is a no no since that file cannot be read at the time of conversion. And adding something like link:Author_Group.xml[] only creates a ulink, rather than an xi:include.

Thanks for any help!
Martin


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Including-or-linking-to-XML-files-in-asciidoc-tp2160.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML




If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Including-or-linking-to-XML-files-in-asciidoc-tp2160p2161.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--



--
Reply | Threaded
Open this post in threaded view
|

Re: Including (or linking to) XML files in asciidoc

m4rt1n
In reply to this post by mojavelinux
docinfo files are exactly what I was looking for! Dan, one question, I see the repo you link to also has a docinfo-footer.xml file that includes the revision history. I'd love to replicate this but am unable to do so. Is there an extra attribute to pass to asciidoctor when building with a footer file? I am using:

  asciidoctor -d book -b docbook -a nolang -a docinfo MyGuide.txt

Thanks again for your help.
Reply | Threaded
Open this post in threaded view
|

Re: Including (or linking to) XML files in asciidoc

mojavelinux
Administrator
Great to hear!

The footer file should be enabled, if present, when using the docinfo flag. For more information, refer to the docinfo section of the user manual. If those docs don't get you were you need to go, just let us know. We want them to be right.


Cheers,

-Dan

On Wed, Sep 10, 2014 at 5:52 AM, m4rt1n [via Asciidoctor :: Discussion] <[hidden email]> wrote:
docinfo files are exactly what I was looking for! Dan, one question, I see the repo you link to also has a docinfo-footer.xml file that includes the revision history. I'd love to replicate this but am unable to do so. Is there an extra attribute to pass to asciidoctor when building with a footer file? I am using:

  asciidoctor -d book -b docbook -a nolang -a docinfo MyGuide.txt

Thanks again for your help.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Including-or-linking-to-XML-files-in-asciidoc-tp2160p2174.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: Including (or linking to) XML files in asciidoc

m4rt1n
Huh, woke up this morning and it works as advertised :-) Not sure what I did differently today to build it but Revision History is added as expected.

Asciidoctor's user manual is terrific by the way!

Thanks again, Dan!

Martin