-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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: Update example to import a raw markdown file #25862
Conversation
Improve the rendered documentation for importing markdown files using the markdown block
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.
@rwaight thanks for taking the time to put together this pull request and helping us improve our documentation by catching this small but rather important issue with the snippet. We appreciate it 🙏 ! I left a small suggestion for you to look into when you have the chance.
Looking forward to hearing from you.
Hope you have a fantastic weekend.
Stay safe
@@ -26,8 +26,20 @@ import { Button } from "@storybook/design-system"; | |||
```md |
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.
@rwaight we have a bit of room for improvement here. We can adjust the snippet to the following:
<!-- prettier-ignore-start -->
```md
<!-- Header.mdx -->
// DON'T do this, will error
import ReadMe from './README.md';
// DO this, will work
import ReadMe from './README.md?raw';
import { Markdown } from '@storybook/blocks';
# A header
<Markdown>{ReadMe}</Markdown>
```
<!-- prettier-ignore-end -->
With this small change, the snippet will be rendered as follows and we avoid having broken down into two while retaining the required information.
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.
@jonniebigodes i made the requested updates in 671c325, let me know what you think
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.
@rwaight thanks for taking the time to address the feedback so promptly. Appreciate it 🙏 ! It looks good on my end. I'll gladly merge this once the checklist clears.
Hope you have a great day.
Stay safe
Improve the rendered documentation for importing markdown files using the markdown block
What I did
Updated the
doc-block-markdown.md
page to improve the renderedMarkdown block
example of how to import markdown files.The current page is rendered as
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
I do not believe manual testing is needed, as this is a documentation-only update
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal
,ci:merged
orci:daily
GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli/src/sandbox-templates.ts
Make sure this PR contains one of the labels below:
Available labels
bug
: Internal changes that fixes incorrect behavior.maintenance
: User-facing maintenance tasks.dependencies
: Upgrading (sometimes downgrading) dependencies.build
: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup
: Minor cleanup style change. Will not show up in release changelog.documentation
: Documentation only changes. Will not show up in release changelog.feature request
: Introducing a new feature.BREAKING CHANGE
: Changes that break compatibility in some way with current major version.other
: Changes that don't fit in the above categories.🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/core
team here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>