diff --git a/MIGRATION.md b/MIGRATION.md index 2cca9327d9d9..c6b2437090ef 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -40,7 +40,7 @@ - [Docs Changes](#docs-changes) - [Standalone docs files](#standalone-docs-files) - [Referencing stories in docs files](#referencing-stories-in-docs-files) - - [Docs Page](#docs-page) + - [Autodocs](#autodocs) - [Configuring the Docs Container](#configuring-the-docs-container) - [External Docs](#external-docs) - [MDX2 upgrade](#mdx2-upgrade) @@ -754,32 +754,32 @@ import * as SecondComponentStories from './second-component.stories'; ``` -#### Docs Page +#### Autodocs -In 7.0, rather than rendering each story in "docs view mode", Docs Page operates by adding additional sidebar entries for each component. By default it uses the same template as was used in 6.x, and the entries are entitled `Docs`. +In 7.0, rather than rendering each story in "docs view mode", Autodocs (formerly known as "Docs Page") operates by adding additional sidebar entries for each component. By default it uses the same template as was used in 6.x, and the entries are entitled `Docs`. -You can configure Docs Page in `main.js`: +You can configure Autodocs in `main.js`: ```js module.exports = { docs: { - docsPage: 'automatic', // see below for alternatives + autodocs: true, // see below for alternatives defaultName: 'Docs', // set to change the name of generated docs entries }, }; ``` -If you are migrating from 6.x your `docs.docsPage` option will have been set to `'automatic'`, which has the effect of enabling docs page for _every_ CSF file. However, as of 7.0, the new default is `true`, which requires opting into DocsPage per-CSF file, with the `docsPage` **tag** on your component export: +If you are migrating from 6.x your `docs.autodocs` option will have been set to `true`, which has the effect of enabling docs page for _every_ CSF file. However, as of 7.0, the new default is `'tag'`, which requires opting into Autodocs per-CSF file, with the `autodocs` **tag** on your component export: ```ts export default { component: MyComponent // Tags are a new feature coming in 7.1, that we are using to drive this behaviour. - tags: ['docsPage'] + tags: ['autodocs'] } ``` -You can also set `docsPage: false` to opt-out of docs page entirely. +You can also set `autodocs: false` to opt-out of Autodocs entirely. You can change the default template in the same way as in 6.x, using the `docs.page` parameter. diff --git a/code/addons/docs/src/preset.ts b/code/addons/docs/src/preset.ts index ffdfa1007975..8e81b9e4e55a 100644 --- a/code/addons/docs/src/preset.ts +++ b/code/addons/docs/src/preset.ts @@ -152,7 +152,7 @@ const docs = (docsOptions: DocsOptions) => { ...docsOptions, disable: false, defaultName: 'Docs', - docsPage: true, + autodocs: 'tag', }; }; diff --git a/code/addons/docs/template/stories/docspage/autoplay.stories.ts b/code/addons/docs/template/stories/docspage/autoplay.stories.ts index 50b01ae74504..7f32348bc00c 100644 --- a/code/addons/docs/template/stories/docspage/autoplay.stories.ts +++ b/code/addons/docs/template/stories/docspage/autoplay.stories.ts @@ -4,7 +4,7 @@ import { within } from '@storybook/testing-library'; export default { component: globalThis.Components.Pre, - tags: ['docsPage'], + tags: ['autodocs'], args: { text: 'Play has not run' }, parameters: { chromatic: { disable: true } }, }; diff --git a/code/addons/docs/template/stories/docspage/basic.stories.ts b/code/addons/docs/template/stories/docspage/basic.stories.ts index cf8768751607..72d1059758d7 100644 --- a/code/addons/docs/template/stories/docspage/basic.stories.ts +++ b/code/addons/docs/template/stories/docspage/basic.stories.ts @@ -2,7 +2,7 @@ import { global as globalThis } from '@storybook/global'; export default { component: globalThis.Components.Button, - tags: ['docsPage'], + tags: ['autodocs'], args: { label: 'Click Me!' }, parameters: { chromatic: { disable: true } }, }; diff --git a/code/addons/docs/template/stories/docspage/description.stories.ts b/code/addons/docs/template/stories/docspage/description.stories.ts index 98ed1de51473..f42edc5901c3 100644 --- a/code/addons/docs/template/stories/docspage/description.stories.ts +++ b/code/addons/docs/template/stories/docspage/description.stories.ts @@ -6,7 +6,7 @@ export default { subcomponents: { Pre: globalThis.Components.Pre, }, - tags: ['docsPage'], + tags: ['autodocs'], args: { label: 'Click Me!' }, parameters: { docs: { diff --git a/code/addons/docs/template/stories/docspage/extract-description.stories.ts b/code/addons/docs/template/stories/docspage/extract-description.stories.ts index bc9033127f68..cb5986ac7dbe 100644 --- a/code/addons/docs/template/stories/docspage/extract-description.stories.ts +++ b/code/addons/docs/template/stories/docspage/extract-description.stories.ts @@ -2,7 +2,7 @@ import { global as globalThis } from '@storybook/global'; export default { component: globalThis.Components.Button, - tags: ['docsPage'], + tags: ['autodocs'], args: { label: 'Click Me!' }, parameters: { docs: { diff --git a/code/addons/docs/template/stories/docspage/iframe.stories.ts b/code/addons/docs/template/stories/docspage/iframe.stories.ts index 8a087afca04a..80cff47272c8 100644 --- a/code/addons/docs/template/stories/docspage/iframe.stories.ts +++ b/code/addons/docs/template/stories/docspage/iframe.stories.ts @@ -2,7 +2,7 @@ import { global as globalThis } from '@storybook/global'; export default { component: globalThis.Components.Button, - tags: ['docsPage'], + tags: ['autodocs'], args: { label: 'Rendered in iframe' }, parameters: { chromatic: { disable: true }, diff --git a/code/addons/docs/template/stories/docspage/overflow.stories.ts b/code/addons/docs/template/stories/docspage/overflow.stories.ts index 9c3c7f7b70d9..71893031af5b 100644 --- a/code/addons/docs/template/stories/docspage/overflow.stories.ts +++ b/code/addons/docs/template/stories/docspage/overflow.stories.ts @@ -2,7 +2,7 @@ import { global as globalThis } from '@storybook/global'; export default { component: globalThis.Components.Pre, - tags: ['docsPage'], + tags: ['autodocs'], args: { text: 'Demonstrates overflow', style: { width: 2000, height: 500, background: 'hotpink' }, diff --git a/code/addons/docs/template/stories/docspage/override.stories.ts b/code/addons/docs/template/stories/docspage/override.stories.ts index 0f46a108c325..18d2d4e5e25c 100644 --- a/code/addons/docs/template/stories/docspage/override.stories.ts +++ b/code/addons/docs/template/stories/docspage/override.stories.ts @@ -15,7 +15,7 @@ const Override = () => 'overridden'; export default { component: globalThis.Components.Button, - tags: ['docsPage'], + tags: ['autodocs'], args: { label: 'Click Me!' }, parameters: { chromatic: { disable: true }, diff --git a/code/addons/docs/template/stories/docspage/source.stories.ts b/code/addons/docs/template/stories/docspage/source.stories.ts index 84d12fe56f1c..9d30522758d2 100644 --- a/code/addons/docs/template/stories/docspage/source.stories.ts +++ b/code/addons/docs/template/stories/docspage/source.stories.ts @@ -2,7 +2,7 @@ import { global as globalThis } from '@storybook/global'; export default { component: globalThis.Components.Button, - tags: ['docsPage'], + tags: ['autodocs'], args: { label: 'Click Me!' }, parameters: { chromatic: { disable: true } }, }; diff --git a/code/frameworks/angular/template/cli/Button.stories.ts b/code/frameworks/angular/template/cli/Button.stories.ts index 6bcd3ee47389..85ce82c88270 100644 --- a/code/frameworks/angular/template/cli/Button.stories.ts +++ b/code/frameworks/angular/template/cli/Button.stories.ts @@ -5,7 +5,7 @@ import Button from './button.component'; const meta: Meta