[go: up one dir, main page]

Skip to content

Generate TOC for readme files automatically

Problem to solve

Readme files are a great way to provide an overview of a project, however, as they grow in size, consuming their content is more difficult. When readme's grow in size, users generally must take the time to add a table of contents (TOC) with links to the relevant content.

Proposal

Automatically generate a TOC based on readme contents. Applicable to files named readme only. For MVC, a simple list of headers, indented to show relation.

We could change the file icon for a button to trigger the action.

For example, for the GitLab readme the TOC would look like this (pardon the crude mock)

Mock image

Design Proposal

image

  • Indent 8px for search header h1-h6 (h1 - 0px, h2 - 8px, ..., h6 - 40px)
Edited by Mike Nichols