forked from kathypennacchio/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docs_build.sh
executable file
·32 lines (25 loc) · 1.2 KB
/
docs_build.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
#!/bin/sh
rm _cartodb-platform/cartodb-js.md
rm _cartodb-platform/sql-api.md
rm _cartodb-platform/maps-api.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 _cartodb-js.md _cartodb-platform/cartodb-js.md
cp _sql-api.md _cartodb-platform/sql-api.md
cp _maps-api.md _cartodb-platform/maps-api.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 >> _cartodb-platform/cartodb-js.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 >> _cartodb-platform/maps-api.md
rm API-js.md
rm API-sql.md
rm Map-API.md