Re: Collapsable/Expandable TOC

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

There are also implementations of a collapsable toc floating around. I don't have the link off the top of my head, but I do know that they exist. For example: https://docs.jboss.org/cdi/spec/2.0/cdi-spec.html

-Dan

On Wed, Sep 9, 2020 at 4:17 AM mojavelinux [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Unfortunately, I don't have time to help you develop this template right now. You might try to ask in the chat channel where more people hang out. https://gitter.im/asciidoctor/asciidoctor.

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!




If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Collapsable-Expandable-TOC-tp789p8231.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux



If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Collapsable-Expandable-TOC-tp789p8232.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux