Skip to content

Commit

Permalink
Merge pull request #12547 from dancingshell/patch-1
Browse files Browse the repository at this point in the history
Documentation: add `transcludeMarkdown` option in addon-docs
  • Loading branch information
shilman committed Apr 29, 2021
2 parents f6f4c8f + 2b42954 commit fefe4b7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions addons/docs/README.md
Expand Up @@ -154,6 +154,7 @@ module.exports = {
configureJSX: true,
babelOptions: {},
sourceLoaderOptions: null,
transcludeMarkdown: true,
},
},
],
Expand All @@ -164,6 +165,16 @@ The `configureJSX` option is useful when you're writing your docs in MDX and you

`sourceLoaderOptions` is an object for configuring `@storybook/source-loader`. When set to `null` it tells docs not to run the `source-loader` at all, which can be used as an optimization, or if you're already using `source-loader` in your `main.js`.

The `transcludeMarkdown` option enables mdx files to import `.md` files and render them as a component.
```mdx
import { Meta } from '@storybook/addon-docs/blocks';
import Changelog from '../CHANGELOG.md';

<Meta title="Changelog" />

<Changelog />
```

## Manual configuration

We recommend using the preset, which should work out of the box. If you don't want to use the preset, and prefer to configure "the long way" add the following configuration to `.storybook/main.js` (see comments inline for explanation):
Expand Down

0 comments on commit fefe4b7

Please sign in to comment.