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

Conditionally exclude h1 #16

Closed
dobbymoodge opened this issue Dec 16, 2015 · 4 comments
Closed

Conditionally exclude h1 #16

dobbymoodge opened this issue Dec 16, 2015 · 4 comments

Comments

@dobbymoodge
Copy link

I tend to organize my docs like:

# Title of Document
[table of contents]
## Section 1
### Subsection a
## Section 2
...

I would like to be able to tell markdown-toc-generate-toc not to include "Title of Document" in the generated TOC.

ardumont added a commit that referenced this issue Dec 17, 2015
for specific purposes, #16 for example.

Default to 'identity by default
ardumont added a commit that referenced this issue Dec 22, 2015
for specific purposes, #16 for example.

Default to 'identity by default
@ardumont ardumont mentioned this issue Dec 23, 2015
5 tasks
@ardumont
Copy link
Owner

Hello,

see https://github.com/ardumont/markdown-toc#user-toc-manipulation for some example on how to meet your use case.

Cheers,

@dobbymoodge
Copy link
Author

Thanks! I'll test it out soon.

On Wed, Dec 23, 2015 at 6:17 AM, Antoine R. Dumont <[email protected]

wrote:

Hello,

see https://github.com/ardumont/markdown-toc#user-toc-manipulation for
some example on how to meet your use case.

Cheers,


Reply to this email directly or view it on GitHub
#16 (comment)
.

@dobbymoodge
Copy link
Author

This works great, although if for example the structure post-manipulation doesn't have any bottom-level elements, the generated TOC is indented 4 spaces, yielding something like this:

- [My first TOC entry](#my-first-toc-entry)
    - [Subsection 1](#subsection-1)
- [My second TOC entry](#my-second-toc-entry)

Maybe you could normalize the structure automatically so that the bottom-most level in the output always gets placed at column 1, like so:

-- Edit:

Actually, I'll create a new issue for this

@ardumont
Copy link
Owner

This works great,

Awesome!

Actually, I'll create a new issue for this

Nice reflex, thanks a bunch!

Cheers,

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

2 participants