Added alpha documentation bundle script.
Reviewers: buda Reviewed By: buda Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D470
This commit is contained in:
parent
c081281944
commit
928f52af47
1
docs/.gitignore
vendored
1
docs/.gitignore
vendored
@ -2,3 +2,4 @@ doxygen/html/
|
||||
doxygen/latex/
|
||||
user_technical/.couscous/
|
||||
user_technical/couscous.phar
|
||||
user_technical/docs.tar.gz
|
||||
|
35
docs/user_technical/bundle
Executable file
35
docs/user_technical/bundle
Executable file
@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
working_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# curl and php are required
|
||||
if ! which php >/dev/null; then
|
||||
echo "php is required!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd ${working_dir}
|
||||
generator="couscous.phar"
|
||||
|
||||
# download the generator if it's not already downloaded
|
||||
if [ ! -f ${generator} ]; then
|
||||
curl -OS http://couscous.io/${generator}
|
||||
fi
|
||||
|
||||
# generate the site
|
||||
php ${generator} generate
|
||||
|
||||
# fix paths in generated files
|
||||
cd .couscous/generated
|
||||
for i in *; do
|
||||
if [ ! -f $i ]; then continue; fi
|
||||
sed -i 's@/css/@/docs/css/@g' $i
|
||||
sed -i 's@/fonts/@/docs/fonts/@g' $i
|
||||
sed -r 's@(<small class="hidden-xs hidden-sm">)@<small class="hidden-xs hidden-sm">Alpha</small></a>\n<a class="navbar-brand" href="/docs/">\1@' -i $i
|
||||
done
|
||||
|
||||
# create archive
|
||||
target=docs.tar.gz
|
||||
tar -czf $working_dir/$target *
|
||||
|
||||
echo "Created archive: $working_dir/$target"
|
Loading…
Reference in New Issue
Block a user