In the pictools scheme for organizing pictures, an overview directory introduces a sequence of subdirectories for aspects of the overview. (In PhysPics, there is an overview for each year and the aspects of the year are mostly the various trips we took that year.) On the source site, the subdirectories do not exist; instead the parent directory has a single "captions" file that describes all the segments, their titles, their pictures and captions, and any commentary.
Contents of a segment directory
The captions file is split into segments by lines of the form
file: segname Segment-title
For each segment, gendirs
generates a separate subdirectory named segname and containing index.php
and localcaptions.cap
:
Subtitle lines are white on green;
text blocks are white on black
index.php
- Illustrated at the right. Displays thumbnails of the pictures in the segment, with subtitles and captions. Clicking a thumbnail jumps to a full window for the picture. Yellow button near upper left starts a slideshow.
localcaptions.cap
- A copy from the
.cap
file of the lines for this segment. On the server, servepicture.php consults this file to generate individual picture pages. When the slideshow button is clicked this captions file is passed to SlideShow.php
to transform this file into the slideshow.
(Gendirs.csh
and genhtml/csh
are almost obsolete--server-side code could generate the index.php file. However, a segment may contain text and subtitles interspersed among the lines of pictures. The code for this is in C and is non-trivial, so gendirs/genhtml
live on.)
Since gendirs
should not be called directly, these command line options are moot:
-Dvar=value |
these items are collected and passed to the call to genhtml ; the values can be invoked from the template |
-n ncols |
set the number of columns on thumbs pages; overrides any property value; can be overridden by assignments in the captions file |
captions.cap |
name the captions file to be processed |
Gendirs
is a two-phase process. The first phase constructs a table giving the predecssor and successor for each segment. The second phase runs genhtml
for each segment. It macro-expands the file named by property thumbs.template
, which defaults to thumbsparms.php
. Here is an annotated list of the parameters passed by gendirs
to genhtml
. The value of segname is from the file:
line.
${PICTOOLS}/genhtml \ |
|
|
gncols \ |
gncols is "-n ncol" where ncol is the thumbcols property |
|
-c segname/localcaptions.cap \ |
the input captions file; genhtml expands this at the point in the template file that says "$pictures " |
|
$defines \ |
the -Dvar=value lines from the invocation of gendirs |
|
-Dpicdir= picdir \ |
picdir comes from a picturesdir: line in the captions file |
|
-Dprev=prevfnm \
-Dprevbutton=pbut \
-Dnext=nextfnm \
-Dnextbutton=nbut \ |
link buttons and destinations for PREV and NEXT buttons;
these values come from gendirs's first pass through the captions file |
|
|
-Dsegname=segname \ |
makes segname available to the template; currently unused |
|
-Dcapfile=$1'\ |
the full captions file for all segments; currently ignored |
|
-t 'title ' \ |
page title for the subdirrectory index; from the file: line |
|
-o segname/index.ext \ |
the output file |
|
$thumbstpl |
template to be macro expanded to generate the page; value of property thumbs.template ; default value "/library/thumbsparms.php " |
In additon to creating the -o
output file, genhtml
outputs a series of <li> entries like
<li><a href="Highlights/index.php">
My Best Pictures of 2007</a></li>
<li><a href="Becky-Shower/index.php">
Becky's Baby Shower, June 2007</a></li>
MakeTarget
s writes these lines to file capfilename-titles.txt
where capfilename is the captions file name without its extension. The index.php
for the directory may choose to include this file within a <list>
as a quick way to give links to the subdirectories. (Few of my directories actually do this.)
If environment variable PICTOOLSDEBUG
is 1 or greater, the environment variables/values are written to /tmp/pictoolsdebug.log
.
If 4 or greater, a sequence of integers is written, one
at each step; these may help to identify a point of failure.