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

Docs: Adds table of contents documentation #23439

Merged
merged 2 commits into from
Jul 13, 2023
Merged

Conversation

jonniebigodes
Copy link
Contributor

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:

  • Updated the relevant documentation.
  • Set up the required snippets

@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 🙏

@github-actions
Copy link
Contributor

github-actions bot commented Jul 13, 2023

Fails
🚫

PR is not labeled with one of: ["ci:normal","ci:merged","ci:daily"]

Generated by 🚫 dangerJS against 2035c5f

Copy link
Member

@shilman shilman left a 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';
Copy link
Member

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?

Copy link
Contributor Author

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
Copy link
Member

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?

Copy link
Contributor Author

@jonniebigodes jonniebigodes Jul 13, 2023

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.

docs/writing-docs/autodocs.md Outdated Show resolved Hide resolved
@@ -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
Copy link
Member

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?

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants