forked from OpenFn/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sidebars-library.js
51 lines (46 loc) · 1.05 KB
/
sidebars-library.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
const fs = require('fs');
const publicFile = fs.readFileSync('./library/jobs/auto/publicPaths.json');
const publicJobs = JSON.parse(publicFile);
// Note: we can include out own examples here.
const jobs = [...publicJobs];
const groupedJobs = jobs.reduce((r, a) => {
r[a.adaptor] = r[a.adaptor] || [];
r[a.adaptor].push(a);
return r;
}, Object.create(null));
const items = Object.keys(groupedJobs)
.sort()
.map(a => {
return {
type: 'category',
label: a,
items: groupedJobs[a]
.map(j => {
return {
type: 'doc',
id: j.id,
label: j.name,
};
})
.sort((a, b) => {
return a.label.localeCompare(b.label, 'en', {
sensitivity: 'base',
});
}),
};
});
module.exports = {
library: [
{ type: 'doc', id: 'library-intro' },
// {
// type: 'category',
// label: 'Jobs',
...items,
// },
// {
// type: 'category',
// label: 'Triggers',
// items: ['triggers/xmlns'],
// },
],
};