Rendering the TOC with Sundown\Markdown #18

Closed
stof opened this Issue May 3, 2012 · 1 comment

Projects

None yet

2 participants

@stof
stof commented May 3, 2012

The simple Sundown class has a toTOC method to render the TOC. Is there a similar method for the dvanced markdown parser ?

@chobie
Owner
chobie commented May 4, 2012

thanks spotting the issue. I'm forget about that.

I implemented that in current development branch. I'll publish it to PECL in this weekend.

1dbfb0a...1e3bf31

<?php
$sd = new Sundown\Markdown(new Sundown\Render\HTML_TOC());
$data = "# helo

lorem ipsum dolar sit amet

## world

lorem ipsum dolar sit amet
";

echo $sd->render($data);
$sd->setRender(new Sundown\Render\HTML(array("with_toc_data"=>true)));
echo "\n";
echo $sd->render($data);

Thanks

@stof stof closed this May 16, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment