Return-Path: X-Original-To: apmail-brooklyn-commits-archive@minotaur.apache.org Delivered-To: apmail-brooklyn-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 055D4190E5 for ; Thu, 10 Mar 2016 10:44:47 +0000 (UTC) Received: (qmail 4469 invoked by uid 500); 10 Mar 2016 10:44:47 -0000 Delivered-To: apmail-brooklyn-commits-archive@brooklyn.apache.org Received: (qmail 4439 invoked by uid 500); 10 Mar 2016 10:44:46 -0000 Mailing-List: contact commits-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list commits@brooklyn.apache.org Received: (qmail 4422 invoked by uid 99); 10 Mar 2016 10:44:46 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Mar 2016 10:44:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C160EDFC16; Thu, 10 Mar 2016 10:44:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aledsage@apache.org To: commits@brooklyn.apache.org Date: Thu, 10 Mar 2016 10:44:47 -0000 Message-Id: <54950304a66a4adc9acb71543e89c1e9@git.apache.org> In-Reply-To: <11419fa44d3c40bebf9f2995827249d4@git.apache.org> References: <11419fa44d3c40bebf9f2995827249d4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/3] brooklyn-docs git commit: Renamed script & optimised Renamed script & optimised Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/59216734 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/59216734 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/59216734 Branch: refs/heads/master Commit: 59216734945a6667fc440c108b175350a4f3ff7c Parents: 2a70855 Author: Duncan Godwin Authored: Mon Mar 7 15:28:55 2016 +0000 Committer: Duncan Godwin Committed: Mon Mar 7 15:28:55 2016 +0000 ---------------------------------------------------------------------- _build/build-pdf.sh | 29 +++++++++++++++++++++++++++++ _build/build.sh | 8 ++++---- _build/buildPDF.sh | 32 -------------------------------- 3 files changed, 33 insertions(+), 36 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/59216734/_build/build-pdf.sh ---------------------------------------------------------------------- diff --git a/_build/build-pdf.sh b/_build/build-pdf.sh new file mode 100755 index 0000000..175458e --- /dev/null +++ b/_build/build-pdf.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +# +# this generates A PDF from a HTML file + +if [ ! -x _build/build.sh ] ; then + echo "ERROR: script must be run in root of docs dir" + exit 1 +fi + +if [ "$#" -lt 2 ] ; then + echo "Usage: build-pdf.sh [user-style-sheet]" + exit 1 +fi + +if ! command -v wkhtmltopdf >/dev/null 2>&1; then + echo "ERROR: script requires wkhtmltopdf but it's not installed." + exit 1 +fi + +# run the PDF build with wkhtmltopdf +wkhtmltopdf ${3:+--user-style-sheet $3} --page-size Letter --margin-top 0.75in --margin-right 0.75in --margin-bottom 0.75in --margin-left 0.75in --encoding UTF-8 $1 $2 + +if [ $? -eq 1 ] ; then + echo "Note that ContentNotFoundError is usually because of the invalid relational path of a local resource such as an image" +elif [ $? -eq 0 ] ; then + echo "PDF Built successfully." +else + exit $? +fi \ No newline at end of file http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/59216734/_build/build.sh ---------------------------------------------------------------------- diff --git a/_build/build.sh b/_build/build.sh index 6bc7d45..f7a9848 100755 --- a/_build/build.sh +++ b/_build/build.sh @@ -191,12 +191,12 @@ function build_pdf() { PDF_STARTED_LOG="_pdf/pdf_gen_started.log" if [ "$SKIP_PDF_MANUAL" != "true" ]; then - _build/buildPDF.sh "_site/zoneMergeManual.html" "_pdf/UserManual.pdf" 2>&1 | tee $PDF_MANUAL_LOG - _build/buildPDF.sh "_site/zoneMergeManual.html" "_pdf/UserManual_printable.pdf" "./style/css/printable.css" 2>&1 | tee $PDF_MANUAL_LOG + _build/build-pdf.sh "_site/zoneMergeManual.html" "_pdf/UserManual.pdf" 2>&1 | tee $PDF_MANUAL_LOG + _build/build-pdf.sh "_site/zoneMergeManual.html" "_pdf/UserManual_printable.pdf" "./style/css/printable.css" 2>&1 | tee $PDF_MANUAL_LOG fi if [ "$SKIP_PDF_STARTED" != "true" ]; then - _build/buildPDF.sh "_site/zoneMergeStarted.html" "_pdf/GettingStarted.pdf" 2>&1 | tee $PDF_STARTED_LOG - _build/buildPDF.sh "_site/zoneMergeStarted.html" "_pdf/GettingStarted_printable.pdf" "./style/css/printable.css" 2>&1 | tee $PDF_STARTED_LOG + _build/build-pdf.sh "_site/zoneMergeStarted.html" "_pdf/GettingStarted.pdf" 2>&1 | tee $PDF_STARTED_LOG + _build/build-pdf.sh "_site/zoneMergeStarted.html" "_pdf/GettingStarted_printable.pdf" "./style/css/printable.css" 2>&1 | tee $PDF_STARTED_LOG fi } http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/59216734/_build/buildPDF.sh ---------------------------------------------------------------------- diff --git a/_build/buildPDF.sh b/_build/buildPDF.sh deleted file mode 100755 index ad9d95a..0000000 --- a/_build/buildPDF.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash -# -# this generates A PDF from a HTML file - -if [ ! -x _build/build.sh ] ; then - echo "ERROR: script must be run in root of docs dir" - exit 1 -fi - -if [ "$#" -lt 2 ] ; then - echo "Usage: buildPDF.sh [user-style-sheet]" - exit 1 -fi - -if ! command -v wkhtmltopdf >/dev/null 2>&1; then - echo "ERROR: script requires wkhtmltopdf but it's not installed." - exit 1 -fi - -# run the PDF build with wkhtmltopdf -if [ -z "$3" ] ; then - wkhtmltopdf --page-size Letter --margin-top 0.75in --margin-right 0.75in --margin-bottom 0.75in --margin-left 0.75in --encoding UTF-8 $1 $2 -else - wkhtmltopdf --user-style-sheet $3 --page-size Letter --margin-top 0.75in --margin-right 0.75in --margin-bottom 0.75in --margin-left 0.75in --encoding UTF-8 $1 $2 -fi -if [ $? -eq 1 ] ; then - echo "Note that ContentNotFoundError is usually because of the invalid relational path of a local resource such as an image" -elif [ $? -eq 0 ] ; then - echo "PDF Built successfully." -else - exit $? -fi \ No newline at end of file