tc39 / tc39/ecmarkup

do something about the size of the table of contents

Open
#306 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
245
Forks
80
Avg merge
10h 46m
Merged PRs (30d)
2

Description

In ecma262, the table of contents is 400kb of HTML to represent 76kb of text plus a little structure. We can cut that down.

A lot of the overhead is that every link includes a title attribute which effectively duplicates its contents. That's almost certainly not worth the cost (if not actively harmful).

Another big chunk is the inclusion of classes on many elements which could be matched by broader selectors. For example, all the section numbers in the ToC have <span class="secnum">, which, a) #menu-toc a > span matches exactly those elements, so they don't need to have classes added manually and b) that class doesn't even do anything in this context. That's 30kb by itself.

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 by locating the ecma262 table-of-contents generation and measuring the emitted HTML, focusing on link title attributes and the manually added secnum classes. Confirm that broader selectors such as #menu-toc a > span still match the intended elements. Done means reducing redundant markup while preserving the table of contents text, structure, links, and styling.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.