Skip to content

Commit f1f7609

Browse files
authored
Merge pull request #18603 from github/automatic-toc
Automatic TOCs for READMEs
2 parents ef0b2e1 + 964641c commit f1f7609

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

360 KB
Loading
175 KB
Loading

content/github/creating-cloning-and-archiving-repositories/about-readmes.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,22 @@ If you put your README file in your repository's root, `docs`, or hidden `.githu
4242

4343
{% endif %}
4444

45+
### Auto-generated table of contents for README files
46+
47+
For the rendered view of any Markdown file in a repository, including README files, {% data variables.product.product_name %} will automatically generate a table of contents based on section headings. You can view the table of contents for a README file by clicking the {% octicon "list-unordered" aria-label="The unordered list icon" %} menu icon at the top left of the rendered page.
48+
49+
![README with automatically generated TOC](/assets/images/help/repository/readme-automatic-toc.png)
50+
51+
The auto-generated table of contents is enabled by default for all Markdown files in a repository, but you can disable this feature for your repository.
52+
53+
{% data reusables.repositories.navigate-to-repo %}
54+
{% data reusables.repositories.sidebar-settings %}
55+
1. Under "Features", deselect **Table of contents**.
56+
![Automatic TOC setting for repositories](/assets/images/help/repository/readme-automatic-toc-setting.png)
57+
4558
### Section links in README files and blob pages
4659

47-
Many projects use a table of contents at the start of a README to direct users to different sections of the file. {% data reusables.repositories.section-links %}
60+
{% data reusables.repositories.section-links %}
4861

4962
### Relative links and image paths in README files
5063

0 commit comments

Comments
 (0)