idvoretskyi / horizon.io

The Horizon website.
https://horizon.io
0 stars 0 forks source link

TOC generation #10

Open chipotle opened 8 years ago

chipotle commented 8 years ago

The Jekyll build script doesn't make a TOC from headings yet. In some documents, like collections.md, I'm using the markup for Kramdown's automatic TOC generation.

# Methods
{:.no_toc}

* Table of Contents
{:toc}

## Collection.fetch {#fetch}

## Collection.subscribe {#subscribe}

The {:no_toc} prevents a heading from being in the table of contents; the {#fetch} after a heading overrides the automatic link generation names, so that heading can be referred to as /api/collection/#fetch. This has been tested to work with canonical Kramdown, but massaging it to another form should be pretty trivial.

chipotle commented 8 years ago

This actually may be "fixed" as easily as changing _config.yml to include both levels 1 and 2 in the TOC generation, or alternatively to make the H2 headings into H1 headings. (Or both.) I'll defer that call to @mglukhovsky