From 11457acde806cff6a5dcf9c7cdc17996a51499d9 Mon Sep 17 00:00:00 2001 From: Kaitlin Jaffe Date: Tue, 22 Sep 2020 13:54:05 -0700 Subject: [PATCH 1/3] Add documentation for `transcludeMarkdown` option --- addons/docs/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/docs/README.md b/addons/docs/README.md index 025b85720be8..e86e72c4b8eb 100644 --- a/addons/docs/README.md +++ b/addons/docs/README.md @@ -154,6 +154,7 @@ module.exports = { configureJSX: true, babelOptions: {}, sourceLoaderOptions: null, + transcludeMarkdown: true, }, }, ], @@ -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 enable mdx files to import `.md` files and render them as a component. Example: +```mdx +import { Meta } from '@storybook/addon-docs/blocks'; +import Changelog from '../CHANGELOG.md'; + + + + +``` + ## 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): From 24f7d82dcb9930ddbde1934900d8b14af4fc0093 Mon Sep 17 00:00:00 2001 From: Kaitlin Jaffe Date: Tue, 22 Sep 2020 14:04:26 -0700 Subject: [PATCH 2/3] remove "Example" text --- addons/docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/docs/README.md b/addons/docs/README.md index e86e72c4b8eb..06795013a2aa 100644 --- a/addons/docs/README.md +++ b/addons/docs/README.md @@ -165,7 +165,7 @@ 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 enable mdx files to import `.md` files and render them as a component. Example: +The `transcludeMarkdown` option enable 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'; From 2b42954d420aa13fcd159ac32dbbd1e5c550414f Mon Sep 17 00:00:00 2001 From: Kaitlin Jaffe Date: Thu, 1 Oct 2020 12:32:26 -0700 Subject: [PATCH 3/3] Update README.md --- addons/docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/docs/README.md b/addons/docs/README.md index 06795013a2aa..9e89cc7d1cbf 100644 --- a/addons/docs/README.md +++ b/addons/docs/README.md @@ -165,7 +165,7 @@ 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 enable mdx files to import `.md` files and render them as a component. +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';