-
Notifications
You must be signed in to change notification settings - Fork 7
/
styleguide.config.js
95 lines (94 loc) · 2.12 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
const path = require('path');
module.exports = {
title: 'Uast Viewer',
require: [path.resolve(__dirname, 'styles/default-theme.scss')],
context: {
uast: path.resolve(__dirname, 'fixtures/uast-v2-java-large.json'),
smallUast: path.resolve(__dirname, 'fixtures/uast-v2-java-small.json'),
sourceCode: path.resolve(__dirname, 'docs/example_java_source.js')
},
sections: [
{
name: 'Quick start',
content: 'docs/quick_start.md'
},
{
name: 'Use cases',
sections: [
{
name: 'Uncontrolled',
content: 'docs/cases/uncontrolled.md'
},
{
name: 'Controlled',
content: 'docs/cases/controlled.md'
},
{
name: 'With source code',
content: 'docs/cases/with_source_code.md'
}
]
},
{
name: 'UI Components',
components: 'src/components/**/*.js'
},
{
name: 'State',
content: 'docs/state.md',
sections: [
{
name: 'Helpers',
content: 'docs/state/helpers.md'
},
{
name: 'Position index',
content: 'docs/state/position_index.md'
},
{
name: 'UAST v2',
content: 'docs/state/uast-v2.md'
},
{
name: 'UAST v1',
content: 'docs/state/uast-v1.md'
}
]
}
],
getExampleFilename(componentPath) {
return path.resolve(
__dirname,
`${componentPath.replace('src/', 'docs/').replace(/\.js$/, '.md')}`
);
},
pagePerSection: true,
ribbon: {
url: 'https://github.com/src-d/uast-viewer',
text: 'Fork me on GitHub'
},
webpackConfig: {
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
}
]
},
resolve: {
alias: {
'uast-viewer': path.resolve(__dirname, 'src/index.js')
}
}
}
};