Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add table of contents functionality #10

Open
virtuald opened this issue Jun 14, 2016 · 0 comments
Open

Add table of contents functionality #10

virtuald opened this issue Jun 14, 2016 · 0 comments

Comments

@virtuald
Copy link
Member

If you do something like this in kramdown...

1. TOC
{:toc}

It will render a table of contents, with a default ID of 'markdown-toc'. Unfortunately, you end up with a numbered list, but it doesn't sub-number the list (2.2, 2.3 ... )like Wikpedia does, nor does it give it that nice 'Content' header either.

The kramdown option can be put in an include called 'toc', so you'll just have to do

{% include toc %}

on each and every page. It doesn't appear that you can add that to a layout.

Otherwise, we could add a nice javascript module that autocalculates a TOC and puts it on the page somewhere. Given our extensive use of javascript elsewhere, and the fact that we can really extend this, it's probably the best choice... but I'll have to think about this, there are merits on both sides.

Others are welcome to weigh in on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant