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: Provide easy way to remove TOC from a document #76

Closed
Kshitiz-Sharma opened this issue Sep 1, 2016 · 6 comments
Closed
Labels
new-feature Indecates new feature which maintainer planning or under consideration

Comments

@Kshitiz-Sharma
Copy link

Kshitiz-Sharma commented Sep 1, 2016

If TOC is generated with hyperlinking enabled, the document will be inserted a lot of anchors. When removing the TOC, user would need to search and remove each of these by hand. For large documents this can be a lot of work.

The alternative is to generate the anchors with a unique identifier:

<a name="user-heading-1" id="mtoc"></a>

Later when user clicks on delete TOC, the table can be deleted along with all anchors having id mtoc.

@naokazuterada
Copy link
Owner

Thank you @Kshitiz-Sharma, it sounds nice! (maybe using 'data-xxx' attributes is better than 'id')

@naokazuterada naokazuterada added the new-feature Indecates new feature which maintainer planning or under consideration label Sep 2, 2016
@jonasbn
Copy link
Collaborator

jonasbn commented Sep 2, 2016

@naokazuterada let me know if you create a feature branch, then I will update the documentation accordingly in the same branch

Have a nice weekend,

jonasbn

@naokazuterada
Copy link
Owner

Hi @Kshitiz-Sharma

Sorry, I noticed this feature has already been implemented.
Here is my screencast.

remove-autoanchors

It has been achieved in this line.

My test case is below. Please try it or report your condition in more detail.

<!-- MarkdownTOC autolink="true" autoanchor="false" -->

- [Changelog][changelog]
- [Glossary][glossary]
- [API Specification][api-specification]

<!-- /MarkdownTOC -->

# Changelog
Lorem ipsum...

# Glossary
Lorem ipsum...

# API Specification
Lorem ipsum...

@Kshitiz-Sharma
Copy link
Author

Thanks. That should do. I'm closing this request.

@jonasbn
Copy link
Collaborator

jonasbn commented Sep 4, 2016

Hi @naokazuterada do you want a mention of this in the documentation.

jonasbn

@naokazuterada
Copy link
Owner

naokazuterada commented Sep 5, 2016

Hello @jonasbn

I think it's not necessary. But it's nice that it's mentioned in the document naturally. Could you try it?
Thanks a lot for your kindness.

@jonasbn jonasbn mentioned this issue Jan 2, 2017
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
None yet
Development

No branches or pull requests

3 participants