-
Notifications
You must be signed in to change notification settings - Fork 1
/
styleguide.config.js
50 lines (48 loc) · 1.21 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
const Path = require('path');
const upperFirst = require('lodash/upperFirst');
const camelCase = require('lodash/camelCase');
const { name, version, repository } = require('./package.json');
const { styles, theme } = require('./styleguide.styles');
let sections = [
{
name: 'README',
content: 'README.md',
},
{
name: 'Tokenize',
content: 'src/docs/Tokenize.md',
},
{
name: 'Greedy Tokens',
content: 'src/docs/Greedy.md',
},
{
name: 'Zero Width Joiners',
content: 'src/docs/ZeroWidthJoiners.md',
},
{
name: 'Benchmarks',
content: 'src/docs/Benchmarks.md',
},
];
module.exports = {
title: `${upperFirst(camelCase(name))} v${version}`,
ribbon: {
url: repository.url,
text: 'View on GitHub'
},
webpackConfig: require('react-scripts/config/webpack.config')('development'),
// serverPort: 3000,
styles,
theme,
getComponentPathLine: (componentPath) => {
const dirname = Path.dirname(componentPath, '.js');
const file = dirname.split('/').slice(-1)[0];
const componentName = upperFirst(camelCase(file));
return `import { ${componentName} } from "${name}";`;
},
usageMode: 'expand',
exampleMode: 'expand',
pagePerSection: true,
sections,
};