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

Feature request: add ability to include headings before the TOC's <!-- START --> flag #213

Open
haysclark opened this issue Sep 13, 2021 · 3 comments

Comments

@haysclark
Copy link

I've been converting some docs to MD that have TOC content before the TOC itself. e.g. ## Preface. Currently, only generates TOC content for elements found after the <!-- START -->. It would be nice if the was a doctoc flag would override this behavior and parse the entire document.

Naturally, this might require adding additional features to exclude referencing the TOC itself, like IGNORE flags.:

<!-- TOC-IGNORE-START -->
<!-- TOC-IGNORE-END -->

@haysclark haysclark changed the title Feature request: add flag to look for TOC content before <!-- START --> Feature request: add ability to include headings before the TOC's <!-- START --> flag Sep 13, 2021
@fab1o
Copy link

fab1o commented Sep 16, 2021

Related question: Is there a way to ignore sections? For instance, I want to ingnore Section 3, I have this readme:

# Title

<!-- START doctoc -->
<!-- END doctoc -->

## Section 1

## Section 2

## Section 3

@thlorenz
Copy link
Owner

None of the above two is possible ATM, but I'm open to a PR that makes that configurable.
TOC-IGNORE-START is a bit too specific, but something along the lines of DOCTOC_INCLUDE_START and DOCTOC_INCLUDE_END and DOCTOC_SKIP_START/END comments could work.

Best to discuss details here with some more detailed examples before jumping into the implementation.

@AndrewSouthpaw
Copy link
Collaborator

Agreed. It seems like the --include-all would be easier to pull off than the one about skippable headers. Probably want to treat them as a separate features. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants