-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfractal.config.js
120 lines (112 loc) · 3.12 KB
/
fractal.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
113
114
115
116
117
118
119
120
'use strict';
const path = require('path');
const fractal = module.exports = require('@frctl/fractal').create();
const mandelbrot = require('@frctl/mandelbrot');
const pkg = require(path.join(__dirname, 'package.json'));
fractal.set('project.title', 'Reactive Graph - Design System');
fractal.set('project.version', pkg.version);
fractal.components.set('path', path.join(__dirname, 'components'));
fractal.components.set('ext', '.hbs');
fractal.components.set('default.status', 'prototype');
fractal.components.set('default.preview', '@preview');
fractal.components.set('statuses', {
prototype: {
label: "Prototype",
description: "Do not implement.",
color: "#dc0073"
},
wip: {
label: "WIP",
description: "Work in progress. Implement with caution.",
color: "#f5b700"
},
ready: {
label: "Ready",
description: "Ready to implement.",
color: "#04e762"
},
deprecated: {
label: "Deprecated",
description: "Deprecated component slated for removal.",
color: "firebrick"
},
})
fractal.docs.set('path', path.join(__dirname, 'docs'));
fractal.docs.set('ext', '.md');
fractal.docs.set('statuses', {
alpha: {
label: "Alpha",
description: "This documentation is a draft.",
color: "#dc0073"
},
beta: {
label: "Beta",
description: "Work in progress. The documentation is actively being written but not ready yet.",
color: "#f5b700"
},
stable: {
label: "Stable",
description: "The documentation is stable.",
color: "#04e762"
},
outdated: {
label: "Outdated",
description: "Outdated documentation, needs updating.",
color: "firebrick"
}
});
fractal.docs.set('default.status', 'alpha');
const handlebars = require('@frctl/handlebars')({
helpers: {
componentList: function () {
let ret = "<ul>";
const options = Array.from(arguments).pop();
for (let component of fractal.components.flatten()) {
ret = ret + "<li>" + options.fn(component.toJSON()) + "</li>";
}
return ret + "</ul>";
}
}
});
fractal.docs.engine(handlebars);
fractal.web.set('static.path', path.join(__dirname, 'public'));
fractal.web.set('builder.dest', path.join(__dirname, 'build'));
fractal.web.set('server.sync', true);
const customTheme = mandelbrot({
styles: [
'default',
'/css/fractal.css',
'/css/reactive-graph.css'
],
favicon: '/favicon/favicon.svg',
skin: {
name: 'default',
accent: '#00a1e4',
complement: '#dc0073',
links: '#00a1e4',
},
nav: ['search', 'docs', 'components'],
navigation: 'split',
information: [
{
label: 'Name',
value: require('./package.json').name,
},
{
label: 'Version',
value: require('./package.json').version,
},
{
label: 'Built on',
value: new Date(),
type: 'time', // Outputs a <time /> HTML tag
format: (value) => {
return value.toLocaleDateString('en');
}
}
],
}
);
// specify a directory to hold the theme override templates
customTheme.addLoadPath(path.join(__dirname, 'theme', 'views'));
fractal.web.theme(customTheme);