Customize TOC style and template
See original GitHub issueFeature request
In my README I prefer to use the TOC-style where the links are listed below each other (like it is now) but in the CHANGELOG I prefer it inline next to each other divided with a middot (·).
Would be nice to have an option here to insert different styles of TOC in a file or have an option in settings.json to create our own templates. 😁
Style1:
- [Headline](#headline)
- [Subhead](#subhead)
Possible Style2:
[Headline](#headline) · [Subhead](#subhead)
How templating could work:
{
"markdown.extension.toc.marker": "-",
"markdown.extension.toc.template": "{marker} [{name}](#{link})",
"markdown.extension.toc.template": "{list} [{name}](#{link})", // for ordered list
"markdown.extension.toc.marker": "·",
"markdown.extension.toc.markerSkipLast": true,
"markdown.extension.toc.template": "[{name}](#{link}) {marker}",
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Introduction to Tables of Contents (TOCs) - Microsoft Support
Click REFERENCES > Table of Contents > Custom Table of Contents. · In the Table of Contents dialog box, click Modify. · In...
Read more >How to Modify Table of Contents Formatting in Word
Modify TOC styles to change the format of table of contents entries · Click in the automatic or custom table of contents. ·...
Read more >How to format a table of contents in a Word document
How to modify a table of contents style in Word · Thumb down in the styles pane until you find TOC 2. ·...
Read more >Creating a Custom Table of Contents in Microsoft Word
This is the lesson for you. To make a table of contents, you can either make one from scratch, or have Word give...
Read more >How to modify a Table of Contents in Microsoft Word
Here's the most foolproof way to adjust TOC formatting such as fonts and spacing. ... Suffice it to say you just want to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The TOC is just an HTML list, and its style can be changed with CSS https://developer.mozilla.org/en-US/docs/Web/CSS/list-style
e.g. adding
in the Markdown file will remove bullets of all the unordered lists. To apply it only on the TOC, you may apply some CSS selectors depending on your document structure.
Yep sure @yzhang-gh. I will add an
.editorconfigto prevent this in the future. Everyone has their own style and this would keep yours forced for your project.