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

Chore: (Docs) Auto docs fixes #21122

Merged
merged 10 commits into from
Feb 22, 2023
Merged

Chore: (Docs) Auto docs fixes #21122

merged 10 commits into from
Feb 22, 2023

Conversation

jonniebigodes
Copy link
Contributor

With this pull request, the documentation was updated to clarify and fix some breaking changes regarding the restructuring of various sections.

What was done:

Copy link
Contributor

@JReinhold JReinhold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked through the changes and it looks good! Is there an easy way to preview the changes on the site?

docs/writing-docs/autodocs.md Outdated Show resolved Hide resolved
docs/writing-docs/mdx.md Outdated Show resolved Hide resolved
jonniebigodes and others added 2 commits February 16, 2023 13:37
Co-authored-by: Jeppe Reinhold <jeppe@chromatic.com>
Co-authored-by: Jeppe Reinhold <jeppe@chromatic.com>
docs/frameworks.js Outdated Show resolved Hide resolved
docs/writing-docs/mdx.md Outdated Show resolved Hide resolved
docs/writing-docs/mdx.md Outdated Show resolved Hide resolved
@kylegach
Copy link
Contributor

Looked through the changes and it looks good! Is there an easy way to preview the changes on the site?

  1. In frontpage, extract the docs for this branch: yarn extract-monorepo-docs chore_auto_docs__docs_fixes
  2. Start the site: GATSBY_SKIP_ADDON_PAGES=true yarn start

/cc @JReinhold

Copy link
Contributor

@kylegach kylegach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, overall! 👏

I'm marking this as 'Request changes' due to the coreFrameworks change, which must be resolved prior to merging.

@kylegach kylegach dismissed their stale review February 17, 2023 21:05

Requested change was made

docs/writing-docs/autodocs.md Outdated Show resolved Hide resolved
docs/writing-docs/autodocs.md Outdated Show resolved Hide resolved
docs/writing-docs/autodocs.md Outdated Show resolved Hide resolved
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `disable` | Toggles support for all documentation pages <br/> `docs: { disable:true }` |
| `autodocs` | Configures auto-generated documentation pages. Available options: `true`, `false`,`tags` (default) <br/> `docs: { autodocs: false }` |
| `defaultName` | Renames the auto-generated documentation page<br/> `docs: { defaultName: 'Documentation' }` |

### Write a custom template
Copy link
Member

@tmeasday tmeasday Feb 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not quite sure how to think about this in combination with @kylegach's PR, but I think writing a custom autodocs template is very advanced and should at the least come at the end, if not in a totally separate page from the basic autodocs documentation.

Also we should talk in the basic docs about how to use parameters to control autodocs.

docs/writing-docs/autodocs.md Outdated Show resolved Hide resolved
Comment on lines +222 to +227
### Linking to other stories and pages

Another way to improve documentation is by linking to other stories and pages. Suppose you already have a component story with the following unique identifier, `some--id`, and you want to link it to your documentation page. In that case, you can use the `path` query string to redirect to the documentation entry related to the story:

```md
[Go to specific documentation page](?path=/docs/some--id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we think this is important enough to document should we have a pattern for it that doesn't involve using (brittle) ids but instead uses the of={} syntax @shilman @JReinhold?

Copy link
Contributor

@JReinhold JReinhold Feb 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I don't know, but I can imagine linking between docs pages or to stories is a common pattern. What you're suggesting sounds like a new <Link to={ButtonStories} /> block, which seems valuable to me.
Something to explore in upcoming releases for sure.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I guess we leave this for now, but I wonder if we should adding documentation that we probably plan to deprecate soon 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was left in on a temporary basis until there's an API to address this to avoid the issues related to linking that continue to surface in the repo addressed. Once we have a stable API and a path moving forward, this section will be rewritten.


Considering a story with ID `some--id`, this redirects to the **Docs** tab of the story:
By default, running the [migration command](#automigration) will try and migrate all existing MDX files in your project according to the MDX 2 specification. However, this might not always be possible, and you might run into issues during the migration. To help you troubleshoot those issues, we've prepared some recommendations that might help you.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PS should this content be in our migration guide rather than the docs themselves? It doesn't see relevant to new users.

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 disagree. We should instead leave it here instead of the public notion doc acting as a migration guide, as this will affect not only new users but also existing users. As most folks will not see it, by adding it, we have the added bonus of discoverability via searching the documentation. Also, to which the CLI should also point here.

docs/writing-docs/mdx.md Outdated Show resolved Hide resolved
@jonniebigodes jonniebigodes merged commit 217e215 into next Feb 22, 2023
@jonniebigodes jonniebigodes deleted the chore_auto_docs__docs_fixes branch February 22, 2023 21:46
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.

4 participants