From 829d971c9b5fbc69d686c4aa495ed22f9c0b2df7 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Sat, 18 Nov 2023 03:25:45 -0700 Subject: [PATCH] Readme update (#11) --- README.md | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b8c2378..e52e1c8 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,43 @@ npm install storybook-source-link ```
+Add `storybook-source-code` to your addons array in the config object at `.storybook/main.js|ts` + +Example: + +```js +import type { StorybookConfig } from "@storybook/nextjs"; + +const config: StorybookConfig = { + stories: [ + "../stories/**/*.mdx", + "../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)", + ], + addons: [ + "@storybook/addon-links", + "@storybook/addon-essentials", + "@storybook/addon-onboarding", + "@storybook/addon-interactions", + "storybook-source-link" // <-- add it here + ], + framework: { + name: "@storybook/nextjs", + options: {}, + }, + docs: { + autodocs: "tag", + }, +}; + +export default config; +``` +
+Without any additional configuration, +you should see a new link in the toolbar like so: + +
+ ![Screen Shot 2022-03-23 at 1 15 50 PM](https://user-images.githubusercontent.com/24869532/159789033-8aaa0813-9434-458d-ae2f-c2aae36da426.png) -Without any additional configuration, -you should see a new link in the toolbar

Usage