Skip to content

Commit 9ec621d

Browse files
committed
Add docs script
1 parent 2b9d7f5 commit 9ec621d

21 files changed

+136
-18
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ dist
55
yarn-error.log
66
.prettierignore
77
.env
8-
.vscode
8+
.vscode
9+
storybook-static

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"watch-package": "lerna run --scope @*/mini-frame --include-dependencies --parallel x -- watch",
1313
"watch-all": "lerna run --parallel x -- watch",
1414
"storybook": "lerna run --scope storybook start --stream",
15+
"docs": "lerna run build-docs",
1516
"dev": "lerna run --scope react-website dev --stream",
1617
"release": "auto shipit"
1718
},

packages/storybook/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"version": "0.3.0-next.0",
55
"scripts": {
66
"start": "start-storybook -c ./src -s ./public",
7-
"build-storybook": "build-storybook -c ./src -s ./public -o ./dist"
7+
"build-storybook": "build-storybook -c ./src -s ./public -o ./dist",
8+
"build-docs": "build-storybook -c ./src -s ./public --docs"
89
},
910
"dependencies": {
1011
"@code-hike/code-diff": "0.3.0-next.0",

packages/storybook/src/code.story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { WithProgress } from "./utils"
44
import { codeDiff } from "@code-hike/code-diff"
55

66
export default {
7-
title: "Smooth Code",
7+
title: "Test/Smooth Code",
88
argTypes: {
99
center: { control: "boolean" },
1010
containerWidth: {

packages/storybook/src/column.story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { WithProgress } from "./utils"
33
import { SmoothColumn } from "@code-hike/smooth-column"
44

55
export default {
6-
title: "Smooth Column",
6+
title: "Test/Smooth Column",
77
}
88
export const oneExitOneEnter = () => {
99
const padding = 10

packages/storybook/src/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
module.exports = {
2-
stories: ["*.story.js"],
2+
stories: [
3+
"mini-editor.docs.story.js",
4+
"*.story.mdx",
5+
"*.story.js",
6+
],
37
addons: [
48
"@storybook/addon-docs",
59
"@storybook/addon-controls",

packages/storybook/src/mini-browser-hike.story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "@code-hike/mini-browser/dist/index.css"
44
import { WithProgress, Page } from "./utils"
55

66
export default {
7-
title: "Mini Browser Hike",
7+
title: "Test/Mini Browser Hike",
88
}
99

1010
export const basic = () => (

packages/storybook/src/mini-browser.story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "@code-hike/mini-browser/dist/index.css"
44
import { WithProgress, Page } from "./utils"
55

66
export default {
7-
title: "Mini Browser",
7+
title: "Test/Mini Browser",
88
}
99

1010
export const basic = () => (

packages/storybook/src/mini-editor-hike.story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Page, WithProgress } from "./utils"
44
import "@code-hike/mini-editor/dist/index.css"
55

66
export default {
7-
title: "Mini Editor Hike",
7+
title: "Test/Mini Editor Hike",
88
}
99

1010
const code1 = `console.log(1)`
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!--- Checkbox.stories.mdx -->
2+
3+
import { Meta, Story, Canvas } from "@storybook/addon-docs"
4+
import { MiniEditorTween } from "@code-hike/mini-editor"
5+
6+
<Meta
7+
title="Mini Editor Hike"
8+
component={MiniEditorTween}
9+
/>
10+
11+
# Checkbox
12+
13+
With `MDX`, we can define a story for `Checkbox` right in the middle of our
14+
Markdown documentation.
15+
16+
<!--- This is your Story template function, shown here in React -->
17+
18+
export const Template = ({ codeProps }) => (
19+
<MiniEditorTween codeProps={codeProps} />
20+
)
21+
22+
<Canvas>
23+
<Story
24+
name="Unchecked"
25+
args={{
26+
codeProps: "Unchecked",
27+
}}
28+
>
29+
{Template.bind({})}
30+
</Story>
31+
</Canvas>

0 commit comments

Comments
 (0)