forked from SAP-archive/docpad-skeleton-apidocs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchewieConfig.js
120 lines (106 loc) · 3.73 KB
/
chewieConfig.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
const config = {
tempLocation: './tmp',
skeletonDestination: './src',
skeletonOutDestination: './out',
placeholdersLocation: './src/raw/placeholders',
docuUrl: process.env.docuURL || 'http://your.webpage.io',
notClonedRepositoriesFile: 'notClonedRepositories.json',
indepenedentDocuRepositoriesFile: 'indepenedentDocuRepositories.json',
registry: {
location: process.env.REGISTRY_LOCATION || 'remote',
path: process.env.REGISTRY_PATH || 'https://github.com/mareknawa/apidoc-workshop-docu_registry.git',
fileName: 'docu_registry.json',
branch: process.env.docuBranch || 'master',
shortVersionFileName: 'shrinkedRegistry.json',
clonedRegistryFolder: 'registry'
},
docu: {
clonedRepoFolder: 'docuSources',
srcRepoDocuFolder: 'docu',
metaFileName: 'meta-inf',
folders: {
mainDocu: 'files',
getStart: 'gettingstarted',
releaseNotes: 'release_notes',
contentReuse: 'partials'
}
},
generationResult: {
srcLocation: 'https://github.com/hybris/chewie-sample-result.git',
branch: process.env.docuBranch || 'master',
cloneLocation: 'latestResultRepo'
},
constantLocations: {
apinotebooksLocation: './src/documents/apinotebooks',
apinotebooksTestMatrixFile: './src/raw/matrix/apinotebook.txt'
},
typesSrcLocNotMainDocu: [
'gettingstarted',
'overview',
'solutions',
'architecture',
'docu_guide'
],
typesWithReleaseNotes: [
'tools',
'services'
],
defaultBaseUriDomain: 'localhost'
};
const out = config.skeletonOutDestination;
config.minification = {
js: [{
src: [
`${out}/bower_components/jquery/dist/jquery.min.js`,
`${out}/bower_components/bootstrap/dist/js/bootstrap.min.js`,
`${out}/bower_components/select2/select2.min.js`,
`${out}/bower_components/lscache/lscache.min.js`,
`${out}/scripts/custom/polyfills.js`,
`${out}/bower_components/kjur-jsrsasign/jws-3.3.js`,
`${out}/build/plugins/embed-hash-persistence.js`,
`${out}/scripts/custom/jquery-custom-animations.js`,
`${out}/scripts/custom/jquery-custom-prototypes.js`
],
dest: `${out}/scripts/`,
name: 'devportal-yaas-head.min.js'
},
{
src: [`${out}/scripts/general/*.js`],
dest: `${out}/scripts/`,
name: 'devportal-yaas.min.js'
}],
css: [{
src: [
`${out}/styles/main.css`,
`${out}/styles/7-components/globalnomodal.css`
],
dest: `${out}/styles/`,
name: 'devportal-yaas.css'
}],
html: [{
src: [
`${out}/**/*.html`,
`!${out}/error/error.html`,
`!${out}/services/**/client/README.html`,
`!${out}/bower_components/**/*.html`
],
dest: `${out}/`,
opts: {
collapseWhitespace: true,
ignoreCustomFragments: [/<div.*class\s*=\s*["']mermaid["']\s*>((.|\n)*?)<\/div>/g]
}
}]
};
//add attributes to registry
config.registry.registryPath = `${config.tempLocation}/${config.registry.fileName}`;
config.registry.clonedRegistryFolderPath = `${config.tempLocation}/${config.registry.clonedRegistryFolder}`;
config.registry.shortRegistryPath = `${config.tempLocation}/${config.registry.shortVersionFileName}`;
config.registry.pathFolderWithClonedRegistry = `${config.tempLocation}/${config.registry.clonedRegistryFolder}/registry`;
//add attributes to docu
config.docu.clonedRepoFolderPath = `${config.tempLocation}/${config.docu.clonedRepoFolder}`;
//add attributes to generationResult
config.generationResult.clonedResultFolderPath = `${config.tempLocation}/${config.generationResult.cloneLocation}`;
config.generationResult.pathFolderWithClonedResult = `${config.generationResult.clonedResultFolderPath}`;
//add location with docu files
config.skeletonSrcDestination = `${config.skeletonDestination}/documents`;
module.exports = config;