This repository was archived by the owner on Jun 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyleguide.config.js
More file actions
78 lines (77 loc) · 1.85 KB
/
styleguide.config.js
File metadata and controls
78 lines (77 loc) · 1.85 KB
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
const path = require('path');
module.exports = {
title: '@ox2/iframe',
serverPort: 55002,
styleguideDir: './docs',
skipComponentsWithoutExample: true,
webpackConfig: {
module: {
loaders: [
{
test: /\.js?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['env'],
plugins: [
require('babel-plugin-transform-class-properties'),
require('babel-plugin-transform-do-expressions'),
require('babel-plugin-transform-export-extensions'),
require('babel-plugin-transform-object-rest-spread'),
],
},
},
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
],
},
},
require: [
'@ox2/css-font-roboto-condensed',
'@ox2/css-font-roboto',
'@ox2/ycss',
],
sections: [
{
name: 'Get Started',
sections: [
{
name: 'About',
content: './info/introduction.md',
},
{
name: 'Installation',
content: './info/installation.md',
},
{
name: 'Usage',
content: './info/usage.md',
},
],
},
{
name: 'Components',
components: 'src/**/[A-Z]*.js',
},
{
name: 'History',
content: './CHANGELOG.md',
},
{
name: 'License',
content: './LICENSE',
},
],
getExampleFilename: componentpath =>
componentpath.replace(/\.js$/, '.examples.md'),
getComponentPathLine: componentPath => {
const name = path.basename(componentPath, '.js');
const componentPathFixed = componentPath.replace(/src\//i, '');
const dir = path.dirname(componentPathFixed);
return `import ${name} from '@ox2/iframe/${dir}';`;
},
};