d0c-s4vage / lookatme

An interactive, terminal-based markdown presenter
https://lookatme.readthedocs.io/en/latest/
MIT License
2.08k stars 61 forks source link

Add support for a clickable/selectable table of contents #170

Open d0c-s4vage opened 1 year ago

d0c-s4vage commented 1 year ago

Describe the Feature Request Adding [[TOC]] in the markdown should produce a table of contents list from the remaining markdown contents.

Each entry in the table of contents should be clickable/selectable.

Maybe a keyboard shortcut should be added to go back to the first slide?

Example Markdown

# Table of Contents

[[TOC]]

NOTE

We should be able to always generate a table of contents that is toggle-able. I'm thinking an overlay that comes out from the left over the current slide so that it somewhat mirrors the html version:

image

The TOC should be implemented as its own widget so that we can either add it inline in a slide if the [[TOC]] markup is used, or in the left-side overlay that is toggled with the t key (tbd on that, but I think t would work well).

This should also mean being able to add the slide delimiter from the html_options into the slide metadata itself.