forked from vsmode/pixel8
-
Notifications
You must be signed in to change notification settings - Fork 0
/
styleguide.config.js
112 lines (112 loc) · 2.45 KB
/
styleguide.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
const { createConfig, babel } = require('webpack-blocks')
module.exports = {
title: 'Pixel8',
showSidebar: true,
showCode: true,
showUsage: false,
theme: {
sidebarWidth: 300,
color: {
base: '#364149',
link: '#008cff',
linkHover: '#008cff',
sidebarBackground: '#fafafa',
},
fontFamily: {
base: '"Helvetica Neue", Helvetica, Arial, sans-serif',
monospace: 'Menlo, Monaco, Consolas, "Courier New", monospace',
},
fontSize: {
base: 14,
h1: 36,
h2: 24,
h3: 18,
h4: 16,
},
},
assetsDir: './assets',
require: [require('path').resolve(__dirname, 'styleguide.setup.js')],
sections: [
{
name: 'Introduction',
content: 'docs/introduction.md',
},
{
name: 'Getting Started',
content: 'docs/getting-started.md',
},
{
name: 'Usage',
sections: [
{
name: 'The Stage',
sections: [
{
components: 'src/components/Stage.js',
},
],
},
{
name: 'Drawing Shapes',
sections: [
{
components: 'src/components/pixel.js',
},
{
components: 'src/components/rectangle.js',
},
{
components: 'src/components/circle.js',
},
],
},
{
name: 'Creating Motion',
sections: [
{
components: 'src/components/transition.js',
},
{
components: 'src/components/animation.js',
},
],
},
{
name: 'Text',
sections: [
{
components: 'src/components/text.js',
},
],
},
{
name: 'Sprites',
sections: [
{
components: 'src/components/sprite.js',
},
],
},
{
name: 'Buffers',
sections: [
{
components: 'src/components/buffer.js',
},
],
},
],
},
],
webpackConfig: createConfig([babel()]),
getComponentPathLine: componentPath => {
const name = require('path').basename(componentPath, '.js')
console.log(name)
switch (name) {
case 'Stage':
return `import { ${name} } from 'pixel8'`
default:
return 'no import required :)'
}
},
}