This addon for storybook (source) enables you to add Atlassian Confluence pages to your stories.
In .storybook/middleware.js
:
var buildConfluenceMiddleware = require('storybook-addon-confluence/middleware');
module.exports = buildConfluenceMiddleware('https://example.atlassian.net/wiki', 'username', 'super-secure_password');
In .storybook/addons.js
:
import '@kadira/storybook/addons';
import 'storybook-addon-confluence/register';
Use <WithConfluencePage />
element in a story:
import { WithConfluencePage } from 'storybook-addon-confluence';
storiesOf('ExampleComponent', module)
.add('Default', () => (
<WithConfluencePage space="SPACE" title="Example component">
<ExampleComponent />
</WithConfluencePage>
));
Or use a decorator for all of the stories:
import { confluencePageDecorator } from 'storybook-addon-confluence';
storiesOf('ExampleComponent', module)
.addDecorator(confluencePageDecorator('SPACE', 'Example component'))
.add('Default', () => <ExampleComponent />);
If you're working locally, you can use npm link
with this and your consuming project to do your work. There's no transpilation or prepublish step, so changes are pretty transparent.
We are committed to fostering an open and welcoming environment. Please read our code of conduct before participating in or contributing to this project.
We welcome contributions and collaboration on this project. Please read our contributor's guide to understand how best to work with us.
This software is made available by Daniel James under the MIT license.
Thanks to @bendrucker for absoluteify, which provided a great reference for using the trumpet package to convert relative paths in HTML into absolute paths.