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.

Invalid Table of Contents links outside of "Usage" tab.

See original GitHub issue

Description

When I am at any doc page covering a component which contains a table of contents - if I navigate to the Props or Theming tab I expect any link under the table of contents to navigate me back to the “Usage” tab and then to the related section. Instead, the relative links supplied only append to the current URL.

(i.e. In the FormControl Page: https://chakra-ui.com/docs/components/form-control/props#sample-usage-for-a-radio-or-checkbox-group)

Consideration(s);

  • Supply the links under the table of contents relative links that begin with usage (a short-term solution)
  • Provide a table of contents specific to the Props and Theming tabs (maybe preferred as this new navigation structure continues to be fleshed out)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
noobinthisgamecommented, Nov 12, 2022

This issue will be resolved with the docs rework we are currently working on.

0reactions
TylerAPfledderercommented, Oct 18, 2022

Hey @nikolovlazar ! Following up on this.

In addition to the proposal I made above, would then alter the areas of PageContainer

const { title, description, editUrl, version, headings = [] } = frontmatter

The above destructuring would then also pull out the slug and then check if the end of the slug is props or theming (so not usage)

 const {
    slug,
    title,
    description,
    editUrl,
    version,
    headings = [],
  } = frontmatter

const isNotUsageTab = /(props|theming)$/.test(slug)

Then when rendering the table of contents…

{!hideToc && !isNotUsageTab && (
  <TableOfContent
    visibility={headings.length === 0 ? 'hidden' : 'initial'}
    headings={headings}
  />
)}

So only show the table if you are on the usage tab.

That’s what I got at this point. 😄 Looks like the table of contents is not getting headings for the props and theming content that have been added anyway, so this would still be a temporary solution if the table needed to be rendered properly for the other tabs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

External links may be calculated when you open a workbook
To fully recalculate a workbook, Excel gets the currently stored value of all external references from the workbooks external link table. This ...
Read more >
Nessus Agents: How to Resolve Invalid Table of Contents
This article walks through steps to resolve Nessus Agents "Invalid Table of Contents" error.
Read more >
How to find and fix broken links in Excel - Ablebits
On the Data tab, in the Queries &Connections group, click the Edit Links button. If this button is greyed out, that means there...
Read more >
Links and accessibility - AccessibilityOz
One of the most common techniques is to pull out a list of links (and the link text only, no enclosing sentence, paragraph...
Read more >
Common Hyperlink Problems - Suzanne S. Barnhill - Home
When you insert a table of contents (TOC) in Word 2000 or above, by default the TOC entries are hyperlinked to the corresponding...
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