forked from stacks-network/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget-content.sh
executable file
·50 lines (39 loc) · 1.45 KB
/
get-content.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
#!/bin/bash
# get the content from the downstream repos
# needs jq "brew install jq"
collectionList=$(<collections.json)
for collection in $(echo "$collectionList" | jq -r '.collections[] | @base64'); do
# Get the collection structure
_jq() {
echo ${collection} | base64 --decode | jq -r ${1}
}
theName=$(echo $(_jq '.name'))
theRepo=$(echo $(_jq '.repo'))
echo "Getting the _$theName"
rm -rf _$theName
svn checkout $theRepo/trunk/docs _$theName
#
# sed -i "" "s/THETITLE/${theTitle}/g" ${DIR}/pdfconfigs/config_mydoc_pdf.yml
#
# for code in $(echo $(_jq '.codes') | jq -r '.[]'); do
# theCode=${code}
# sed -i "" "s/${code}/pdf/g" ${DIR}/_data/sidebars/mydoc_sidebar.yml
# done
#
# echo 'Killing all Jekyll instances'
# kill -9 $(ps aux | grep '[j]ekyll' | awk '{print $2}')
# clear
#
# echo "Building PDF-friendly HTML site for Mydoc ...";
# bundle exec jekyll serve --detach --config _config.yml,pdfconfigs/config_mydoc_pdf.yml;
# echo "done";
#
# echo "Building the PDF ...";
# prince --javascript --pdf-keywords=prince-no-fallback --input-list=_site/pdfconfigs/prince-list.txt -o pdf/${theName}_${theVersion}.pdf;
#
#
# ## Reset everything for the next collection
# git checkout -- ${DIR}/collection-list.json
# git checkout -- ${DIR}/pdfconfigs/config_mydoc_pdf.yml
# git checkout -- ${DIR}/_data/sidebars/mydoc_sidebar.yml
done