vscode-markdown icon indicating copy to clipboard operation
vscode-markdown copied to clipboard

Remove from TOC using a REGEX or pattern match

Open sheldonmaschmeyer opened this issue 1 year ago • 1 comments

We have labelled all figures, i.e. # Figure 1: .... # Figure 2: .... etc. We do not want these figures in the primary TOC. Currently, to omit these figures we either need to add <!-- omit in toc --> above or next to each Figure or, in a settings.json, we need to add

"markdown.extension.toc.omittedFromToc": {
    "./run/README.md": ["# Figure 1: The entire description", "# Figure 2: The entire name"]
}

We want to be able to exclude from the TOC the Figures using a pattern match or REGEX.
i.e.

"markdown.extension.toc.omittedFromToc": {
    "./run/README.md": ["^# Figure\W"]
}

or

"markdown.extension.toc.omittedFromToc": {
    "./run/README.md": ["# Figure *"]
}

Then, we can include the Figures in a separate "table of figures".

As a secondary feature, being able to have an auto-populated secondary "table of contents" that would be a "table of figures" would be brilliant. i.e.

"markdown.extension.toc.customToc": {
    "./run/README.md": [
        { "Table of Figures": ["# Figure *"] }
    ]
}

sheldonmaschmeyer avatar Jan 19 '24 23:01 sheldonmaschmeyer