rust-lang / rust-lang/mdBook

Add an anchor in a table entry

Open
#2,294 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-enhancement
Dominant language
Rust
Stars
22.2k
Forks
1.9k
PR merge metrics
PR metrics pending

Description

Problem

Look at https://rustc-dev-guide.rust-lang.org/appendix/glossary.html#intrinsic for example.
On my device, it looks like this
2024-01-20-074639_1010x426_scrot

The anchor is at the entry "intrinsic". So "intrisic" is at the top of the visible screen. Except that we should have the full table entry visible, so the user can read it directly without having to scroll.

Proposed Solution

It would be great to have a plug-in that would allow to up id at the `

Notes

The anchor is implemented with a <span> element in the first entry of the table.
Putting the span on the right element would solve my problem; but it would be very bad accessibility practice, as, after clicking on such a link, a screen-reader may omit to read the first column.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the generated glossary table shown in the linked rustc-dev-guide example and inspect how its anchor is placed in the HTML. Trace the table-entry rendering and anchor handling, then verify that following an entry link reveals the full row while preserving screen-reader access to the first-column content.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
accessibility, documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.