Re: Collapsable/Expandable TOC
Posted by
mojavelinux on
URL: https://discuss.asciidoctor.org/Collapsable-Expandable-TOC-tp789p8232.html
What I will say is that I personally do not like ERB. I recommend using slim instead. It's much easier to program in. It has been a long time since I used ERB and I don't remember all the rules.
Best Regards,
-Dan
On Wed, Sep 9, 2020 at 3:49 AM max990 [via Asciidoctor :: Discussion] <
[hidden email]> wrote:
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!
--