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: New Markdown block #20796

Merged
merged 13 commits into from
Jan 27, 2023
Merged

Docs: New Markdown block #20796

merged 13 commits into from
Jan 27, 2023

Conversation

JReinhold
Copy link
Contributor

Telescoping on top of #20790

Fixes #19733 fixes #20586

What I did

This PR adds a new Markdown block that can be used to render plain markdown, either written directly as a raw string or imported from an existing .md file.

Example usage:

import { Markdown } from '@storybook/blocks';
import ReadMe from './README.md?raw';

...

<Markdown>{ReadMe}</Markdown>

The Markdown block is a thin wrapper on top of the Markdown component from markdown-to-jsx, so it supports all the same props as that one does.

This PR also changes the implementation in the Description block to use the Markdown block internally rather than it's own implementation.

How to test

  • See stories in published SB

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

@JReinhold JReinhold marked this pull request as ready for review January 26, 2023 12:06
@JReinhold JReinhold requested a review from shilman January 26, 2023 12:06
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.

This is great! 💯 x 💯 !!!

Base automatically changed from disable-markdown-transclusion to next January 27, 2023 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants