Re: Collapsable/Expandable TOC

Posted by max990 on
URL: https://discuss.asciidoctor.org/Collapsable-Expandable-TOC-tp789p8231.html

Thanks, i try to convert https://github.com/asciidoctor/asciidoctor/blob/master/lib/asciidoctor/converter/html5.rb#L341-L378 to erb file.

When I put static text, it's ok my test is displayed in my html document.
Now I try to generate the toc.

I'm not very comfortable with ruby at all (i'm mainly java developer).
When I try simply to do this (as done in ruby code):

<%#encoding:UTF-8%>
<% sections = node.sections %>

I got :

java.lang.NegativeArraySizeException
        at org.jruby.util.ByteList.ensure(ByteList.java:344)
        at org.jruby.util.io.EncodingUtils.strBufCat(EncodingUtils.java:1708)<quote author="mojavelinux">


Does node variable is not available when using erb file? how could I fix this?
How can i create my loop to display all my toc?

Thanks a lot for your reactivity!

PS: I use java library asciidoctorj to generate my html from asciidoc