itsjavi / storylite

A lightweight alternative to StoryBook for React, built on top of Vite⚡️, compatible with CSF 3.0
http://itsjavi.com/storylite/
MIT License
107 stars 0 forks source link

[feat]: add MD support to prepend documentation #40

Open itsjavi opened 10 months ago

itsjavi commented 10 months ago

Add simple Markdown support, to prepend documentation to each story file.

It can be done via: https://www.npmjs.com/package/@mdx-js/rollup

E.g. if button.stories.tsx has a button.stories.md or mdx, it will be parsed and prepended to the stories.

Or.. we can investigate if we can provide a docs option in the Story object, that can be a mdx import, like:

import variant1Docs from './docs/button/variant1.mdx';

export const buttonVariant1: Story = {
  // ...
  docs: variant1Docs,
  // ...
}
itsjavi commented 9 months ago

With the latest release, this should be possible. We only need to support the docs property as a JSX component or React node.