-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Docs: Adds table of contents documentation #23439
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good @jonniebigodes !!! A few comments
```ts | ||
// MyComponent.stories.ts | ||
|
||
import type { Meta } from '@storybook/angular'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does angular need its own snippet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We ran into some issues in the past, with some users reporting that the examples weren't being depicted accurately for Angular, and we've adopted this strategy to avoid further confusion. I'm aware that it introduces a maintenance burden, but we're managing it and hopefully in the future this will no longer be required.
export default { | ||
parameters: { | ||
docs: { | ||
toc: true, // 👈 Enables the table of contents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this typechecks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was able to get it running without any issues based on this TS reproduction and JS reproduction, and I was surprised that there weren't any typecheck issues.
@@ -170,6 +233,22 @@ Out of the box, Storybook has a set of components that you can use to customize | |||
|
|||
## Troubleshooting | |||
|
|||
### The table of contents doesn't render as expected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be under a Known limitations section?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went with this approach to surface the issues that we're aware of and clearly mention them to the users without having them buried in that section of the documentation.
With this pull request, the Autodocs documentation was updated to feature in the table of contents, which will be available as part of the 7.1 release.
What was done:
@shilman, as you're the primary stakeholder on this feature. When you have a chance, could you take a pass at this pull request and let me know of any feedback? Appreciate it 🙏