chickadee » spiffy-directory-listing

Outdated egg!

This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for the CHICKEN 5 version of this egg, if it exists.

If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.

spiffy-directory-listing

Description

Flexible directory listing for Spiffy

Author

Mario Domenech Goulart

Requirements

Procedure

spiffy-directory-listing pathprocedure

Generates an HTML page using the directory listing from the given path (a string). It's supposed to be used as the value for Spiffy's handle-directory parameter.

Parameters

list-dotfiles? #!optional booleanparameter

Indicates whether filenames whose name start with . should be listed.

list-directory #!optional procedureparameter

An one argument procedure to generate the directory listing for the given path.

format-listing #!optional procedureparameter

A two-arguments procedure used to format the directory listing. The two arguments are: the path being listed and the list of files under the given path.

directory-listing-page #!optional procedureparameter

A two-arguments procedure used to format the listing page. The two arguments are: the path being listed and the page contents (usually the formatted directory listing).

directory-listing-css #!optional cssparameter

The CSS rules to be applied to the directory listing page. The syntax for the parameter value is the same as for the css keyword parameter for html-utils's html-page (considering that the default value for directory-listing-page uses html-page).

directory-listing-doctype #!optional doctypeparameter

The doctype (a string) to be used for the directory listing page (see the doctype egg).

directory-listing-title #!optional stringparameter

The title (a string) to be used for the directory listing page.

sxml->html #!optional SXMLparameter

The procedure used to transform SXML into HTML internally. The default value is:

(let ((rules `((literal *preorder* . ,(lambda (t b) b))
               . ,universal-conversion-rules*)))
  (lambda (sxml)
    (with-output-to-string
      (lambda ()
        (SRV:send-reply (pre-post-order* sxml rules))))))

This parameter has been introduced in version 0.2.

License

 Copyright (c) 2010-2018, Mario Domenech Goulart
 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. The name of the authors may not be used to endorse or promote products
    derived from this software without specific prior written permission.
 
 THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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.

Version history

0.3
CHICKEN 5 support
0.2
Use SXML internally (drop dependency in html-utils, add dependency on sxml-transforms); new parameter: sxml->html
0.1
Initial release

Contents »