Skip to content

Add documentation section about linking to other stories and pages from MDX - #14783

Merged
shilman merged 2 commits into
storybookjs:nextfrom
Dschungelabenteuer:add-mdx-anchors-doc
May 5, 2021
Merged

shilman merged 2 commits into
storybookjs:nextfrom
Dschungelabenteuer:add-mdx-anchors-doc

Conversation

@Dschungelabenteuer

Copy link
Copy Markdown
Contributor

What I did

As asked on the Discord server by @shilman, I've tried to explain quite briefly how to provide links (and also include anchors) to other stories and content. With a small notice about the anchors being ignored when targeting the "story" view mode (Canvas tab).

Not sure this is clear enough, and whether that video is relevant/useful.

How to test

  • Is this testable with Jest or Chromatic screenshots? No
  • Does this need a new example in the kitchen sink apps? Maybe
  • Does this need an update to the documentation? This is the update to the documentation

@nx-cloud

nx-cloud Bot commented May 2, 2021 •

Copy link
Copy Markdown

Nx Cloud Report

CI ran the following commands for commit 83c266a. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch

Status Command
#000000 nx run-many --target=prepare --all --parallel --max-parallel=15

Sent with 💌 from NxCloud.

@jonniebigodes jonniebigodes added documentation patch:yes Bugfix & documentation PR that need to be picked to main branch labels May 2, 2021
@jonniebigodes jonniebigodes self-assigned this May 2, 2021

@jonniebigodes jonniebigodes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Dschungelabenteuer thank you for the time and effort you put into this pull request. I left one note regarding it. Let me know and we'll go from there.

Stay safe

Comment thread docs/writing-docs/mdx.md Outdated
[Go to the conclusion of the documentation page](?path=/docs/some--id#conclusion)
```

Note that when using the Controls addon, anchors are ignored by the Canvas tab since the URL gets rewritten to track the args values.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Dschungelabenteuer one thing about this. If you could adjust this to :

<div class="aside">
💡 <strong>Note:</> By applying this pattern with the Controls addon, all anchors will be ignored in Canvas based on how Storybook handles URLs to track the args values.
</div

Something like this. Let me know what you thing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Much better 👍

@shilman shilman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks so much for documenting @Dschungelabenteuer !! We should fix this @ghengeveld ...

@shilman
shilman merged commit e38a6a8 into storybookjs:next May 5, 2021
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label May 8, 2021
shilman added a commit that referenced this pull request May 8, 2021
Add documentation section about linking to other stories and pages from MDX
@yannbf yannbf removed the patch:yes Bugfix & documentation PR that need to be picked to main branch label Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation patch:done Patch/release PRs already cherry-picked to main/release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants