-
Notifications
You must be signed in to change notification settings - Fork 49
/
options.js
192 lines (163 loc) · 6.08 KB
/
options.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
// Default SourceJS engine configuration
module.exports = {
// Restart the app after changing core (back-end) options
// Core options could be only redefined from user/options.js, context options are not supported
core : {
common: {
defaultLogLevel: 'INFO',
defaultProdLogLevel: 'ERROR',
includedDirs: ['docs'],
specPaths: ['specs'],
// Turn on context level setting
contextOptions: true,
// Name of context level settings file
contextOptionsFile: 'sourcejs-options.js',
// Path to your SourceJS configuration folder
pathToUser: 'user',
// Name of spec meta info file
infoFile: 'info.json',
// Name of options field in info.json, used to override configuration per spec
infoFileOptions: 'sourcejs'
},
// Server options are passed to app.listen (https://nodejs.org/api/http.html#http_server_listen_port_hostname_backlog_callback)
server: {
port: 8080,
hostname: undefined
},
api: {
specsData: 'core/api/data/pages-tree.json',
htmlData: 'core/api/data/html.json',
specsTestData: 'test/data/api-test-specs.json',
htmlTestData: 'test/data/api-test-html.json'
},
// Spec catalogs navigation tree
fileTree: {
// Exclude files from file-tree indexing (first level, in user folder)
excludedDirs: ['node_modules', 'bower_components', 'data', 'plugins', '.git', '.idea'],
// Exclude files from file-tree indexing (on any level, by folder name)
excludedDirsGlobal: ['node_modules', '.git', '.idea'],
// Update navigation tree by cron task (setTimeout)
cron: false,
// Update navigation tree when somebody visits main page
mainPageTrigger: false,
// Default thumbnail file path (relative to each spec)
thumbnail: 'thumbnail.png'
},
watch: {
enabled: true,
foreverWatchEnabled: true
},
tracking: {
// Anonymous user statistics tracking.
// Used to get insights about the community and improve engine usage experience.
enabled: true
},
// Limits EJS includes, allowing only files in project root
sandboxIncludes: true
},
// Page rendering configuration (redefinable from context options)
rendering: {
// Define priority of spec file source
specFiles: [
'index.src',
'index.src.html',
'index.jade', // https://www.npmjs.com/package/sourcejs-jade
'index.jsx', // https://www.npmjs.com/package/sourcejs-react
'index.md',
'readme.md',
'README.md',
'index.html'
],
// Define views for rendering SourceJS pages (array order define priority)
views: {
defaultViewPaths: [
'$(user)/core/views',
'$(sourcejs)/core/views'
],
spec: [
'$(user)/core/views/spec.ejs',
'$(sourcejs)/core/views/spec.ejs'
],
navigation: [
'$(user)/core/views/navigation.ejs',
'$(sourcejs)/core/views/navigation.ejs'
]
}
},
// Client-side options (redefinable from context options)
assets: {
// Page classes
containerClass : 'source_container',
headerClass : 'source_header',
SECTION_CLASS : 'source_section',
exampleSectionClass : 'source_example',
exampleCleanClass : 'source_clean',
mainClass : 'source_main',
mainNav : 'source_main_nav',
colMain : 'source_col-main',
// Core modules
modulesEnabled : {
// Enable clarify helper links in spec
clarifyInSpec: true,
htmlAPISync: true,
headerFooter: true,
specDecorations: true,
codeSource: true,
sectionFolding: true,
innerNavigation: true,
// Trims paces in example sections to emulate HTML minify, off by default
trimSpaces: false,
scrollToHash: true,
sections: true,
globalNav: true,
search: true,
loadEvents: true,
navHighlight: true,
// Enable github auth toolbar links
auth: false
},
modulesOptions : {
navHighlight: {
// Page navigation hash update on scroll turned off because of performance issues
updateHash: false
},
search: {
autofocusOnNavigationPage: true,
autofocusOnSpecPage: false,
activateOnLoad: true
}
},
// Landing page options for moduleLoader (override without extend)
navPageModulesBuild: {
modulesEnabled : {
headerFooter: true,
specDecorations: true,
globalNav: true,
search: true
},
pluginsEnabled: {},
npmPluginsEnabled: {}
},
// Legacy options object support for some older plugins (todo:remove with next major release)
pluginsOptions: {}
},
// External plugins options (are also exposed to client-side
plugins: {
// PhantomJS HTML API parser will be moved to plugin at v.0.6
htmlParser: {
enabled: false
}
},
/*
* Please pay your attention. This is DEMO github applicatio key.
*
* To get your own one please use github applications service.
* Please visit this link to get more information:
* https://developer.github.com/guides/basics-of-authentication/#registering-your-app
* Current demo key is used in test mode for http://127.0.0.1:8080
*/
github: {
appId: 'cf00a9e7ee5d9d6af36f',
appSecret: 'aebe08e0aa66f6911e4f54df81ce64c9d6e0003b'
}
};