Re: TOC placement with Awestruct

Posted by LightGuardjp on
URL: https://discuss.asciidoctor.org/TOC-placement-with-Awestruct-tp546p549.html

To my knowledge the only way you'd be able to do this is with some javascript to remove the fragment containing the TOC and place it somewhere else. awestruct has no idea about the contents of the pages before / or after they're rendered. 

Actually, you could create an awestruct extension to do the same thing as the javascript. Use Nokogiri to do the work.


On Sun, Sep 8, 2013 at 1:54 PM, fleurystephane [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi!

I'm trying to display the toc content in a particular place.
I've my page.adoc with toc(s) attributes specified and I want to display the toc block at the right of the page.(like the excellent guide Arquillian site)

I use the layout page of Awestruct and the ~ content way to display the generated text from page.adoc.

My code :

my layout base-souscription.html.haml
...
 %body
    .navbar.navbar-fixed-top
      .navbar-inner
        .container
          %a.brand{ :href=>"/" } Home
    .container
      .row
        .span9
          ~ content
        .span3
          Here I'd like the toc of the current page...
...

my adoc file

= Souscription
Just me
:awestruct-layout: base-souscription
:toc:
:toc-placement: manual
:toc-title: Questions

toc::[]

== Chapter 1
the first chapter..

== Chapter 2
The second chapter

Is there a solution?
Thanks

Stéphane


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



--
Jason Porter
http://en.gravatar.com/lightguardjp