-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.md.sh
executable file
·75 lines (57 loc) · 1.25 KB
/
README.md.sh
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
#!/bin/bash -e
source include.sh
function wrap() {
sed 's/$/\n/' | fold -w 78 -s | trim | sed '${/^$/d}'
}
function job_md() {
local path="$1"
function job() {
get "$path.$*"
}
cat <<EOL
### $(job title) @ $(job company.name) ($(job start) - $(job end))$(
[[ $(job 'description') ]] && {
echo
echo
job description | wrap | sed 's/^/ /'
}
[[ $(job 'accomplishments | length') -gt 0 ]] && {
[[ $(job 'description') ]] || echo
echo
}
job 'accomplishments[]' | while read -r line; do
echo -n "- $line" | wrap
done
)
EOL
}
cat <<EOF >README.md
---
title: Resume - $(get name)
date: $(date -I)
---
*PDF version available [here]($PDF)*
$(get email)
$(get location)
$(get about | wrap)
## Links
$(
yq -crM '.links | .[] | .url' data.yaml | while read -r url; do
echo "- <$url>"
done
)
## History
$(for job in $(get 'history | keys | .[]'); do
job_md "history[$job]"
for client in $(get "history[$job].clients | keys[]"); do
echo -n '#'
job_md "history[$job].clients[$client]"
done
done)
## Education
$(edu degree) ($(edu focus))
$(edu school)
Graduated: $(edu graduated)
EOF
check README.md
pandoc --standalone --template README.template.html -o README.html README.md