forked from kathypennacchio/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docs_build_print.sh
executable file
·30 lines (22 loc) · 1013 Bytes
/
docs_build_print.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
#!/bin/sh
rm print.md
wget -O API-js.md https://raw.githubusercontent.com/CartoDB/cartodb.js/develop/doc/API.md
wget -O API-sql.md https://raw.githubusercontent.com/CartoDB/CartoDB-SQL-API/master/doc/API.md
wget -O Map-API.md https://raw.githubusercontent.com/CartoDB/Windshaft-cartodb/master/docs/Map-API.md
cp _print.md print.md
sed -i.bak -E 's/^```(.+)/{% highlight \1 %}/g' API-js.md
sed -i.bak -E 's/^```/{% endhighlight %}/g' API-js.md
sed -i.bak -E 's/\{% raw %\}//' API-js.md
sed -i.bak -E 's/\{% endraw %\}//' API-js.md
sed -i.bak -E 's/\{\{(.*)\}\}/{% raw %}{{\1}}{% endraw %}/' API-js.md
cat API-js.md >> print.md
sed -i.bak -E 's/^```(.+)/{% highlight \1 %}/g' API-sql.md
sed -i.bak -E 's/^```/{% endhighlight %}/g' API-sql.md
cat API-sql.md >> _cartodb-platform/sql-api.md
sed -i.bak -E 's/^```(.+)/{% highlight \1 %}/g' Map-API.md
sed -i.bak -E 's/^```/{% endhighlight %}/g' Map-API.md
cat Map-API.md >> print.md
cat _includes/import.md >> print.md
rm API-js.md
rm API-sql.md
rm Map-API.md