question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Customize TOC style and template

See original GitHub issue

Feature 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:open
  • Created 5 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
yzhang-ghcommented, Dec 1, 2022

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

<style>
    ul { list-style: none; }
</style>

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.

1reaction
muuvmuuvcommented, Mar 28, 2019

Yep sure @yzhang-gh. I will add an .editorconfig to prevent this in the future. Everyone has their own style and this would keep yours forced for your project.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found