Is it possible to 'Tocify' a Jekyll page generated using Jekyll-AsciiDoc?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Is it possible to 'Tocify' a Jekyll page generated using Jekyll-AsciiDoc?

stevef
This may not be possible at present. When I generate HTML using AsciiDoctor, I use a docinfo file to generate a TOC that uses tocify.js. This works great.

Is it possible to achieve the same result in a Jekyll project, when using Jekyll-AsciiDoc? I like the way that Tocify expands and closes based on the user's position in the document. Jekyll is good at creating navigation that brings someone to a topic. Optionally having Tocify in a page would add a lot of usability to long-form topics.  

I use Tom Johnson's theme for documentation. It provides a site-level TOC on the left.  Having a means to use topic-level navigation in a page would be very appealing.

As an alternative, has anyone created a Jekyll layout that displays a document-level TOC outside of the content?

Thanks everyone, for any advice you can provide.



Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to 'Tocify' a Jekyll page generated using Jekyll-AsciiDoc?

mojavelinux
Administrator
While you have the choice to make the TOC however you want, there's absolutely no reason to use a JavaScript solution since Asciidoctor has a built-in TOC generator. The benefit of the built-in TOC generator is that it ignores discrete headings (headings which are not part of the document outline). 

There are two ways to get a TOC. First, you can simply set the toc attribute on the document and the toc will get added at the top of the page.

The other way is to use the TOC support provided by Jekyll AsciiDoc. This allows you to place the TOC in a template. See


Is there a specific question you had about tocify_asciidoc?

-Dan

On Thu, Mar 15, 2018 at 9:12 AM, stevef [via Asciidoctor :: Discussion] <[hidden email]> wrote:
This may not be possible at present. When I generate HTML using AsciiDoctor, I use a docinfo file to generate a TOC that uses tocify.js. This works great.

Is it possible to achieve the same result in a Jekyll project, when using Jekyll-AsciiDoc? I like the way that Tocify expands and closes based on the user's position in the document. Jekyll is good at creating navigation that brings someone to a topic. Optionally having Tocify in a page would add a lot of usability to long-form topics.  

I use Tom Johnson's theme for documentation. It provides a site-level TOC on the left.  Having a means to use topic-level navigation in a page would be very appealing.

As an alternative, has anyone created a Jekyll layout that displays a document-level TOC outside of the content?

Thanks everyone, for any advice you can provide.






If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Is-it-possible-to-Tocify-a-Jekyll-page-generated-using-Jekyll-AsciiDoc-tp6220.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux