site-www icon indicating copy to clipboard operation
site-www copied to clipboard

add hyperlink hover buttons to h4 headings and/or add h4 headings to table of contents

Open mmcdon20 opened this issue 3 years ago • 3 comments

Describe the problem

There are a number of h4 headers in the language tour that would be nice to be able to quickly link to, and easily share a relevant part of the documentation with someone.

For example the section on the initializer list is not in the table of contents, and in order to link to this part of the documentation I did the following:

  1. right click on the heading
  2. view page source
  3. look at what the specific id was for the heading in the html
  4. manually append this id to the url

I know I have personally done this process before, see: https://stackoverflow.com/a/70470066/3080848

I also know I am not the only person to do this, because I have seen others do it as well, for example: https://stackoverflow.com/a/70635785/3080848

Expected fix

Add links to the h4 subsections in the table of contents. And add the hyperlink buttons that show up when you hover over the headings (like with the h2 and h3 headings).

Additional context

No response

mmcdon20 avatar Jan 12 '22 02:01 mmcdon20

Thanks for the suggestion @mmcdon20!

I'm not sure about adding h4 headings to the TOC as I'm worried it may provide too much information and cause crowding, perhaps limiting the usefulness, especially to the right-side TOC. Perhaps @kwalrath can provide more thoughts there though.

As for adding the hyperlink hover buttons, I can definitely see that being useful, as we occasionally link to h4 headings as well within the docs. It seems this would at least solve the main example issue you raised here.

Thanks again! I'm curious to hear others' thoughts as well :)

parlough avatar Jan 12 '22 19:01 parlough

As for adding the hyperlink hover buttons, I can definitely see that being useful, as we occasionally link to h4 headings as well within the docs. It seems this would at least solve the main example issue you raised here.

@parlough I would be satisfied even if you only did this.

mmcdon20 avatar Jan 12 '22 19:01 mmcdon20

I agree that hyperlink hover buttons would be really handy.

We considered adding h4s to the TOC, but it makes the TOC harder to scan (and space is limited), so we stuck to two levels.

kwalrath avatar Jan 12 '22 19:01 kwalrath

Following up on Kathy's comment, we have also split the language tour into multiple pages based on this kind of feedback. Closing this issue.

atsansone avatar May 10 '23 17:05 atsansone