spiffy-directory-listing

Description

Flexible directory listing for Spiffy

Author

Mario Domenech Goulart

Requirements

Procedure

[procedure] (spiffy-directory-listing path)

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

[parameter] (list-dotfiles? [boolean])

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

[parameter] (list-directory [procedure])

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

[parameter] (format-listing [procedure])

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.

[parameter] (directory-listing-page [procedure])

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).

[parameter] (directory-listing-css [css])

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).

[parameter] (directory-listing-doctype [doctype])

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

[parameter] (directory-listing-title [string])

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

[parameter] (sxml->html [SXML])

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