# storybook-addon-edit-stories

> A storybook addon to add a edit this... link

Latest version **0.9.1** (published 2019-08-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install storybook-addon-edit-stories
pnpm add storybook-addon-edit-stories
yarn add storybook-addon-edit-stories
bun add storybook-addon-edit-stories
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.1 |
| Published | 2019-08-30 |
| First published | 2019-08-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 8.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Atanas Stoyanov |
| Maintainers | atanasster |
| Keywords | addon, react, storybook |

## Links

- npm: https://www.npmjs.com/package/storybook-addon-edit-stories
- Repository: https://github.com/atanasster/storybook-addon-edit-stories
- Homepage: https://github.com/atanasster/storybook-addon-edit-stories/
- Issues: https://github.com/atanasster/storybook-addon-edit-stories/issues
- npm.io page: https://npm.io/package/storybook-addon-edit-stories

## Dependencies (2)

- [memoizerific](https://npm.io/package/memoizerific.md) ^1.11.3
- [@storybook/design-system](https://npm.io/package/@storybook/design-system.md) ^0.0.44

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.9.1 (latest) — 2019-08-30
- 0.9.0 — 2019-08-29

## README

# storybook-addon-edit-stories

A storybook addon to turn your Storybok site into a CMS allowing the users to submit edit PRs for your components and documentation

|||
| :------------- | :----------: |
|**Preview** |![Edit on preview](./assets/edit-preview.jpg)|
|**Docs tab** |![Edit on docs](./assets/edit-docs.jpg)|
|**mdx file** |![Edit mdx](./assets/edit-mdx.jpg)|
## Live demo
[sample-edit-page](https://atanasster.github.io/storybook-addon-edit-stories/)

## Installation
```sh
npm i -D storybook-addon-edit-stories
```

## Setup

You can add the source file name to the stories metadata in CSF:

```js
export default {
  title: 'Stories|With edit',
  component: Link,
  parameters: {
    edit: {
      fileName: 'https://github.com/storybookjs/design-system/blob/master/src/components/Link.js'
    },  
  }
};
```

Or to mdx files: 
```md
<Meta
  title="Test mdx|Add edit on Doc tab?"
  parameters={{
    edit:{ 
      fileName: 'https://raw.githubusercontent.com/storybookjs/storybook/next/addons/docs/docs/docspage.md' 
    }  
 }}/>

```
## Usage
In your `addons.js`, define your configuration and pass it in to the `editStories` initializer


```js
mport { editStories } from '../dist';

const gitPageResolver = ({ fileName } ) => {
  return fileName;
}
editStories({
  fileNameResolve: gitPageResolver,
  editPageLabel: 'edit this page...',
});

```

## Options

**fileNameResolve**: function to resolve the file name, by default returns the supplied fileName<br/>
**editPageLabel**: label for the Edit this page link - by default `EDIT THIS PAGE`<br/>

---
_Source: https://npm.io/package/storybook-addon-edit-stories · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
