-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
48 lines (46 loc) · 1.45 KB
/
index.ts
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
import { WidthType, Table, TableRow, TableCell } from 'docx';
import type { EnhancedProject } from '~/entities/enhanced';
import header, { Keys as KeysForHeader } from './header';
import detail from './detail';
export type Keys =
| KeysForHeader
| 'description'
| 'env'
| 'highlights'
| 'roles';
export default (project: Pick<EnhancedProject, Keys> = {}): Table[] => [
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
...header(project),
new TableRow({
cantSplit: true,
children: [
new TableCell({
children: [
...detail({ body: project.description, heading: '概要' }),
...detail({ body: project.roles, heading: '業務内容' }),
...detail({ body: project.highlights, heading: '取り組み' }),
],
margins: { left: 100, right: 100 },
}),
...(project.env
? [
new TableCell({
children: [
...detail({ body: project.env.os, heading: 'OS' }),
...detail({ body: project.env.languages, heading: '言語' }),
...detail({
body: project.env.platforms,
heading: 'その他',
}),
],
margins: { left: 100, right: 100 },
}),
]
: []),
],
}),
],
}),
];