daisy / ace

Ace by DAISY, an Accessibility Checker for EPUB
MIT License
75 stars 22 forks source link

website TOC generation #163

Open marisademeglio opened 6 years ago

marisademeglio commented 6 years ago

Hugo/markdown automatically inserts a TOC into each page, if there are subheadings. However, I notice that depending on the nesting structure, the generated TOC looks different. Attached are 2 examples, one of which has a consistently ordered list, and the other of which is a mix of list items and ordered lists. The latter example can be reproduced consistently by inserting sub-sub-headings under any page subheading that's not the last one.

E.g.

heading

another heading

a subtopic

will look fine

But

heading

subtopic

another heading

another subtopic

will not.

screen shot 2018-01-27 at 3 32 45 pm screen shot 2018-01-27 at 3 33 37 pm
rdeltour commented 6 years ago

Noted, good catch. Removing the bug label as it’s not really a bug for Ace itself.

marisademeglio commented 6 years ago

In addition to this, the links created in the TOC generator don't always quite match the IDs that are automatically created for headings. E.g.

Heading: "What Ace doesn't do?" ID: #what-ace-doesn-t-do TOC link: #what-ace-doesnt-do

Maybe both problems are in this file https://github.com/daisy/ace/blob/master/website/themes/daisy/layouts/partials/toc.html ?