From: Brett Parker Date: Sat, 13 May 2006 09:41:25 +0000 (+0000) Subject: Add in OUTPUTHTML Option X-Git-Tag: release-1.0.3~4 X-Git-Url: https://git.sommitrealweird.co.uk/bpgallery.git/commitdiff_plain/7ef6a62b83bf172619e03032828d59be3afc1bba?ds=inline;hp=b53a01a10ef10a699efae79e7b44d4e8d62eedd5 Add in OUTPUTHTML Option Simplistic output of HTML from the script (just wraps it in a pre block) git-archimport-id: arch@sommitrealweird.co.uk--2005-desktop/bpgallery--mainline--1.0--patch-18 --- diff --git a/README b/README index 84a566b..0825950 100644 --- a/README +++ b/README @@ -30,6 +30,7 @@ The following environment variables can also be used: TITLE - the title of the gallery WIDTH - the width to make the icons BPGALLERY_THEME - set the theme to use (described below) + OUTPUTHTML - sets the script output to be wrapped in a
 block
 
 Example Usage:
         TITLE="My Funky Gallery" bpgallery.sh /path/to/image/files
diff --git a/bpgallery.sh b/bpgallery.sh
index 6315821..8c186bb 100755
--- a/bpgallery.sh
+++ b/bpgallery.sh
@@ -214,6 +214,10 @@ if [[ -z $CAPTIONHEIGHT ]]; then
 	CAPTIONHEIGHT=75
 fi
 
+if [[ -z $OUTPUTHTML ]]; then
+	OUTPUTHTML=0
+fi
+
 if declare -F "bpgallery_${BPGALLERY_THEME}_head" > /dev/null ; then
 	BPGALLERY_HEAD_FUNCTION="bpgallery_${BPGALLERY_THEME}_head"
 else
@@ -292,6 +296,10 @@ function generate_thumbs() {
 	$ECHOCOMMAND "Completed generating thumbs for $totalimages images"
 }
 
+if [[ $OUTPUTHTML != 0 ]]; then
+	$ECHOCOMMAND "
"
+fi
+
 if [[ -z $1 ]]; then
 	$ECHOCOMMAND "No path given"
 	usage
@@ -360,3 +368,7 @@ MAXHEIGHT=$((MAXHEIGHT+$CAPTIONHEIGHT))
 $BPGALLERY_STYLESHEET_FUNCTION > style.css
 
 $ECHOCOMMAND "All done"
+
+if [[ $OUTPUTHTML != 0 ]]; then
+	$ECHOCOMMAND "
" +fi