arturadib / strapdown

Instant and elegant Markdown documents in the browser
http://strapdownjs.com
MIT License
2.48k stars 410 forks source link

TOC in navbar #7

Open michfield opened 11 years ago

michfield commented 11 years ago

Much needed improvement, I believe.

Could you add a Table Of Content in right end of a "navbar" / topbar?

It should be invisible (only some tiny indicator, something like dimmed arrow pointing down), but when you hover over it, some dropdown menu should emerge.

It should be automatically generated from H2 (or more) tags.

You've got the picture :)

BTW: I see no reason, other than this, for this top-navbar.

Thanks.

Anyway - great idea. I made a plugin for Sublime Text 2 to use it as Markdown Preview.

arturadib commented 11 years ago

hey, good idea - would love to take a look at a pull request... :)

zipizap commented 11 years ago

I've hacked to join an existing JQuery-TOC-plugin into Strapdown, which shows a TOC (h1...h5) below the navbar

Have a look in my repo: https://github.com/zipizap/strapdown_template

jamiejackson commented 11 years ago

What's the syntax for a table of contents? Is it a MarkDown "standard?"

zipizap commented 11 years ago

@jamiejackson: it's not a Markdown standard, because what Markdown does is to convert text-to-html without a TOC.

The TOC idea as I see it, would be a complement to the markdown-generated-html-page:

Hope it clarifies, that the TOC is not a Markdown-thing, it's a post-Markdown "addon" :)

jamiejackson commented 11 years ago

It's clearer to me now, thanks. I was thinking that there was some small bit of placeholder/toggle syntax, similar to WikiText's "TOC".

mente commented 11 years ago

Any chances to push it upstream?