;;;; phoghorn-eggdoc.scm (use eggdoc) (define license "Copyright (c) 2005 - 2006, Peter Bex (peter.bex@xs4all.nl) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.") (define example '((pre #< Phoghorn example EOF ))) (define zoomed '((pre #< <? (ph:get-entry) ?> EOF ))) (define doc `((eggdoc:begin (name "phoghorn") (description "A thumbnail gallery library for " (url "http://www.call-with-current-continuation.org" "spiffy")) (author (url "mailto:peter.bex@xs4all.nl" "Peter Bex")) (history (version "1.2" "Update to latest versions of epeg and imlib2.") (version "1.1.1" "Changed .setup script to reflect new distribution" " of syntax-case.") (version "1.1" "Fix small bug (a let statement was closed a little " "too early.") (version "1.0" "initial release.")) (requires (url "spiffy.html" "spiffy") (url "spiffy-utils.html" "spiffy-utils") (url "syntax-case.html" "syntax-case") (url "imlib2.html" "imlib2") (url "epeg.html" "epeg") (url "generalised-case.html" "generalised-case")) (download "phoghorn-eggdoc.egg") (documentation (p "Phoghorn is a web-based image gallery with built-in " "automatic thumbnail generator for " (url "spiffy.html" "spiffy") " the webserver.") (p "Its features are:") (ul (li "Easy to use (just drop a bunch of files in a " "directory underneath the designated photos dir)") (li "Configurable") (li "Does not require a database") (li "Uses CSS for markup, so its look is easily changed") (li "Leverages " (url "imlib2.html" "imlib2") " for maximum image file type support and " (url "epeg.html" "epeg") " for extra-speedy " "JPEG handling.")) (subsection "Use" (p "By default, phoghorn assumes there is a directory called " (code "galleries") " in the directory from which you call its " "functions (ie, the same directory in which you placed " (code "index.ssp") "). It will create thumbnails on-the-fly " "when there aren't any yet, and only for those pictures on the " "page that is currently being viewed. By default, these will " "be placed in the " (code "thumbs") " directory under " "the gallery's directory.") (p "In the main page (save this as " (code "index.ssp") "):" ,index) (p "In the zoomed-in page (save this as " (code "zoomed.ssp") "):" ,zoomed) (p "Note that currently there's no support for calling phoghorn from " "SXML pages. This is an important shortcoming and the intention " "is to rewrite the output functions to SXML for the next release.")) (subsection "Configuration" (p "Phoghorn can be customised to the max. The following " (url "http://srfi.schemers.org/srfi-39/" "SRFI") " parameters " "are supported:") (subsubsection "Directory and file settings" (parameter (with-default-param "ph:gallery-dir" "\"galleries\"") "The directory under which the galleries can be found, " "relative to the index page.") (parameter (with-default-param "ph:index-page" "\"index.ssp\"") "The main webpage serving the Phoghorn script. This " "shows the image thumbnails.") (parameter (with-default-param "ph:zoomed-page" "\"zoomed.ssp\"") "The webpage that serves the zoomed-in views on images.") (parameter (with-default-param "ph:thumb-dir" "\"thumbs\"") "The name of the directory under which thumnail versions " "of the images in the parent directory are stored.")) (subsubsection "Thumbnail generation" (parameter (with-default-param "ph:thumb-max-width/height" "100") "Maximum width " (em "or") " height of a thumbnail." "The smaller of the two will get scaled by the same " "factor as the larger, which will be shrunk into this " "size. In other words, it maintains the aspect ratio of " "the original picture in the thumb.")) (subsubsection "Presentational options" (parameter (with-default-param "ph:entries/page" "25") "The number of pictures to display on one page.") (parameter (with-default-param "ph:table-width" "5") "The number of images horizontally (to be deprecated).") (parameter (with-default-param "ph:prev-page-text" "\"prev\"") "The text on the link to the previous page.") (parameter (with-default-param "ph:next-page-text" "\"next\"") "The text on the link to the next page.") (parameter (with-default-param "ph:up-link-text" "\"up\"") "The text on the link to a higher directory.") (parameter (with-default-param "ph:prev-entry-text" "\"prev\"") "The text on the link to the previous image in " "zoomed view.") (parameter (with-default-param "ph:next-entry-text" "\"next\"") "The text on the link to the next image in " "zoomed view.") (parameter (with-default-param "ph:unzoom-link-text" "\"back\"") "The text on the link to the gallery view (displayed in" "zoomed view).") (parameter (with-default-param "ph:movie-image" "#f") "The image file to display when a movie is in the " "gallery. This image will also be displayed in the " "zoomed view, as a link to the actual video clip.") (parameter (with-default-param "ph:root-gallery-name" "\"Gallery list\"") "The title of the topmost gallery. All subgalleries " "have a title that is equal to the directory name."))) (subsection "Output document structure" (p "The output can most easily be looked at in the source view of " "your favorite browser, but to style it with CSS it is handy " "to have a reference. There is an example CSS file in the " (em "examples") " section.") (subsubsection "Global" (p "All phoghorn output is wrapped in a " (code "div") " element " "of class " (code "phoghorn") ". It also has class " (code "gallery") " when in thumbnail view, and class " (code "zoomed") " in zoomed view.")) (subsubsection "The zoomed view" (p "Links above and below the image are inside a " (code "div") " of class " (code "navigation") ". The image itself is inside " "a " (code "div") " of class " (code "entry") ".")) (subsubsection "The gallery/thumbnail view" (p "The list of subgalleries, if present, is inside a " (code "div") " of class " (code "gallerytree") ". The list itself is an " (code "ul") ". The list item of the link to the parent gallery, " "if present, has class " (code "uplink") ".") (p "Below the subgalleries list (and repeated again below the " "gallery) is a " (code "div") " of class " ("navigation") ". " "This navigation has the links to the other pages. The current " "page number is not a link, but a " (code "span") " of class " (code "curpage") ".") (p "The gallery itself is inside a " (code "table") ", containing " "the thumbnails.")))) (examples ,example) (license ,license)))) ;; with-default-param is also in eggdoc now; customize to your liking, but ;; -must- return a string (eggdoc->html doc) ;; `( (with-default-param *macro* ;; . ,(lambda (tag param default) ;; (conc "(" param ") [default: " default "]"))) ;; ,@(eggdoc:make-stylesheet doc) ))