forked from dataesr/react-dsfr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
styleguide.config.js
77 lines (76 loc) · 2.25 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
const path = require('path');
module.exports = {
title: '@dataesr/react-dsfr',
styleguideDir: 'build',
skipComponentsWithoutExample: true,
pagePerSection: true,
components: 'src/components/**/[A-Z]*.js',
usageMode: 'collapse',
tocMode: 'collapse',
theme: {
color: {
link: '#000091',
linkHover: '#8F9779',
},
fontFamily: {
base: "'Marianne', sans-serif",
},
},
template: { favicon: 'https://raw.githubusercontent.com/dataesr/react-dsfr/master/favicon.ico' },
styleguideComponents: {
Wrapper: path.join(__dirname, './styleguide/Wrapper'),
},
getExampleFilename(componentPath) {
return componentPath.replace(/\.js?$/, '.md');
},
getComponentPathLine(componentPath) {
const name = path.basename(componentPath, '.js');
return `import { ${name} } from '@dataesr/react-dsfr';`;
},
sections: [
{
name: '',
content: './README.md',
sectionDepth: 0,
}, {
name: 'Composants',
content: 'src/components/COMPONENTS.md',
sectionDepth: 2,
sections: [
{
name: 'Fondamentaux',
content: 'src/components/foundation/FOUNDATION.md',
sectionDepth: 1,
sections: [
{
name: 'Grid system',
content: 'src/components/foundation/grid/Grid.md',
components: 'src/components/foundation/grid/**/[A-Z]*.js',
},
{
name: 'Icons',
content: 'src/components/foundation/icon/Icons.md',
components: 'src/components/foundation/icon/**/[A-Z]*.js',
},
{
name: 'Medias',
content: 'src/components/foundation/media/MEDIA.md',
components: 'src/components/foundation/media/**/[A-Z]*.js',
},
{
name: 'Typographie',
content: 'src/components/foundation/typography/TYPOGRAPHY.md',
components: 'src/components/foundation/typography/**/[A-Z]*.js',
},
],
},
{
name: 'Élements d\'interface',
content: 'src/components/interface/INTERFACE.md',
sectionDepth: 1,
components: 'src/components/interface/**/[A-Z]*.js',
},
],
},
],
};