-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathk8sdocmjs.sh
executable file
·40 lines (28 loc) · 1.27 KB
/
k8sdocmjs.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
#!/usr/bin/env bash
# Mac OS X
# export PATH="/Applications/calibre.app/Contents/MacOS/:$PATH"
# npm i puppeteer --save
# k8sdocmjs.sh
function convertmenu {
local file=$1
local title=$2
echo "converting to $title.epub"
ebook-convert "$file" "$title.epub" --title "$title" --breadth-first \
--level1-toc '//h:body/h:ul/h:li/h:a' \
--level2-toc '//h:body/h:ul/h:ul/h:li/h:a | //h:body/h:ul/h:ul/h:li/h:ul/h:li/h:a' \
--level3-toc '//h:body/h:ul/h:ul/h:ul/h:li/h:a | //h:body/h:ul/h:ul/h:li/h:ul/h:ul/h:li/h:a' \
--no-chapters-in-toc \
--use-auto-toc \
--epub-inline-toc --output-profile=kindle_pw \
--publisher Kubernetes --authors Kubernetes --language=en --cover=kubcloud.jpg
echo "converting to $title.mobi"
ebook-convert "$title.epub" "$title.azw3" --output-profile=kindle_pw
}
function download_convert {
convertmenu "kubernetes.io/docs/concepts/index.html.menu.html" "KubernetesConcepts"
convertmenu "kubernetes.io/docs/tasks/index.html.menu.html" "KubernetesTasks"
convertmenu "kubernetes.io/docs/tutorials/index.html.menu.html" "KubernetesTutorials"
convertmenu "kubernetes.io/docs/reference/index.html.menu.html" "KubernetesReference"
convertmenu "kubernetes.io/docs/setup/index.html.menu.html" "KubernetesGettingStarted"
}
download_convert