Skip to content

Add table of contents functionality #10

@virtuald

Description

@virtuald

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions