Skip to content

Themes: Automatically add unique heading IDs and table of contents in showcase pages & docs #13012

Open
@kathrynwp

Description

Happiness Engineers very often need to point users to a particular section of a showcase page or theme doc, but there isn't currently a way to do that in the Calypso showcase without manually adding IDs to each h2 heading, so we need to tell users things like "Scroll down to the Featured Images" section.

It would be incredibly efficient if each showcase and theme doc page could automatically put a unique ID on each h2 heading, and ideally also create an internal table of contents that would jump to each section.

An example of where this is already implemented (outside of Calypso) is in the support docs at https://en.support.wordpress.com.

Let's look at this page as an example: https://en.support.wordpress.com/widgets/text-widget/ You can see that:

  1. When an h4 heading is added, an ID is automatically included on the element, like this: <h4 id="text-widget-basics">
  2. A table of contents is automatically created:

text widget support wordpress com

  1. A clickable icon is created, which only HEs see. This allows HEs to very quickly grab a link to give users in live chat and other support interactions.

text widget support wordpress com-1

If we could get 1 & 2 in the theme showcase, that would be extremely helpful when doing support. 3. would be an added bonus. :)

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions