wingsuit-designsystem / wingsuit

Twig for Storybook
GNU General Public License v2.0
93 stars 16 forks source link

Keep consistency with included stories when writing MDX manually #104

Closed iuscare closed 3 years ago

iuscare commented 3 years ago

Is your feature request related to a problem? Please describe. We are able to write our own MDX documentaiton, which is very powerful. You've even included custom documentation tokens, which makes writing documentation less painful. Now it would only be convenient, if the layout of a story stays the same, when including it into a manual created MDX file by using <PatternPreview>. Up to now the <sbdocs sbdocs-preview>wrapper with its viewport or border lines around the story gets eliminated.

Describe the solution you'd like Sometimes it is useful to add additional documentation texts like you do in your grid component. So either it would be useful to add the ability to add markup within the .yml file of the pattern itself or to render imported stories with <PatternPreview>the same as automatic created stories.

Additional context Desired Solution for every documentation - currently only automatic MDX:

Bildschirmfoto 2020-12-04 um 04 05 56

Current implementation for MDX created manually:

Bildschirmfoto 2020-12-04 um 04 06 10
christianwiedemann commented 3 years ago

Hi, yes I also had the wish to add markup to the yml to document my stuff. The problem right now is that a storybook component renders the description. I need to check if I can simple replace that. Will let you know.

christianwiedemann commented 3 years ago

Now markup is supported in automatic pattern generation. If you want to have the same look and feel in your mdx docs you need an Wrapper

import { Meta, Title, Subtitle, Preview } from '@storybook/addon-docs/blocks';
<Preview withToolbar={true}>
  <PatternPreview variant={pattern.getDefaultVariant()} columns="4" config="equal"/>
</Preview>
iuscare commented 3 years ago

You simply rock! Thanks!