This file is indexed.

/usr/share/doc/rest2web/html/reference/gallery.html is in rest2web-doc 0.5.2~alpha+svn-r248-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
    <title>Picture Galleries and Beyond</title>
    <link rel="stylesheet" href="../stylesheets/rest2web.css" type="text/css" />
    <link rel="stylesheet" href="../stylesheets/voidspace_docutils2.css" type="text/css" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="description" content="rest2web - build websites with Python and docutils." />
    <meta name="author" content="Michael Foord" />
    <meta name="copyright" content="&copy; 2003-2006 Michael Foord, subject to BSD License" />
    <meta name="keywords" content="rest2web - build websites with Python and docutils,
    rest, restructured text, text, website, internet, web, net, web builder, site,
    site builder, docutils, i18n, internationalization, templates, templating, 
    python, " />
    
</head>

<body style="background: url(../images/logos/img_background.gif) top center repeat-y;">
  <div id="wrap">
    <div id="header-section">
		  <a href="http://www.voidspace.org.uk/python/index.shtml" title="Voidspace"><img src="../images/logos/header760.gif" alt="Voidspace"/></a>
		  <p align="center" class="headertitle"><span style="font-size:130%">rest2web:</span> Building Websites Across the Known Universe</p>
		</div>

    <div id="header">
      <ul>
        <li><a href="../index.html">rest2web</a></li>
<li>&gt;</li>
<li><a href="index.html">Reference</a></li>
<li>&gt;</li>
<li>Gallery</li>

      </ul>
    </div>

    <table>
    <tr>
     <td><img src="../images/logos/1.gif" width="1" height="1" alt="" /></td>
     <!-- main content cell first, with rowspan=2 -->
     <td valign="top" align="left" rowspan="2">
     
    <div id="middle-column">
        <a name="startcontent" id="startcontent"></a>
                
            <div id="gallery">
                <div class="document" id="picture-galleries-and-beyond">
<h1 class="title">Picture Galleries and Beyond</h1>
<h2 class="subtitle" id="the-gallery-plugin">The Gallery Plugin</h2>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td><a class="first last reference external" href="mailto:fuzzyman&#37;&#52;&#48;voidspace&#46;org&#46;uk">Fuzzyman</a></td></tr>
<tr><th class="docinfo-name">Date:</th>
<td>2005/08/12</td></tr>
<tr><th class="docinfo-name">Version:</th>
<td>0.2.0</td></tr>
<tr class="field"><th class="docinfo-name">Homepage:</th><td class="field-body"><a class="reference external" href="http://www.voidspace.org.uk/python/rest2web/reference/gallery.html">Gallery Page</a></td>
</tr>
</tbody>
</table>
<div class="contents topic" id="galleries-of-images">
<p class="topic-title first">Galleries of Images</p>
<ul class="simple">
<li><a class="reference internal" href="#introduction" id="id15">Introduction</a></li>
<li><a class="reference internal" href="#downloading" id="id16">Downloading</a></li>
<li><a class="reference internal" href="#using-gallery-with-rest2web" id="id17">Using Gallery With rest2web</a></li>
<li><a class="reference internal" href="#uservalues-settings" id="id18">uservalues Settings</a></li>
<li><a class="reference internal" href="#standalone-program" id="id19">Standalone Program</a></li>
<li><a class="reference internal" href="#the-settings" id="id20">The Settings</a><ul>
<li><a class="reference internal" href="#standalone-specific-settings" id="id21">Standalone Specific Settings</a></li>
</ul>
</li>
<li><a class="reference internal" href="#gallery-data-file" id="id22">Gallery Data File</a><ul>
<li><a class="reference internal" href="#gallery-mode" id="id23">Gallery Mode</a></li>
</ul>
</li>
<li><a class="reference internal" href="#the-templates" id="id24">The Templates</a><ul>
<li><a class="reference internal" href="#entry-template" id="id25">entry_template</a></li>
<li><a class="reference internal" href="#page-template" id="id26">page_template</a></li>
<li><a class="reference internal" href="#gallery-template" id="id27">gallery_template</a></li>
</ul>
</li>
<li><a class="reference internal" href="#using-the-output" id="id28">Using the Output</a></li>
<li><a class="reference internal" href="#todo" id="id29">TODO</a></li>
<li><a class="reference internal" href="#footnotes" id="id30">Footnotes</a></li>
</ul>
</div>
<div class="section" id="introduction">
<h1><a class="toc-backref" href="#id15">Introduction</a></h1>
<p>The gallery acts as a plugin to <a class="reference external" href="http://www.voidspace.org.uk/python/rest2web/">rest2web</a>. (It can also fuction as a <a class="reference internal" href="#standalone-program">standalone program</a>). It generates an html gallery page from a directory of images, an html template, and a few settings.</p>
<p>It creates a single main gallery page, with thumbnails that act as links to each image. The images themselves appear on their own page, with a title and optional description. Each page has links to the next and previous images, and back to the main gallery.</p>
<p>You can see the sort of output it generates with the <a class="reference external" href="http://www.voidspace.org.uk/python/rest2web/gallery_test/index.html">online example</a>, which acts as the gallery test site in the <a class="reference external" href="http://www.voidspace.org.uk/python/rest2web/">rest2web</a> distribution.</p>
<p>If you are viewing this from the test docs, you can build the test gallery by running <a class="footnote-reference" href="#id8" id="id1">[1]</a> :</p>
<pre class="literal-block">
r2w.py gallery_test.ini
</pre>
<p>You can then view the gallery at <a class="reference external" href="../gallery_test/index.html">gallery index</a>.</p>
</div>
<div class="section" id="downloading">
<h1><a class="toc-backref" href="#id16">Downloading</a></h1>
<p>At some point I will package the gallery on it's own. Currently it's only available bundled with <strong>rest2web</strong>.</p>
</div>
<div class="section" id="using-gallery-with-rest2web">
<h1><a class="toc-backref" href="#id17">Using Gallery With rest2web</a></h1>
<p>In order to use it with rest2web,  <tt class="docutils literal"><span class="pre">gallery.py</span></tt> needs to be available in the <tt class="docutils literal"><span class="pre">plugins</span></tt> subdirectory of rest2web - and also <a class="reference external" href="http://www.pythonware.com/products/pil">PIL</a> must be installed.</p>
<p>In order to use the gallery in a page, you must have 'gallery' in your list of plugins for the page. This is done in the restindex, with a line like :</p>
<pre class="literal-block">
plugins: gallery
</pre>
<p>Next you must specify a set of values that tell the gallery what to do. When run as a plugin you specify these as <tt class="docutils literal"><span class="pre">uservalues</span></tt>.</p>
</div>
<div class="section" id="uservalues-settings">
<h1><a class="toc-backref" href="#id18">uservalues Settings</a></h1>
<p>The settings control the gallery program, they specify which directory to read the images from, which templates to use to generate the output pages, and so on.</p>
<p>All the settings must be present, or the gallery will raise an error. Assuming you have no other <tt class="docutils literal"><span class="pre">uservalues</span></tt>, the settings look like :</p>
<pre class="literal-block">
uservalues
    thumb_size = 150, 150
    gallery_dir = ../../FTP Mirror/gallery
    gallery_url = gallery
    data_file = gallery_data.ini
    page_template = page.html
    entry_template = entry.html
    gallery_mode = 1
/uservalues
</pre>
<p>See <a class="reference internal" href="#the-settings">the settings</a> section for an explanation of what they all mean.</p>
</div>
<div class="section" id="standalone-program">
<h1><a class="toc-backref" href="#id19">Standalone Program</a></h1>
<p><em>gallery.py</em> will work as a standalone program as well as a plugin to rest2web. It uses the same settings, but gets them from a config file instead of uservalues.</p>
<p>One of the main reasons to make gallery.py run in this way, was so that Aidan could use it for his online <a class="reference external" href="http://www.nebulae.org.uk">Pages of Computer Imagery</a>.</p>
<p>In order to use gallery.py as a standalone program, you will need <a class="reference external" href="http://www.python.org">Python</a> 2.3 or later and a recent version of <a class="reference external" href="http://www.pythonware.com/products/pil">PIL</a>. You will also need either <a class="reference external" href="http://www.voidspace.org.uk/python/pythonutils.html">pythonutils</a> 0.20 <em>and</em> <a class="reference external" href="http://www.voidspace.org.uk/python/rest2web/">rest2web</a> installed <a class="footnote-reference" href="#id9" id="id2">[2]</a> ; or just version 0.2.0 (or higher) of pythonutils <a class="footnote-reference" href="#id10" id="id3">[3]</a>.</p>
<p>By default the gallery looks for a config file called <tt class="docutils literal"><span class="pre">gallery.ini</span></tt>. You can also specify an alternative config file at the command line <a class="footnote-reference" href="#id11" id="id4">[4]</a>.</p>
<p>All the settings need to be present or the gallery will raise an error. The complete settings are :</p>
<pre class="literal-block">
thumb_size = 150, 150
gallery_dir = ../../FTP Mirror/gallery
gallery_url = gallery
data_file = gallery_data.ini
page_template = page.html
entry_template = entry.html
gallery_template = gallery.html
gallery_mode = 1
gallery_page = gallery_page.html
</pre>
<p>See <a class="reference internal" href="#the-settings">the settings</a> for what they mean.</p>
</div>
<div class="section" id="the-settings">
<h1><a class="toc-backref" href="#id20">The Settings</a></h1>
<p>Most of the settings have the same meaning however you use gallery.</p>
<ul>
<li><p class="first"><tt class="docutils literal"><span class="pre">thumb_size</span></tt> -&gt; <tt class="docutils literal"><span class="pre">width,</span> <span class="pre">height</span></tt></p>
<blockquote>
<p>e.g. <em>150, 150</em></p>
<p>This is the <em>maximum</em> size of the generated thumbnails. It keeps the proportions of the original image.</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">gallery_dir</span></tt> -&gt; <tt class="docutils literal"><span class="pre">path</span> <span class="pre">to</span> <span class="pre">directory</span></tt></p>
<blockquote>
<p>e.g. <em>../../FTP Mirror/gallery</em></p>
<p>This is the path from the file to the directory of images.</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">gallery_url</span></tt> -&gt; <tt class="docutils literal"><span class="pre">url</span> <span class="pre">path</span></tt></p>
<blockquote>
<p>e.g. <em>gallery</em></p>
<p>The final url path from the gallery to the image directory. This path is used to make paths for all the images/thumbnails/pages.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">When run as a standalone program, the image directory should be in a single subdirectory from the main gallery. Hopefully this limitation will be removed soon.</p>
</div>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">data_file</span></tt> -&gt; <tt class="docutils literal"><span class="pre">filepath</span></tt></p>
<blockquote>
<p>e.g. <em>gallery_data.ini</em></p>
<p>This is the data file that stores details of all the image files and thumbnails. See the <a class="reference internal" href="#gallery-data-file">Gallery Data File</a> section for details.</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">page_template</span></tt> -&gt; <tt class="docutils literal"><span class="pre">filepath</span></tt></p>
<blockquote>
<p>e.g. <em>page.html</em></p>
<p>The path to the template file for the individual pages. See <a class="reference internal" href="#the-templates">The Templates</a> for details.</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">entry_template</span></tt> -&gt; <tt class="docutils literal"><span class="pre">filepath</span></tt></p>
<blockquote>
<p>e.g. <em>entry.html</em></p>
<p>The path to the template file for every thumbnail on the main page. See <a class="reference internal" href="#the-templates">The Templates</a> for details.</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">gallery_mode</span></tt> -&gt; <tt class="docutils literal"><span class="pre">1</span></tt> or <tt class="docutils literal"><span class="pre">2</span></tt></p>
<blockquote>
<p>e.g. <em>1</em></p>
<p>Whether gallery should scan all the images (1), or just use the stored data file to generate the pages (2). See the <a class="reference internal" href="#gallery-data-file">Gallery Data File</a> section for details.</p>
</blockquote>
</li>
</ul>
<div class="section" id="standalone-specific-settings">
<h2><a class="toc-backref" href="#id21">Standalone Specific Settings</a></h2>
<p>These next two settings are only used when gallery.py is run as a standalone program.</p>
<ul>
<li><p class="first"><tt class="docutils literal"><span class="pre">gallery_template</span></tt> -&gt; <tt class="docutils literal"><span class="pre">filepath</span></tt></p>
<blockquote>
<p>e.g. <em>gallery.html</em></p>
<p>This is the template file used to create the main gallery page.</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">gallery_page</span></tt> -&gt; <tt class="docutils literal"><span class="pre">filepath</span></tt></p>
<blockquote>
<p>e.g. <em>gallery_page.html</em></p>
<p>This is the filename to save the main gallery page as. See <a class="reference internal" href="#the-templates">The Templates</a> for details.</p>
</blockquote>
</li>
</ul>
</div>
</div>
<div class="section" id="gallery-data-file">
<h1><a class="toc-backref" href="#id22">Gallery Data File</a></h1>
<p>The gallery data file won't exist until the first time you run gallery.</p>
<p>When <em>gallery.py</em> runs it scans the image directory and stores the details of each image. It puts all the thumbnails in a 'thumbnail' subdirectory of the image directory. It puts all the html pages it creates in an 'html' subdirectory of the image directory. If these directories don't exist, it will create them.</p>
<p>The datafile it creates is effectively a config file with sections <a class="footnote-reference" href="#id12" id="id5">[5]</a> - one section per image !</p>
<p>If you have pythonutils 0.3.0 <a class="footnote-reference" href="#id13" id="id6">[6]</a> (or more recent) then the order of these sections will be the order that images appear in the gallery. This means you can cut and paste to edit the order.</p>
<div class="warning">
<p class="first admonition-title">Warning</p>
<p class="last">If you run gallery (in mode 1) after removing any images from the image directory - it will remove their entry from the data file.</p>
</div>
<p>There are two other entries that you can edit per image :</p>
<ol class="arabic">
<li><p class="first"><em>Title</em> - by default gallery generates a title for the image based on the filename. It replaces '_' with spaces and capitalizes words.</p>
</li>
<li><p class="first"><em>Description</em> - You can put an optional description for the image here. This will appear below the image, on it's page.</p>
<blockquote>
<div class="note">
<p class="first admonition-title">Note</p>
<p>Entering a description with several lines is only possible with pythonutils 0.3.0 or higher (or configobj 4).</p>
<p class="last">If you have pythonutils 0.3.0, you should surround entries with multiple lines between triple quotes - <tt class="docutils literal"><span class="pre">'''like</span> <span class="pre">this'''</span></tt>.</p>
</div>
</blockquote>
</li>
</ol>
<div class="section" id="gallery-mode">
<h2><a class="toc-backref" href="#id23">Gallery Mode</a></h2>
<p>The details it stores in the data file are sufficient to generate the main gallery page and all the individual pages, without having to scan the image directory again.</p>
<p>If <tt class="docutils literal"><span class="pre">gallery_mode</span></tt> is set to <em>2</em> (see <a class="reference internal" href="#the-settings">The Settings</a>), then gallery <em>won't</em> scan the image directory. Not only is this quicker - but it can be useful when you have finalised the contents of a gallery and want to move the images.</p>
<p>If you <em>do</em> want gallery to scan the image directory, set <tt class="docutils literal"><span class="pre">gallery_mode</span></tt> to <em>1</em>. This won't overwrite any titles or descriptions, but it will add new images and remove entries for ones you've deleted. You can also use it to regenerate thumbnails if you change their size.</p>
</div>
</div>
<div class="section" id="the-templates">
<h1><a class="toc-backref" href="#id24">The Templates</a></h1>
<p><em>gallery.py</em> generates it's output from html templates that you supply. It fills in  values in the template with things like the path to the image or thumbnail, it's height, width, or title, and so on.</p>
<p>If you are using gallery from rest2web there are two templates. If you are running it on it's own there are three. You need to supply the path to each of these files in the settings.</p>
<p>Obviously a good place to start is by looking at the example ones provided.</p>
<p>The three templates are :</p>
<ul>
<li><p class="first"><em>entry_template</em></p>
<blockquote>
<p>This is a small template. It is used for every thumbnail and link in the main gallery page.</p>
</blockquote>
</li>
<li><p class="first"><em>page_template</em></p>
<blockquote>
<p>This is the template used to make each page (the ones containing the individual images).</p>
</blockquote>
</li>
<li><p class="first"><em>gallery_template</em></p>
<blockquote>
<p>This is only used when running as a <a class="reference internal" href="#standalone-program">standalone program</a>. It is used to make the main page with all the thumbnails on.</p>
</blockquote>
</li>
</ul>
<p>The templates have various entries in them, that gallery replaces with the right values for the pages it is building. They all look like <tt class="docutils literal"><span class="pre">**some</span> <span class="pre">name**</span></tt>. When you edit the templates, you must keep these for the page to work.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">In fact it won't cause an error to remove any of the special entries from the templates - that value will just be missing from the final pages. You can use this to further customize the appearance of your galleries.</p>
</div>
<div class="section" id="entry-template">
<h2><a class="toc-backref" href="#id25">entry_template</a></h2>
<p>This template is used for every thumbnail and link in the main gallery page.</p>
<p>The special values are :</p>
<ul>
<li><p class="first"><tt class="docutils literal"><span class="pre">**link**</span></tt></p>
<blockquote>
<p>Link to the image page.</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**thumb**</span></tt></p>
<blockquote>
<p>Path to the thumbnail (for the <tt class="docutils literal"><span class="pre">img</span></tt> tag).</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**width**</span></tt></p>
<blockquote>
<p>Thumbnail width.</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**height**</span></tt></p>
<blockquote>
<p>Thumbnail height.</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**title**</span></tt></p>
<blockquote>
<p>Image title.</p>
</blockquote>
</li>
</ul>
</div>
<div class="section" id="page-template">
<h2><a class="toc-backref" href="#id26">page_template</a></h2>
<p>This is the template used to make each page (the ones containing the individual images).</p>
<p>The special values are :</p>
<ul>
<li><p class="first"><tt class="docutils literal"><span class="pre">**title**</span></tt></p>
<blockquote>
<p>The image title. Used as the page title, and as a heading above the image.</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">&lt;!--</span> <span class="pre">**leftcomment**</span></tt></p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**leftcomment**</span> <span class="pre">--&gt;</span></tt></p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">&lt;!--</span> <span class="pre">**rightcomment**</span></tt></p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**rightcomment**</span> <span class="pre">--&gt;</span></tt></p>
<blockquote>
<p>In the template the 'previous image' and 'next image' are commented out. If they are needed in the page, the comment markers are removed.</p>
<p>Obviously, the first image doesn't have a previous (left) image, and the last doesn't have a next (right).</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**linkleft**</span></tt></p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**linkright**</span></tt></p>
<blockquote>
<p>These are the links to the previous and next image pages.</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**thumbleft**</span></tt></p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**thumbright**</span></tt></p>
<blockquote>
<p>These are the paths to the thumbnails for the previous and next images.</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**widthleft**</span></tt></p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**heightleft**</span></tt></p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**widthright**</span></tt></p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**heightright**</span></tt></p>
<blockquote>
<p>The widths and heights for the next/previous thumbnails.</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**titleleft**</span></tt></p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**titleright**</span></tt></p>
<blockquote>
<p>The image titles for the next/previous thumbnails.</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**linkgallery**</span></tt></p>
<blockquote>
<p>The link back to the main gallery page.</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**image**</span></tt></p>
<blockquote>
<p>The path to the actual image.</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**widthmain**</span></tt></p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**heightmain**</span></tt></p>
<blockquote>
<p>The width and height of the actual image.</p>
</blockquote>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">**description**</span></tt></p>
<blockquote>
<p>Guess what !</p>
</blockquote>
</li>
</ul>
</div>
<div class="section" id="gallery-template">
<h2><a class="toc-backref" href="#id27">gallery_template</a></h2>
<p>This template is only needed (or used) when running gallery.py as a standalone program. It is used to make the main page with all the thumbnails on.</p>
<p>The only special value is :</p>
<ul>
<li><p class="first"><tt class="docutils literal"><span class="pre">**gallery**</span></tt></p>
<blockquote>
<p>This is replaced with the html containing all the thumnail images and links.</p>
</blockquote>
</li>
</ul>
</div>
</div>
<div class="section" id="using-the-output">
<h1><a class="toc-backref" href="#id28">Using the Output</a></h1>
<p>..note:</p>
<pre class="literal-block">
This section is only relevant when the gallery is used from rest2web.
</pre>
<p>Using the output from the gallery in your page is very easy. It creates an extra value <tt class="docutils literal"><span class="pre">gallery</span></tt> to use in your page.</p>
<p>If the page format is <acronym title="reStructured Text">reST</acronym>, the ouput is indented and put inside a <tt class="docutils literal"><span class="pre">..</span> <span class="pre">raw::</span> <span class="pre">html</span></tt> directive <a class="footnote-reference" href="#id14" id="id7">[7]</a>.</p>
<dl class="docutils">
<dt>The output for the main page contains thumbnails with links to the individual pages. It is made up from the <em>entry</em> template - with the value</dt>
<dd><p class="first">filled in for each image. You would normally use it with something like :</p>
<pre class="last literal-block">
&lt;% gallery %&gt;
</pre>
</dd>
</dl>
</div>
<div class="section" id="todo">
<h1><a class="toc-backref" href="#id29">TODO</a></h1>
<p>The gallery is still experimental ('alpha' quality). I need to check the following things.</p>
<ul class="simple">
<li>XXXX Does it delete thumbnails and html pages for deleted images ?</li>
<li>XXXX Sort html for multi-line descriptions.</li>
<li>XXXX check &quot;file_error&quot; works</li>
<li>XXXX If the page format is reST, the ouput is indented and put inside a <tt class="docutils literal"><span class="pre">..</span> <span class="pre">raw::</span> <span class="pre">html</span></tt> directive.</li>
<li>XXXX <em>except</em> - shouldn't use plugins with reST</li>
</ul>
</div>
<hr class="docutils" />
<div class="section" id="footnotes">
<h1><a class="toc-backref" href="#id30">Footnotes</a></h1>
<table class="docutils footnote" frame="void" id="id8" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>On Windoze you can just double click on <tt class="docutils literal"><span class="pre">gallery_test.bat</span></tt>.</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id9" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id2">[2]</a></td><td>Installed means somewhere on your normal PYTHONPATH.</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id10" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id3">[3]</a></td><td>Version 0.2.0 was the first to include <em>urlpath</em>, which gallery.py needs in order to run.</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id11" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id4">[4]</a></td><td>Or by creating a <tt class="docutils literal"><span class="pre">bat</span></tt> file if you use windoze and are unfamiliar with the command line. To run gallery.py with <em>gallery.ini</em>, create a text file called <em>gallery.bat</em> - with <tt class="docutils literal"><span class="pre">python</span> <span class="pre">gallery.py</span> <span class="pre">gallery.ini</span></tt>. Double clicking on <em>gallery.bat</em> should then run gallery.py with the correct config file.</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id12" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id5">[5]</a></td><td>It uses <a class="reference external" href="http://www.voidspace.org.uk/python/configobj.html">ConfigObj</a> to read/write the 'INI' style config files.</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id13" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id6">[6]</a></td><td>Which has ConfigObj 4 - this retains the order of entries in config files.</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id14" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id7">[7]</a></td><td>Except currently plugins are not compatible with pages in reST format. That will be fixed soon.</td></tr>
</tbody>
</table>
</div>
</div>

            </div>
    
            <div id="end">
                <p><a href="#startcontent">Return to Top</a><br />
                <small>Part of the <a href="http://www.voidspace.org.uk/python/rest2web/">rest2web Docs</a></small><br />
                <small>Page last modified <strong>Sat Jul 29 18:33:44 2006</strong>.</small> 
                </p>
            </div>
   
    	</div></td>
    </tr>
    <tr>
     <td valign="top" align="left" width="25%">
    <div id="left-column">
        <div id="sidie">
            <ul>
                <li class="left-navheader-first">
                    <a href="index.html" class="left-navheader">Index Page</a>
                </li> 
                <li class="left-navheader">Pages</li>

<li><a href="todo.html">TODO/ISSUES</a></li>
<li><a href="uservalues.html">uservalues</a></li>
<li><a href="encodings.html">Encodings</a></li>
<li><a href="indextree.html">indextree</a></li>
<li><a href="changelog.html">changelog</a></li>
<li><a href="smilies.html">Smilies</a></li>
<li><a href="plugins.html">Plugins</a></li>
<li><a href="gallery.html">Gallery</a></li>


            </ul>
        </div>
        
        <p class="sidieimg">
            <a href="http://www.python.org">
            <img src="../images/logos/new_python.gif" width="88"
                height="103" border="0" alt="Powered by Python" />
            </a>
        </p>

        <p class="sidieimg">
            <a href="http://sourceforge.net/donate/index.php?group_id=138579">
            <img src="http://images.sourceforge.net/images/project-support.jpg" width="100"
                height="32" border="0" alt="Support This Project" />
            </a>
        </p>

        <p class="sidieimg">
            <a href="http://www.voidspace.org.uk/python/rest2web/"><img 
            src="../images/logos/rest2web140x62.gif" width="142" height="62"
            alt="Site Built with rest2web" /></a><br />
        </p>
    </div>
    </td>
    </tr>
</table>

    <hr />
    
    <p class="sidieimg">
        <a href="http://www.voidspace.org.uk/python/rest2web/"><img src="../images/logos/rest2web200x80.gif" width="200" height="80" alt="Site Built with rest2web" /></a>
        <a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=138579&amp;type=5" width="210" height="62" alt="SourceForge.net Logo" /></a>
        <a href="http://www.opensource.org"><img src="../images/logos/osi-certified-120x100.gif" width="120" height="100" alt="Certified Open Source" border="1" /></a>
    </p>
    
    <p class="sidieimg">
        <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
        </script>
        <script type="text/javascript">
        _uacct = "UA-203625-1";
        urchinTracker();
        </script>
    </p>
            
    <p class="sidieimg">
        <a href="http://www.voidspace.org.uk/python/index.shtml"><img 
        src="../images/logos/pythonbanner.gif" width="468" height="60"
        alt="Python on Voidspace" /></a>
    </p>
    
    <div id="footer">
       Copyright &copy; Voidspace<br />Design by <a href="http://www.fuchsiashockz.co.uk">Fuchsiashockz</a> | <a href="http://validator.w3.org/check?uri=referer" title="Validate code as W3C XHTML 1.1 Strict Compliant">W3C XHTML 1.1</a> | <a href="http://jigsaw.w3.org/css-validator/check?uri=referer" title="Validate Style Sheet as W3C CSS 2.0 Compliant">W3C CSS 2.0</a>
    </div>
	</div>
</body>
</html>