Skip to content

In-page Table of contents (For all headings) #1523

@enygmator

Description

@enygmator

ISSUE

This issue (or a similar one) was raised 5 years ago over here.

I want to make it clearer as to exactly what I would love for to be added as a feature as it would be a great interface.

In today's documentation websites, nearly ALL sites have a TOC (table of contents) to the Right-Hand-Side of the page (and sometime to the left), which list all the Headings of the page (i.e. h1, h2, h3, ...) for easier in-page navigation as shown below: (the image is from this site)

image

Usefulness

It is useful since sometimes you CANNOT divide that page into sub-sections within the MAIN TOC because it doesn't make sense. For example, in a single page we have an explanation of a concept that has a number of sections that make sense only on a single page, then the page might get a bit long, but not long enough to justify splitting it into multiple pages, which requires extensive scrolling to get from one part of the page to another. A simple example

Implementation ideas

I am suggesting that a similar feature be added to this repo:

  1. which is enabled by default and can be disabled optionally
  2. we can add a button which can hide the in-page TOC

There are a number of design ideas (I obtained from other sites):

Original page

This is the ORIGINAL:

before

  1. We move the left & right page navigation button to the top bar (which makes more sense anyway, since they aren't used too frequently, in my experience), so we now have more screen space
  2. Then we add the page TOC to the right hand side with all h1 shown and they can further be expanded to show h2 and they can be expanded to show h3 and so on...
  3. This is not shown in picture, but a hamburger menu could toggle the page TOC on and off.

modified page 1

This is a mock UI (not really good looking):

after

modified page 2

We can further make sure that the left and right page navigation button make more sense by changing the title of the page from the book to that of the page and moving the title of the book into the sidebar (main TOC) as shown in figure below:

after2

These are just suggestions as to the proposed UI. I highly recommend checking out This page and This page to understand the complete experience. I thank this team for considering this feature in advance. I think I followed all guideline

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-UIArea: UI/UX of generated pages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions