Check tools are available
[bpgallery.git] / README
1 Introduction
2 ------------
3 bpgallery is a small static gallery generator, it generates an index file and
4 thumbnails of your images. The index file is generated in the image folder,
5 icons in a subfolder called icons.
6
7 Requirements
8 ------------
9 The ImageMagick tools (convert and identify)
10 bash
11 GNU find
12 GNU xargs
13 sed
14
15 Installation
16 ------------
17 Copy the file bpgallery.sh to a directory in your PATH.
18
19 Usage
20 -----
21 bpgallery.sh /path/to/image/files
22
23 Also, the following files, if placed in the images directory, will be used to
24 generate part of the index page:
25         description.txt
26             a simple text file containing paragraphs to go at the beginnings of
27             the index page
28         captions.txt
29             filename<tab>caption style file, it'll add a caption to the images
30             on the index page.
31
32 The following environment variables can also be used:
33         TITLE
34             the title of the gallery
35
36         WIDTH
37             the width to make the icons
38
39         MEDIUMWIDTH
40             set the width of images in the medium size pages
41
42         BPGALLERY_THEME
43             set the theme to use (described below)
44
45         BPGALLERY_THEME_DIR
46             set an extra location to look for themes
47
48         OUTPUTHTML
49             sets the script output to be wrapped in a <pre> block
50
51         GENERATEPAGESFORMEDIUMSIZE
52             generate medium sized images and pages
53
54         GENERATEPAGESFORFULLSIZE
55             decide wether to generate pages for the full size images or not
56
57         INDEXDOCUMENT
58             name of the index page (e.g. index.html)
59
60         PAGESDIRECTORY
61             name of the directory in which to put the pages for fullsized and
62             mediumsized images. Defaults to the image directory. This is
63             relative to the images directory, so, for example,
64             PAGESDIRECTORY=pages would create /path/to/image/files/pages
65
66         MEDIUMDIRECTORY
67             directory to generate medium sized images in, defaults to medium,
68             works the same as the PAGESDIRECTORY variable
69
70         ICONSDIRECTORY
71             directory to generate thumbnails in, defaults to icons, works the
72             same as MEDIUMDIRECTORY and PAGESDIRECTORY
73
74 Example Usage:
75         TITLE="My Funky Gallery" bpgallery.sh /path/to/image/files
76
77 Themes
78 ------
79 Theme support is very rudimentary, basically you create functions for each of
80 the parts of the template, and put them in a file named the same as the theme.
81 The functions that you need to declare are as follows:
82
83         Available in all templates:
84             ${BASEURL}
85                 Base directory (will generate ../ when making pages in a
86                 subdirectory for getting to the generated stylesheet or to the
87                 index page)
88
89         bpgallery_ThemeName_head()
90                 what's it for?:
91                         This sets up the header for the page, generally
92                         everything until the first picture. So, the title bar
93                         and any menus you would like to use
94                 available variables:
95                         $TITLE       - the title for the index page
96         bpgallery_ThemeName_tail()
97                 what's it for?:
98                         Closes the page, is the last thing to be printed.
99                 available variables:
100                         None
101         bpgallery_ThemeName_description()
102                 what's it for?:
103                         if there's a description set up (i.e. a description.txt
104                         file) then this is what it'll be wrapped in. It comes
105                         just after the _head.
106                 available variables:
107                         $DESCRIPTION - the content of description.txt
108         bpgallery_ThemeName_stylesheet()
109                 what's if for?:
110                         It generates the stylesheet for the page.
111                 available variables:
112                         $WIDTH       - the width of the images
113                         $MAXHEIGHT   - the maximum height of the image
114         bpgallery_ThemeName_thumbsline()
115                 what's it for?:
116                         Whatever is in here is generated per thumbnail.
117                 available variables:
118                         $link        - the page/image to link to
119                         $filename    - the name of the file
120                         $caption     - the caption as got from captions.txt
121         bpgallery_ThemeName_page()
122                 what's it for?:
123                         It generates the pages for fullsize image pages
124                 available variables:
125                         $filename    - the name of the image
126                         $previouspage - the URL for the previous page
127                         $currentpage - the url for the current page
128                         $nextpage    - the url for the next page
129                         $caption     - the image caption
130
131 If any of the functions are not defined in a theme then the default theme
132 function will be used instead. The default theme is clean and simplistic, this
133 is deliberate!
134
135 Author
136 ------
137 Brett Parker:
138         e-mail: <iDunno@sommitrealweird.co.uk>
139         www:    http://www.sommitrealweird.co.uk/