Thomas,I put together a script that sets up the scenario and runs it. Give it a try and let me know if the Expected matches the Actual. If so, then you have a working example on which to build. If not, then we know that there is something specific to your use case that we need to uncover.
[source,ruby]
--
content = []
content << <<EOS
++++
level 1
include::level-2.adoc[]
++++
EOS
content << <<EOS
level 2
include::level-3.adoc[]
EOS
content << <<EOS
level 3
include::level-4.adoc[]
EOS
content << <<EOS
level 4
EOS
(1..4).each do |l|
File.open(%(level-#{l}.adoc), 'w') do |f|
f.write content[l - 1]
end
end
puts <<EOS
Expect:
level 1
level 2
level 3
level 4
Actual:
EOS
puts %x{asciidoctor -o - -s level-1.adoc}
--Also, it might be helpful if you mention what Ruby and OS you are using.I look forward to hearing the results.-DanOn Wed, Nov 6, 2013 at 12:08 PM, thomas [via Asciidoctor :: Discussion] <<a href="x-msg://578/user/SendEmail.jtp?type=node&node=946&i=0" target="_top" rel="nofollow" link="external">[hidden email]> wrote:
Hi Dan,Thanks for the reply!I had the same feeling you did about the file extension so it was the first thing I had tried. Unfortunately, it doesn't seem to make a difference. It looks like it will process the files regardless of the extension, but it won't process the includes past a depth of one (at least for _me_).Anyone else able to pull in nested includes at a depth of 2?-thomasOn Nov 6, 2013, at 3:50 AM, "mojavelinux [via Asciidoctor :: Discussion]" <[hidden email]> wrote:Thomas,
I may need to look closer into this, but my gut is telling me it has to do with the file extension. Asciidoctor doesn't process the lines as AsciiDoc in an include file if it doesn't recognize the extension as an AsciiDoc file.
I have a feature request in to override this behavior, but it's not yet implemented. The easiest way is to add the file extension .adoc, .ad or .asciidoc (.asc works too, but we discourage its use)
If the file extension isn't the issue, we'll need to dig deeper.
Btw, you don't need to set safe mode when using the cli, only the api. The default for the cli is unsafe.
I hope that gets you to the next step in solving this one!
-Dan
On Nov 5, 2013 3:25 AM, "thomas burger [via Asciidoctor :: Discussion]" <<a href="<a href="x-msg://483/user/SendEmail.jtp?type=node&amp;node=939&amp;i=0">x-msg://483/user/SendEmail.jtp?type=node&node=939&i=0" target="_top" rel="nofollow" link="external">[hidden email]> wrote:
Hello,
Seem to be stuck. I can see that max-include-depth has a default value set to 64, however it still seems that 1 is the limit for include depth? Explicitly setting via cli max-include-depth=0 works to disable includes, but setting above 1 does not seem to make any difference. Setting depth=64 didn't work either. Is there are a trick to getting past a depth of 1 ?
> asciidoctor --version
Asciidoctor 0.1.4 [http://asciidoctor.org]
> asciidoctor -a max-include-depth=64 -S unsafe file1
file1:
THIS IS FILE ONE. +
LETS INCLUDE TWO: +
include::file2[depth=64]
file2:
THIS IS FILE TWO. +
LETS INCLUDE THREE: +
include::file3[depth=64]
file3:
THIS IS FILE THREE.
Result:
THIS IS FILE ONE.
LETS INCLUDE TWO:
THIS IS FILE TWO.
LETS INCLUDE THREE:
include::file3[depth=64]
If you reply to this email, your message will be added to the discussion below:http://discuss.asciidoctor.org/max-depth-for-includes-tp936.htmlTo start a new topic under Asciidoctor :: Discussion, email <a href="<a href="x-msg://483/user/SendEmail.jtp?type=node&amp;node=939&amp;i=1">x-msg://483/user/SendEmail.jtp?type=node&node=939&i=1" target="_top" rel="nofollow" link="external">[hidden email]
To unsubscribe from Asciidoctor :: Discussion, <a href="<a href="x-msg://483/">x-msg://483/" target="_blank" rel="nofollow" link="external">click here.
NAML
http://discuss.asciidoctor.org/max-depth-for-includes-tp936p939.htmlIf you reply to this email, your message will be added to the discussion below:To start a new topic under Asciidoctor :: Discussion, email [hidden email]
http://discuss.asciidoctor.org/max-depth-for-includes-tp936p945.htmlIf you reply to this email, your message will be added to the discussion below:To start a new topic under Asciidoctor :: Discussion, email <a href="x-msg://578/user/SendEmail.jtp?type=node&node=946&i=1" target="_top" rel="nofollow" link="external">[hidden email]
To unsubscribe from Asciidoctor :: Discussion, <a href="x-msg://578/" target="_blank" rel="nofollow" link="external">click here.
NAML
--Dan Allen | http://google.com/profiles/dan.j.allen
If you reply to this email, your message will be added to the discussion below:http://discuss.asciidoctor.org/max-depth-for-includes-tp936p946.htmlTo start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML
Free forum by Nabble | Edit this page |