strapdown icon indicating copy to clipboard operation
strapdown copied to clipboard

TOC in navbar

Open michfield opened this issue 12 years ago • 6 comments

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.

michfield avatar Oct 14 '12 16:10 michfield

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

arturadib avatar Oct 14 '12 18:10 arturadib

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

zipizap avatar Feb 12 '13 23:02 zipizap

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

jamiejackson avatar Apr 17 '13 15:04 jamiejackson

@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:

  • first generate with Markdown the html-page
  • then parse the html-page for all existing h1..h5, and automatically create (with javascript) a TOC section, and put it in the top of the html-page

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

zipizap avatar Apr 23 '13 15:04 zipizap

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".

jamiejackson avatar Apr 23 '13 19:04 jamiejackson

Any chances to push it upstream?

mente avatar Aug 09 '13 11:08 mente