[kramdown-users] Creating ToC outside the document

Sandeep Laxman sandeep.laxman at gmail.com
Mon Oct 15 13:04:42 UTC 2012


Hi Thomas,
I was trying to use the same but I am still getting errors. I guess
something is wrong with my code. My kramdown document is stored in
@book.content.

When I do the following:

Kramdown::Converter::Toc.new(@book.content)


I get

private method `new' called for Kramdown::Converter::Toc:Class

How do I fix it?

Thanks!!
 -Sandeep

On Mon, Oct 15, 2012 at 5:53 PM, Thomas Leitner <t_leitner at gmx.at> wrote:

> On 2012-10-15 17:16 +0530 Sandeep Laxman wrote:
> > I started using kramdown just a few days ago. In my application, I
> > want to show the ToC of kramdown document on a separate web page
> > (where one can click on the link to the appropriate chapter). How can
> > I do this?
>
> You can use the [Converter::Toc class][1] to extract the TOC of a
> Kramdown document and display it anywhere and in any way you like.
>
> Best regards,
>   Thomas
>
> [1]: http://kramdown.rubyforge.org/rdoc/Kramdown/Converter/Toc.html
> _______________________________________________
> kramdown-users mailing list
> kramdown-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/kramdown-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/kramdown-users/attachments/20121015/e89077e6/attachment.html>


More information about the kramdown-users mailing list