question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scoped Table of Contents

See original GitHub issue

What is the problem?

I am trying to create an navigatable index of figures, glossaries, tables in markdown (f.e., by applying some ‘scope’ syntax, and regenerating the index by looking up all the content with the same scope).

The already working table of contents seems like it could be enhanced to do this.

I’m not sure if it is feasable to do so, but it would be a great addition to be able to do so.

How can I reproduce it?

# Main Title

(Modified feature 'table of contents': The usual table of contents goes here, but for headlines marked with scope syntax, only the main headline of that section will appear in the TOC, none of it's sub-headlines.)

1. [Section 1](#section-1)
2. [Section 2](#section-2)
3. [Glossary](#glossary)
4. [Resources](#resources)

## Section 1

## Section 2

## Glossary <!-- scope: glossary -->

(New feature: Trying to introduce index/table of contents with scope 'glossary' here. The fragment IDs could  be prefixed with that scope, like the following links simulate.)

1. [Term 1](#glossary-term-1)
2. [Term 2](#glossary-term-2)

### Term 1 <!-- Won't be shown in main TOC, but in the Glossary index. -->

Term definition.

### Term 2 <!-- Neither will this. -->

Term definition.

## Resources

Some additional content.

It would be great to be able to call a command “Update all table of contents/indices”, of course.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
yzhang-ghcommented, Mar 16, 2020

Thanks for the information. Your have provided a great example.

Regarding to your last comment, we do have a undocumented command to do that. It is <!-- no toc --> and was added in v2.6.0.

0reactions
unionalcommented, Mar 15, 2020

Also, want to propose a way to disable toc inline:

<!-- toc disable -->
1. [Term 1](#glossary-term-1)
2. [Term 2](#glossary-term-2)

This allow user to create see also list that the plugin will not interfere:


### see also

<!-- toc disable -->
- [topic 1](#topic-1)
- [topic 5](#topic-5)

...

### see also

<!-- toc disable -->
- [topic 3](#topic-3)
- [topic 4](#topic-4)
- [topic 5](#topic-5)

And to get the benefit from the plugin, user can temporary change

<!-- toc disable --> to <!-- toc for #topics -->, save the file to get the toc reference updated, and then switch back to <!-- toc disable --> and remove the extra entries.

Or allow user to right-click and update the toc when it is disabled:

// right click here and select `Force Update Table of Content`
<!-- toc for #topics disable -->
- [topic 3](#topic-3)
- [topic 4](#topic-4)
- [topic 5](#topic-5)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Inserting a table of contents in Microsoft Word - Scope Training
Inserting a table of contents in Microsoft Word. There are two ways to insert a table of contents in word; the hard way...
Read more >
scoped application with a table extended from knowledge
Hi All, I am creating a scoped application and i would like to create a table and extend the functionalities of knowledge.
Read more >
Scope (Table) Property - Business Central - Microsoft Learn
The scope property for tables sets whether the scope is cloud or on-prem in AL.
Read more >
Using the scope attribute to associate header cells and ... - W3C
The objective of this technique is to associate header cells with data cells in complex tables using the scope attribute. The scope attribute...
Read more >
Specifying the scope for the table - No Magic Documentation
The scope is defined, and the contents of the table are updated with the elements from the selected scope. In the future, all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found