-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
105 lines (97 loc) · 2.57 KB
/
index.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
const _ = require('lodash');
module.exports = function(mandelbrot, options = {}) {
const defaultStyles = ['default', '/cadetfrctl/axe.css'];
const defaultConfig = {
skin: 'default',
rtl: false,
lang: 'en',
styles: defaultStyles,
highlightStyles: 'default',
scripts: 'default',
format: 'json',
static: {
mount: 'themes/mandelbrot',
},
favicon: null,
labels: {
info: 'Information',
builtOn: 'Built on',
search: {
label: 'Search',
placeholder: 'Search…',
clear: 'Clear search',
},
navigation: {
back: 'Back',
},
tree: {
collapse: 'Collapse tree',
},
components: {
handle: 'Handle',
tags: 'Tags',
variants: 'Variants',
context: {
empty: 'No context defined.',
},
notes: {
empty: 'No notes defined.',
},
preview: {
label: 'Preview',
withLayout: 'With layout',
componentOnly: 'Component only',
},
path: 'Filesystem Path',
references: 'References',
referenced: 'Referenced by',
resources: {
file: 'File',
content: 'Content',
previewUnavailable: 'Previews are currently not available for this file type.',
url: 'URL',
path: 'Filesystem Path',
size: 'Size',
},
},
panels: {
html: 'HTML',
view: 'View',
context: 'Context',
resources: 'Resources',
info: 'Info',
notes: 'Notes',
a11y: 'A11y'
},
},
panels: [
'html',
'view',
'context',
'resources',
'info',
'notes',
'a11y'
],
};
const config = Object.assign(defaultConfig, options);
if ( config.styles ) {
if ( Array.isArray(config.styles) ) {
if ( !config.styles.includes('/cadetfrctl/axe.css')) {
config.styles.push('/cadetfrctl/axe.css');
}
} else {
config.styles = [config.styles, '/cadetfrctl/axe.css'];
}
} else {
config.styles = defaultStyles;
}
const subTheme = mandelbrot(config);
subTheme.addLoadPath(__dirname + '/views');
subTheme.addStatic(__dirname + '/assets', '/cadetfrctl');
subTheme.on('init', function (env, app) {
require('./lib/filters')(subTheme, env, app);
// console.log(env);
});
return subTheme
}