General bug fixes
authorBrett Parker <arch@sommitrealweird.co.uk>
Sat, 13 May 2006 08:37:55 +0000 (08:37 +0000)
committerBrett Parker <arch@sommitrealweird.co.uk>
Sat, 13 May 2006 08:37:55 +0000 (08:37 +0000)
* Make the README indented nicely and mention the BPGALLERY_THEME environmental variable
* Reindent the default stylesheet to be all tabs
* Add in more verbosity about what the script is doing

git-archimport-id: arch@sommitrealweird.co.uk--2005-desktop/bpgallery--mainline--1.0--patch-17

README
bpgallery.sh

diff --git a/README b/README
index 56579151dcff44aabfd04ddd7e366cf236ff1352..84a566bceb290db54a75779db37f9613b39d82cc 100644 (file)
--- a/README
+++ b/README
@@ -29,44 +29,47 @@ generate part of the index page:
 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)
 
 Example Usage:
         TITLE="My Funky Gallery" bpgallery.sh /path/to/image/files
 
 Themes
 ------
-Theme support is very rudimentary, basically you create functions for each of the parts of the template, and put them in a file named the same as the theme. The functions that you need to declare are as follows:
-       bpgallery_ThemeName_head()
-               what's it for?:
-                       This sets up the header for the page, generally
-                       everything until the first picture. So, the title bar
-                       and any menus you would like to use
-               available variables:
-                       $TITLE       - the title for the index page
-       bpgallery_ThemeName_tail()
-               what's it for?:
-                       Closes the page, is the last thing to be printed.
-               available variables:
-                       None
-       bpgallery_ThemeName_description()
-               what's it for?:
-                       if there's a description set up (i.e. a description.txt
-                       file) then this is what it'll be wrapped in. It comes
-                       just after the _head.
-               available variables:
-                       $DESCRIPTION - the content of description.txt
-       bpgallery_ThemeName_stylesheet()
-               what's if for?:
-                       It generates the stylesheet for the page.
-               available variables:
-                       $WIDTH       - the width of the images
-                       $MAXHEIGHT   - the maximum height of the image
-       bpgallery_ThemeName_thumbsline()
-               what's it for?:
-                       Whatever is in here is generated per thumbnail.
-               available variables:
-                       $filename    - the name of the file
-                       $caption     - the caption as got from captions.txt
+Theme support is very rudimentary, basically you create functions for each of
+the parts of the template, and put them in a file named the same as the theme.
+The functions that you need to declare are as follows:
+        bpgallery_ThemeName_head()
+                what's it for?:
+                        This sets up the header for the page, generally
+                        everything until the first picture. So, the title bar
+                        and any menus you would like to use
+                available variables:
+                        $TITLE       - the title for the index page
+        bpgallery_ThemeName_tail()
+                what's it for?:
+                        Closes the page, is the last thing to be printed.
+                available variables:
+                        None
+        bpgallery_ThemeName_description()
+                what's it for?:
+                        if there's a description set up (i.e. a description.txt
+                        file) then this is what it'll be wrapped in. It comes
+                        just after the _head.
+                available variables:
+                        $DESCRIPTION - the content of description.txt
+        bpgallery_ThemeName_stylesheet()
+                what's if for?:
+                        It generates the stylesheet for the page.
+                available variables:
+                        $WIDTH       - the width of the images
+                        $MAXHEIGHT   - the maximum height of the image
+        bpgallery_ThemeName_thumbsline()
+                what's it for?:
+                        Whatever is in here is generated per thumbnail.
+                available variables:
+                        $filename    - the name of the file
+                        $caption     - the caption as got from captions.txt
 
 If any of the functions are not defined in a theme then the default theme
 function will be used instead. The default theme is clean and simplistic, this
index f6fdfedb7c6e75a722e63d4614428ed3b5585e71..631582116c871e8a26e6cb4bd9bcb7db93288f4d 100755 (executable)
@@ -70,18 +70,18 @@ declare -rf bpgallery_default_tail
 function bpgallery_default_stylesheet() {
 cat <<END
 body {
-        background: white;
-        color: black;
-        font-family: sans-serif;
-        font-size: 10pt;
+       background: white;
+       color: black;
+       font-family: sans-serif;
+       font-size: 10pt;
 }
 
 div.thumbnail {
-        float: left;
-        padding: 20px;
-        border: 0px;
-        width: ${WIDTH}px;
-        height: ${MAXHEIGHT}px;
+       float: left;
+       padding: 20px;
+       border: 0px;
+       width: ${WIDTH}px;
+       height: ${MAXHEIGHT}px;
 }
 
 div.caption {
@@ -91,11 +91,11 @@ div.caption {
 }
 
 a {
-        border: 0px;
+       border: 0px;
 }
 
 img {
-        border: 0px;
+       border: 0px;
 }
 END
 }
@@ -334,13 +334,19 @@ else
 fi
 
 
+$ECHOCOMMAND "Starting to generate page"
+
 $BPGALLERY_HEAD_FUNCTION > index.html
 $BPGALLERY_DESCRIPTION_FUNCTION >> index.html
 
+$ECHOCOMMAND "Adding Captions"
+
 $FINDCOMMAND . $FINDIMAGESOPTIONS | $XARGSCOMMAND -0 --replace $ECHOCOMMAND {} |$SORTCOMMAND -g | while read filename; do filename=${filename#./}; if [ -r captions.txt ]; then caption=$($GREPCOMMAND -E "^$filename  " captions.txt); caption=${caption#*    }; else caption=""; fi; filename=$(bpgallery_escape_url "$filename"); $BPGALLERY_THUMBSLINE_FUNCTION; done >> index.html
 
 $BPGALLERY_TAIL_FUNCTION >> index.html
 
+$ECHOCOMMAND "Finished generating the page"
+$ECHOCOMMAND "Generating stylesheet"
 cd icons
 
 MAXHEIGHT=$($FINDCOMMAND . $FINDIMAGESOPTIONS | $XARGSCOMMAND -0 $IDENTIFYCOMMAND -format "%h\n" | $GREPCOMMAND -v "^$" | $SORTCOMMAND -g -r | $HEADCOMMAND -n 1)
@@ -353,3 +359,4 @@ MAXHEIGHT=$((MAXHEIGHT+$CAPTIONHEIGHT))
 
 $BPGALLERY_STYLESHEET_FUNCTION > style.css
 
+$ECHOCOMMAND "All done"