X-Git-Url: https://git.sommitrealweird.co.uk/bpgallery.git/blobdiff_plain/657a5a1384747ed03979162ea282e5653a790acc..5da939c907eff9831f8a9140b8589f51b7bbf07a:/README diff --git a/README b/README index 6af9d16..81c0a4e 100644 --- a/README +++ b/README @@ -10,6 +10,7 @@ The ImageMagick tools (convert and identify) bash GNU find GNU xargs +sed Installation ------------ @@ -19,8 +20,77 @@ Usage ----- bpgallery.sh /path/to/image/files +Also, the following files, if placed in the images directory, will be used to +generate part of the index page: + description.txt - a simple text file containing paragraphs to go at the + beginnings of the index page + captions.txt - filenamecaption style file, it'll add a caption to + the images on 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) + BPGALLERY_THEME_DIR - set an extra location to look for themes + OUTPUTHTML - sets the script output to be wrapped in a
 block
+        GENERATEPAGESFORFULLSIZE - decide wether to generate pages for the full
+                                   size images or not
+
+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:
+		        $link        - the page/image to link to
+                        $filename    - the name of the file
+                        $caption     - the caption as got from captions.txt
+	bpgallery_ThemeName_page()
+		what's it for?:
+                        It generates the pages for fullsize image pages
+		available variables:
+                        $filename    - the name of the image
+                        $previouspage - the URL for the previous page
+                        $currentpage - the url for the current page
+                        $nextpage    - the url for the next page
+                        $caption     - the image caption
+
+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
+is deliberate!
+
 Author
 ------
 Brett Parker:
-	e-mail: 
-	www:    http://www.sommitrealweird.co.uk/
+        e-mail: 
+        www:    http://www.sommitrealweird.co.uk/