Include with multiple tags

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

Include with multiple tags

ozeebee
Hi there,
I have been trying to include multiple sections of an external document using tags but it looks like it doesn't work.
I don't know if it's a limitation or a bug (well, since it's written tags=[] and not tag=[], I guess it's a bug ;))

so I have been trying this:

include::{samplesdir}/jms/jms-bridge.properties[tags=content1,content2]

in which case only content1 section is included.
Looks like only the first tag is taken into account because if I change the order of the tags in the include directive, then only the second section is included.

Do you confirm this behaviour ?
I am using version 1.5.0 preview 1

thanks,
Ozb.
Reply | Threaded
Open this post in threaded view
|

Re: Include with multiple tags

LightGuardjp
If you're using ruby try preview7 and see if things are fixed

Sent from Mailbox


On Thu, Jun 5, 2014 at 8:58 AM, ozeebee [via Asciidoctor :: Discussion] <[hidden email]> wrote:

Hi there,
I have been trying to include multiple sections of an external document using tags but it looks like it doesn't work.
I don't know if it's a limitation or a bug (well, since it's written tags=[] and not tag=[], I guess it's a bug ;))

so I have been trying this:

include::{samplesdir}/jms/jms-bridge.properties[tags=content1,content2]

in which case only content1 section is included.
Looks like only the first tag is taken into account because if I change the order of the tags in the include directive, then only the second section is included.

Do you confirm this behaviour ?
I am using version 1.5.0 preview 1

thanks,
Ozb.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Include-with-multiple-tags-tp1784.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: Include with multiple tags

ozeebee
Thanks for your quick answer.
I have installed 1.5.0.preview.7 but unfortunately now the processor fails converting my document:

undefined local variable or method `doc' for #<Asciidoctor::Converter::Html5Converter:0x007ff6c91b9e10>
  Use --trace for backtrace

And here's the backtrace:

/Users/ajo/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor/converter/html5.rb:84:in `document': undefined local variable or method `doc' for #<Asciidoctor::Converter::Html5Converter:0x007fa6420a2568> (NameError)
        from /Users/ajo/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor/converter/base.rb:26:in `convert'
        from /Users/ajo/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor/document.rb:895:in `convert'
        from /Users/ajo/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor.rb:1401:in `convert'
        from /Users/ajo/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor/cli/invoker.rb:95:in `block in invoke!'
        from /Users/ajo/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor/cli/invoker.rb:87:in `each'
        from /Users/ajo/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor/cli/invoker.rb:87:in `invoke!'
        from /Users/ajo/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.0.preview.7/bin/asciidoctor:10:in `<top (required)>'
        from /Users/ajo/.rbenv/versions/1.9.3-p385/bin/asciidoctor:23:in `load'
        from /Users/ajo/.rbenv/versions/1.9.3-p385/bin/asciidoctor:23:in `<main>'

it was generated with version:

> asciidoctor --version
Asciidoctor 1.5.0.preview.7 [http://asciidoctor.org]
Runtime Environment (ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-darwin13.0.2])


Hope this helps,
thanks.
Ozb
Reply | Threaded
Open this post in threaded view
|

Re: Include with multiple tags

mojavelinux
Administrator
Ozb,

You are hitting the bug in Asciidoctor 1.5.0.preview.7 related to use of the Pygments syntax highlighter (see https://github.com/asciidoctor/asciidoctor/issues/933). That problem is fixed in master and the fix will be available in the next Asciidoctor release.

For the purpose of testing this issue, please use another syntax highlighter temporarily.

-Dan


On Fri, Jun 6, 2014 at 2:24 AM, ozeebee [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Thanks for your quick answer.
I have installed 1.5.0.preview.7 but unfortunately now the processor fails converting my document:

undefined local variable or method `doc' for #<Asciidoctor::Converter::Html5Converter:0x007ff6c91b9e10>
  Use --trace for backtrace

And here's the backtrace:

/Users/ajo/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor/converter/html5.rb:84:in `document': undefined local variable or method `doc' for #<Asciidoctor::Converter::Html5Converter:0x007fa6420a2568> (NameError)
        from /Users/ajo/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor/converter/base.rb:26:in `convert'
        from /Users/ajo/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor/document.rb:895:in `convert'
        from /Users/ajo/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor.rb:1401:in `convert'
        from /Users/ajo/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor/cli/invoker.rb:95:in `block in invoke!'
        from /Users/ajo/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor/cli/invoker.rb:87:in `each'
        from /Users/ajo/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor/cli/invoker.rb:87:in `invoke!'
        from /Users/ajo/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.0.preview.7/bin/asciidoctor:10:in `<top (required)>'
        from /Users/ajo/.rbenv/versions/1.9.3-p385/bin/asciidoctor:23:in `load'
        from /Users/ajo/.rbenv/versions/1.9.3-p385/bin/asciidoctor:23:in `<main>'

it was generated with version:

> asciidoctor --version
Asciidoctor 1.5.0.preview.7 [http://asciidoctor.org]
Runtime Environment (ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-darwin13.0.2])


Hope this helps,
thanks.
Ozb



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Include-with-multiple-tags-tp1784p1786.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: Include with multiple tags

mojavelinux
Administrator
In reply to this post by ozeebee
The problem here is that the comma between content1 and content2 in your attribute value is interpreted as an attribute separator. In other words, given the following attribute value:

tags=content1,content2

Asciidoctor sees a "tags" attribute with the value "content1" and a "content2" attribute with an empty value.

In order to associate both tags with the "tags" attribute, you need to either:

a. encode the value in double quotes (e.g., tags="content1,content2")

b. use a semi-colon as a value separator (e.g., tags=content1;content2)

Asciidoctor allows you to drop the double quotes around an attribute value in many places (unlike AsciiDoc Python). However, a comma is always interpreted as an attribute separator, so you need to handle its presence in one of the two ways described above.

Here's the test for this scenario:


Cheers,

-Dan


On Thu, Jun 5, 2014 at 8:56 AM, ozeebee [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi there,
I have been trying to include multiple sections of an external document using tags but it looks like it doesn't work.
I don't know if it's a limitation or a bug (well, since it's written tags=[] and not tag=[], I guess it's a bug ;))

so I have been trying this:

include::{samplesdir}/jms/jms-bridge.properties[tags=content1,content2]

in which case only content1 section is included.
Looks like only the first tag is taken into account because if I change the order of the tags in the include directive, then only the second section is included.

Do you confirm this behaviour ?
I am using version 1.5.0 preview 1

thanks,
Ozb.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Include-with-multiple-tags-tp1784.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: Include with multiple tags

ozeebee
ok, thank you very much for your explanation.
Keep up the good work.
Regards,
Ozb.