diff options
author | Corentin Le Gall <corentinlgs@gmail.com> | 2018-07-19 15:57:30 +0200 |
---|---|---|
committer | Corentin Le Gall <corentinlgs@gmail.com> | 2018-07-24 14:42:12 +0200 |
commit | c96df58a88b60c7501b3c8a758c0277c17088371 (patch) | |
tree | 1e982c565a4fd0ba65a382cc1cba97efe891c34b /docs/resources/make_cover.sh | |
parent | 55673d50338f041763e6e38f38ea3fc311f2bdc1 (diff) |
Changed doc to GitBook format + added doc
-Changed README.md to a complet GitBook doc.
-Added explanations about EvtGrpReceived functions.
-Corrected mistakes + reduced lines length.
Change-Id: I1a077ddf6acb520a9158de658d3c09b12a2029d4
Signed-off-by: Corentin Le Gall <corentinlgs@gmail.com>
Diffstat (limited to 'docs/resources/make_cover.sh')
-rwxr-xr-x | docs/resources/make_cover.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/resources/make_cover.sh b/docs/resources/make_cover.sh new file mode 100755 index 0000000..1026ecb --- /dev/null +++ b/docs/resources/make_cover.sh @@ -0,0 +1,27 @@ +#!/bin/bash +DOCS_DIR=$(cd $(dirname $0)/.. && pwd) +BOOKFILE=$DOCS_DIR/../book.json + +TITLE=$(grep '"title":' $BOOKFILE | cut -d'"' -f 4) +SUBTITLE=$(grep '"subtitle":' $BOOKFILE | cut -d'"' -f 4) +VERSION="Version $(grep '"version":' $BOOKFILE | cut -d'"' -f 4)" +DATE=$(grep '"published":' $BOOKFILE | cut -d'"' -f 4) + +[ -z "$TITLE" ] && { echo "Error TITLE not set!" ; exit 1; } +[ -z "$VERSION" ] && { echo "Error VERSION not set!" ; exit 1; } +[ -z "$DATE" ] && { echo "Error DATE not set!" ; exit 1; } + + +cat $(dirname $0)/cover.svg | sed -e "s/{title}/$TITLE/g" \ + -e "s/font-size:87.5px/font-size:54px/g" \ + -e "s/{subtitle}/$SUBTITLE/g" \ + -e "s/font-size:62.5px/font-size:40px/g" \ + -e "s/{version}/$VERSION/g" \ + -e "s/{date}/$DATE/g" \ + > /tmp/cover.svg + +# use imagemagick convert tool (cover size must be 1800x2360) +convert -resize "1600x2160!" -border 100 -bordercolor white -background white \ + -flatten -quality 100 /tmp/cover.svg $DOCS_DIR/cover.jpg + +convert -resize "200x262!" $DOCS_DIR/cover.jpg $DOCS_DIR/cover_small.jpg |