Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove from TOC using a REGEX or pattern match #1388

Open
sheldonmaschmeyer opened this issue Jan 19, 2024 · 1 comment
Open

Remove from TOC using a REGEX or pattern match #1388

sheldonmaschmeyer opened this issue Jan 19, 2024 · 1 comment
Labels
Area: Table of contents Pertaining to table of contents (TOC generation and detection, related heading operations). Help wanted Looking for help. Issue: Enhancement Improvements in existing features.

Comments

@sheldonmaschmeyer
Copy link

sheldonmaschmeyer commented Jan 19, 2024

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 *"] }
    ]
}
@yzhang-gh
Copy link
Owner

Thanks for the nice examples and description. We have similar discussions in #723 but it is about wildcard symbols in the file names. I totally agree with this feature request but I may not have time to implement it. Let's see whether there will be people willing to help.

@yzhang-gh yzhang-gh added Issue: Enhancement Improvements in existing features. Area: Table of contents Pertaining to table of contents (TOC generation and detection, related heading operations). Help wanted Looking for help. labels Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Table of contents Pertaining to table of contents (TOC generation and detection, related heading operations). Help wanted Looking for help. Issue: Enhancement Improvements in existing features.
Projects
None yet
Development

No branches or pull requests

2 participants