Header classes in table of contents

Simple request hopefully: I’d like to be able to access header classes in the table of contents.

## Header with Class {.classy}

Should be accessible in the toc as toc.classes[0] == ".classy".

I hope this is an inoffensive suggestion; I have a PR for it already I just need to run this through the discussion group first.

EDIT: The purpose is to be able to style the TOC in the same way that the main doc is styleable.

EDIT: The purpose is to be able to style the TOC in the same way that the main doc is styleable.

I’m not sure I understand. Do you mean that you just want to be able to style the toc like you would anything else, by adding classes that you can access with your css?

If so, this can already be done. You can use the toc however you want using page.toc or section.toc, and you’re free in the process to add your classes into your template. See the example be;ow from the docs;

Otherwise I might have misunderstood your question, sorry.