Asciidoctor XML listing and tags

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

Asciidoctor XML listing and tags

Jeremie Bresson
I would like to use:
* An XML source listing
* An include (the code of the listing is in an external file)
* An the "tags" attribute to pick only interesting lines.

Here an example:
File: example.xml
====
<some>
  <!-- tag::myTag[] -->
  <content>Hello World</content>
  <!-- end::myTag[] -->
</some>
====

File: example-manual.adoc
====
= Example Manual
Doc Writer <doc.writer@example.org>
v1.0, 2014-09-09

[[lst-all]]
[source,xml]
.Some XML content (without Tags)
----
include::example.xml[]
----

[[lst-withTag]]
[source,xml]
.Some XML content (with Tags)
----
include::example.xml[tags=myTag]
----
====

What did I miss? Is this a bug/limitation?
Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctor XML listing and tags

mojavelinux
Administrator
Jérémie,

This is expected to work. However, at one time includes from XML files were broken in Asciidoctor. I can confirm it is working Asciidoctor 1.5.2.

Are you getting a warning that the tag can't be found? Or something else?

-Dan

On Tue, Oct 27, 2015 at 11:51 PM, Jeremie Bresson [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I would like to use:
* An XML source listing
* An include (the code of the listing is in an external file)
* An the "tags" attribute to pick only interesting lines.

Here an example:
File: example.xml
====
<some>
  <!-- tag::myTag[] -->
  <content>Hello World</content>
  <!-- end::myTag[] -->
</some>
====

File: example-manual.adoc
====
= Example Manual
Doc Writer <[hidden email]>
v1.0, 2014-09-09

[[lst-all]]
[source,xml]
.Some XML content (without Tags)
----
include::example.xml[]
----

[[lst-withTag]]
[source,xml]
.Some XML content (with Tags)
----
include::example.xml[tags=myTag]
----
====

What did I miss? Is this a bug/limitation?



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Asciidoctor-XML-listing-and-tags-tp3912.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen
Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctor XML listing and tags

Jeremie Bresson
I am confused, I now see my small example working.

I cannot reproduce my early morning Bug. I had the problem in the Asciidoctor-Chrome-Preview, but after several F5, it works as expected.
Sorry for the noise...

PS: I am not sure how I can see the Warnings in Chrome.
Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctor XML listing and tags

mojavelinux
Administrator

On Wed, Oct 28, 2015 at 1:32 AM, Jeremie Bresson [via Asciidoctor :: Discussion] <[hidden email]> wrote:
PS: I am not sure how I can see the Warnings in Chrome.

I think they appear in the Developer Tools Console. If we are filtering them out, we could add a flag for them to appear there. That's the closest equivalent to the stdout in a terminal.

Cheers,

-Dan


--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen
Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctor XML listing and tags

Jeremie Bresson
In reply to this post by Jeremie Bresson
Are the Callout supposed to work with XML?

I now have something like this in my code:
  <!-- tag::jaxws.pom.single-wsdl-file-per-module[]-->
  <properties>
    <jwsdlfile>PingWebService.wsdl</jwsdlfile> <!-- <1> -->
  </properties>
  <!-- end::jaxws.pom.single-wsdl-file-per-module[] -->

The tag filtering works great, but not the callout (tried with Asciidoctorj and Asciidoctorjs [Chrome Preview]).
Asciidoctorj Versions:
    * asciidoctor.maven.plugin.version:1.5.3
    * asciidoctorj.pdf.version: 1.5.0-alpha.11
    * asciidoctorj.version: 1.5.4
    * jruby.version: 9.0.4.0
Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctor XML listing and tags

mojavelinux
Administrator

The syntax needs to be as follows.

<!--1-->

In other words, it's different for XML.