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

Multiple TOCs in the MD #51

Open
bobef opened this issue Sep 30, 2015 · 2 comments
Open

Multiple TOCs in the MD #51

bobef opened this issue Sep 30, 2015 · 2 comments
Labels
new-feature Indecates new feature which maintainer planning or under consideration

Comments

@bobef
Copy link

bobef commented Sep 30, 2015

Hi. Thanks for the great plugin. It is very useful to me. I'd like to make a feature request.

It would be very useful to be able to have multiple tocs. When I insert one toc it shows the headers after the place the toc is inserted. This is very useful. But I need to be able to insert multiple tocs. The use case is this. I have some pretty long documents (javascript api docs). I want to have toc at the top and then toc for different sections. So on the top the toc won't be mile long and when you go to a specific section you can navigate to the subsections. Right now I achieve this by enabling full depth of the toc headers in the config and then I copy-paste manually from the main toc to the sections. Needless to say I have to keep track manually and update all sections when I change them.

And this brings me to the second part - it would be very useful to be able to specify options per TOC. The options that normally go in the sublime config like "default_depth": 6. I imagine something like <!-- MarkdownTOC 3-7 --> which would mean "generate toc here for the headers level 3-7 starting from this point of the document". This way one can maintain sections easily.

Regards,
Bobi

@naokazuterada
Copy link
Owner

Thank you for your suggestion. I already list up this feature at #15.

I think an issues will arise in your way. It's something like ...

# Section 1

<!-- MarkdownTOC level=2-3 -->

- SubSection 1-1
- SubSection 1-2
- SubSection 2-1
- SubSection 2-2

<!-- /MarkdownTOC -->

## SubSection 1-1
...

## SubSection 1-2
...

# Section 2

<!-- MarkdownTOC level=2-3 -->

- SubSection 2-1
- SubSection 2-2

<!-- /MarkdownTOC -->

## SubSection 2-1
...

## SubSection 2-2
...

The problem is that the first TOC will include 'SubSection' in next 'Section'.

I prefer adding content start tag and end tag each toc rather than adding level range.

# Section 1

<!-- MarkdownTOC id=toc1 -->

- SubSection 1-1
- SubSection 1-2

<!-- /MarkdownTOC -->

<!-- #toc1 -->

## SubSection 1-1
...

## SubSection 1-2
...

<!-- /#toc1 -->

# Section 2

<!-- MarkdownTOC id=toc2 -->

- SubSection 2-1
- SubSection 2-2

<!-- /MarkdownTOC -->

<!-- #toc2 -->

## SubSection 2-1
...

## SubSection 2-2
...

<!-- /#toc2 -->

But I think your 'level range' idea is good for another way of use. So, I list it up as another feature.

@naokazuterada
Copy link
Owner

Modify around this line.

@naokazuterada naokazuterada added the new-feature Indecates new feature which maintainer planning or under consideration label Oct 12, 2015
@naokazuterada naokazuterada added the feature-request Indicates new feature requests label Sep 24, 2017
@naokazuterada naokazuterada moved this from backlog to work in progress in Progress management Sep 29, 2017
@naokazuterada naokazuterada added this to the v3 milestone Sep 30, 2017
@naokazuterada naokazuterada removed this from the v3 milestone Jan 28, 2018
@naokazuterada naokazuterada removed the feature-request Indicates new feature requests label Apr 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature Indecates new feature which maintainer planning or under consideration
Projects
Progress management
work in progress
Development

No branches or pull requests

2 participants