The html-sugar Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The html-sugar Reference Manual

This is the html-sugar Reference Manual, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 04:00:56 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

1.1 html-sugar

Maintainer

Walter C. Pelissero <walter@pelissero.de>

Author

Walter C. Pelissero <walter@pelissero.de>

License

LGPL

Description

HTML Helper Functions

Long Description

A collection of functions to help generating HTML with (P)AServe.

Dependencies
Source

html-sugar.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

2 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

2.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

2.1.1 html-sugar.asd

Location

html-sugar.asd

Systems

html-sugar (system)

Packages

html-sugar-system


Next: , Previous: , Up: Lisp files   [Contents][Index]

2.1.2 html-sugar/package.lisp

Parent

html-sugar (system)

Location

package.lisp

Packages

html-sugar


Next: , Previous: , Up: Lisp files   [Contents][Index]

2.1.3 html-sugar/crypt-loader.lisp

Dependency

package.lisp (file)

Parent

html-sugar (system)

Location

crypt-loader.lisp

Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

2.1.4 html-sugar/sugar.lisp

Dependencies
Parent

html-sugar (system)

Location

sugar.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

3 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

3.1 html-sugar-system

Source

html-sugar.asd

Use List

Previous: , Up: Packages   [Contents][Index]

3.2 html-sugar

Source

package.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

4.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

4.1.1 Special variables

Special Variable: *button-style*

Type of HTML rendering for button items. This can
be :IMPLICIT-FORM or :FANCY-LINK. See the function BUTTON for further details. Both require support from the stylesheet, though a bit less for the implicit form. Something like this would do:

form.button {
display: inline;
margin: .5em;
}

a.button {
border: outset;
display: inline;
font-weight: bold;
padding: .3em .8em .5em .8em;
background-color: #BBB;
margin: .3em .5em .3em .5em;
color: #000;
text-decoration: none;
}

a.button img {
border: none;
padding: 0;
margin: 0;
}

a.button:hover {
background-color: #DDD;
}

a.button:active {
border: none;
background-color: #DDD;
}

Package

html-sugar

Source

sugar.lisp (file)

Special Variable: *default-form-class*

The default CSS class of the form tables generated by WITH-HTML-FORM.

Package

html-sugar

Source

sugar.lisp (file)

Special Variable: *default-language*
Package

html-sugar

Source

sugar.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

4.1.2 Macros

Macro: defclp NAME SESSION-VARIABLES &body FORMS

Define a Common Lisp Page function. This can be then referred in a CLP page in the usual way. This macro captures some variables which can be used by FORMS. These are: REQ, ENT, ARGS, BODY, WA, SESSION. See the AServe documentation for their meaning.

Package

html-sugar

Source

sugar.lisp (file)

Macro: defpage NAME (&key VARIABLES TITLE LANGUAGE OUTPUT-PAGE-HEAD BODY-ARGS TIMEOUT) &body BODY

Define a web page. Header and footer are standard. BODY is supposed to output the dynamic part of the page.

Package

html-sugar

Source

sugar.lisp (file)

Macro: defwa NAME VARIABLES &body FORMS

Define a web action (aka web page). A web action is supposed to return either :CONTINUE or a string of the name of the page to redirect the browser to. This macro captures some variables which can be used by FORMS. These are: REQ, ENT, WA, SESSION. See the AServe documentation for their meaning.

Package

html-sugar

Source

sugar.lisp (file)

Macro: html-table (&rest ARGS) &body BODY

Generate an HTML table with ARGS and run BODY with TR defined locally as a macro that outputs table’s TR elements of class ODD or EVEN, according to their position within tha table.

Package

html-sugar

Source

sugar.lisp (file)

Macro: url PAGE &rest QUERY-VALUES

Encode an URL based on current status. This means that the URL may contain any additonal information required to keep the association to the webactions’ session. This macro expect to find a couple of bindings in the current lexical environment: REQ and ENT. These are normally guaranted by DEFWA and DEFCLP macros.

Package

html-sugar

Source

sugar.lisp (file)

Macro: with-html-form (URL &key CLASS SUBMIT RESET STYLE METHOD) &rest FIELDS

Creates an HTML form of CSS class CLASS. SUBMIT is the label on the OK button. If RESET is true add a reset button. If RESET is a string use that as the label on the reset button. Each field in FIELDS is a list of which the first element is a string (the field description) and the rest is HTML code to appear next to it. Local to this block the macro INPUT is defined. If the first element is the keyword :HIDDEN, the field won’t have a table entry but it will be hidden from the user; in this case the other elements are the name and value of the field.

Package

html-sugar

Source

sugar.lisp (file)

Macro: with-query-values (REQUEST &rest VARIABLES) &body BODY
Package

html-sugar

Source

sugar.lisp (file)

Macro: with-request-values (REQUEST &rest VARIABLES) &body BODY
Package

html-sugar

Source

sugar.lisp (file)

Macro: with-session-variables (REQ &rest VARIABLES) &body BODY
Package

html-sugar

Source

sugar.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

4.1.3 Functions

Function: button LABEL URL &key DESCRIPTION COLOUR IMAGE

Create an HTML link to URL having the look of a button.
If IMAGE is available use it, otherwise render LABEL as a rectangular button. IMAGE can be a string or a pathname.

Package

html-sugar

Source

sugar.lisp (file)

Function: compress-css CSS

Remove superfluous whitespace and comments from CSS, which is supposed to be a Cascading Style Sheet in the form of a string.

Package

html-sugar

Source

sugar.lisp (file)

Function: compress-css-stream IN OUT
Package

html-sugar

Source

sugar.lisp (file)

Function: crypt KEY SALT

Encrypt KEY using SALT.

Package

html-sugar

Source

sugar.lisp (file)

Function: current-page REQUEST ENTITY

Return the current page path excluding prefix, session ID (if present), and query variables.

Package

html-sugar

Source

sugar.lisp (file)

Function: encode-url REQ ENT PAGE &optional QUERY-VALUES-ALIST

Encode an url using when appropriate the session id. QUERY-VALUES-ALIST is a list of pairs where the car of each pair is a string or a keyword and the cdr is its value.

Package

html-sugar

Source

sugar.lisp (file)

Function: html-bookmarks REQ ENT SELECTOR BOOKMARKS
Package

html-sugar

Source

sugar.lisp (file)

Function: html-checkbox NAME &key CHECKED LABEL VALUE
Package

html-sugar

Source

sugar.lisp (file)

Function: html-radio NAME CHOICES &key SELECTED VERTICAL

Output HTML for a <RADIO> input item. NAME is the name to be given to the input item. CHOICES is a list of pairs:

(id . description)

The descriptions fill the selection box while the ids are passed to the web server. If SELECTED tells which item of the radio buttons groub should be selected by default. If VERTICAL is true lays the radio buttons vertically rather than horizontally.

Package

html-sugar

Source

sugar.lisp (file)

Function: html-select NAME CHOICES &key SELECTED MULTIPLE

Output HTML for a <SELECT> input item. NAME is the name to be given to the input item. CHOICES is a list of pairs:

(id . description)

The descriptions fill the selection box while the ids are passed to the web server. If SELECTED tells which items of the selection should be selected by default. If MULTIPLE tell to make a multiple choice selection input item of that size in lines.

Package

html-sugar

Source

sugar.lisp (file)

Function: query-value REQUEST VARIABLE-NAME &optional MULTIPLE

Similar to QUERY-VALUE-STRING, but interpret the string value as Lisp value.

Package

html-sugar

Source

sugar.lisp (file)

Writer

(setf query-value) (function)

Function: (setf query-value) VALUE REQUEST VARIABLE-NAME &optional MULTIPLE
Package

html-sugar

Source

sugar.lisp (file)

Reader

query-value (function)

Function: query-value-string REQUEST VARIABLE-NAME &optional MULTIPLE

Similar to REQUEST-QUERY-VALUE but case insensitive. If MULTIPLE is true, the returned value is a list of values; one for each occurrence of VARIABLE-NAME in the query REQUEST.

Package

html-sugar

Source

sugar.lisp (file)

Function: redirect-to REQ ENT URL
Package

html-sugar

Source

sugar.lisp (file)

Function: request-query-values KEY REQ &key POST URI TEST EXTERNAL-FORMAT

Just like REQUEST-QUERY-VALUE but KEY is expected to accur more than once in the query, so return all its values in a list.

Package

html-sugar

Source

sugar.lisp (file)

Function: session-variable REQ NAME
Function: (setf session-variable) VALUE REQ NAME
Package

html-sugar

Source

sugar.lisp (file)

Function: write-html-sequence SEQUENCE &key STREAM START END

Write a sequence to HTML stream. This is more general than WRITE-HTML-STRING and thus more appropriate to write arbitrary sequences.

Package

html-sugar

Source

sugar.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

4.1.4 Generic functions

Generic Function: authoriser-check-password AUTH NAME PASSWORD
Package

html-sugar

Methods
Method: authoriser-check-password (AUTH crypt-password-authoriser) NAME PASSWORD
Source

sugar.lisp (file)

Method: authoriser-check-password (AUTH better-password-authoriser) NAME PASSWORD
Source

sugar.lisp (file)

Generic Function: authoriser-deny-page AUTH
Package

html-sugar

Methods
Method: authoriser-deny-page (AUTH better-password-authoriser)
Source

sugar.lisp (file)

Generic Function: authoriser-get-user-password AUTHORISER USER-NAME

Return the password associated with USER-NAME.

Package

html-sugar

Source

sugar.lisp (file)

Methods
Method: authoriser-get-user-password (AUTHORISER better-password-authoriser) (USER-NAME string)

Default method that looks up USER-NAME in the alist contained by the ALLOWED slot of AUTHORISER.


Previous: , Up: Exported definitions   [Contents][Index]

4.1.5 Classes

Class: better-password-authoriser ()

Convenience base class to diversify AUTHORIZE method (below).

Package

html-sugar

Source

sugar.lisp (file)

Direct superclasses

password-authorizer (class)

Direct subclasses

crypt-password-authoriser (class)

Direct methods
Class: crypt-password-authoriser ()

Access authoriser for Unix-like accounts. This class is similar to PASSWORD-AUTHORISER but passwords in ALLOWED are ancrypted with Unix crypt(3). User passwords are supposed to be taken from /etc/passwd (or /etc/master.passwd) or encrypted in the same way.

Package

html-sugar

Source

sugar.lisp (file)

Direct superclasses

better-password-authoriser (class)

Direct methods

authoriser-check-password (method)


Previous: , Up: Definitions   [Contents][Index]

4.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

4.2.1 Special variables

Special Variable: *crypt-library-loaded*
Package

html-sugar

Source

crypt-loader.lisp (file)

Special Variable: *crypt-library-pathname*
Package

html-sugar

Source

crypt-loader.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

4.2.2 Macros

Macro: with-wa (ENT) &body BODY

Create a local binding of WA to the current web action (taken from ENT).

Package

html-sugar

Source

sugar.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

4.2.3 Functions

Function: %crypt KEY SALT
Package

html-sugar

Source

sugar.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   H   L  
Index Entry  Section

F
File, Lisp, html-sugar.asd: The html-sugar<dot>asd file
File, Lisp, html-sugar/crypt-loader.lisp: The html-sugar/crypt-loader<dot>lisp file
File, Lisp, html-sugar/package.lisp: The html-sugar/package<dot>lisp file
File, Lisp, html-sugar/sugar.lisp: The html-sugar/sugar<dot>lisp file

H
html-sugar.asd: The html-sugar<dot>asd file
html-sugar/crypt-loader.lisp: The html-sugar/crypt-loader<dot>lisp file
html-sugar/package.lisp: The html-sugar/package<dot>lisp file
html-sugar/sugar.lisp: The html-sugar/sugar<dot>lisp file

L
Lisp File, html-sugar.asd: The html-sugar<dot>asd file
Lisp File, html-sugar/crypt-loader.lisp: The html-sugar/crypt-loader<dot>lisp file
Lisp File, html-sugar/package.lisp: The html-sugar/package<dot>lisp file
Lisp File, html-sugar/sugar.lisp: The html-sugar/sugar<dot>lisp file

Jump to:   F   H   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   %   (  
A   B   C   D   E   F   G   H   M   Q   R   S   U   W  
Index Entry  Section

%
%crypt: Internal functions

(
(setf query-value): Exported functions
(setf session-variable): Exported functions

A
authoriser-check-password: Exported generic functions
authoriser-check-password: Exported generic functions
authoriser-check-password: Exported generic functions
authoriser-deny-page: Exported generic functions
authoriser-deny-page: Exported generic functions
authoriser-get-user-password: Exported generic functions
authoriser-get-user-password: Exported generic functions

B
button: Exported functions

C
compress-css: Exported functions
compress-css-stream: Exported functions
crypt: Exported functions
current-page: Exported functions

D
defclp: Exported macros
defpage: Exported macros
defwa: Exported macros

E
encode-url: Exported functions

F
Function, %crypt: Internal functions
Function, (setf query-value): Exported functions
Function, (setf session-variable): Exported functions
Function, button: Exported functions
Function, compress-css: Exported functions
Function, compress-css-stream: Exported functions
Function, crypt: Exported functions
Function, current-page: Exported functions
Function, encode-url: Exported functions
Function, html-bookmarks: Exported functions
Function, html-checkbox: Exported functions
Function, html-radio: Exported functions
Function, html-select: Exported functions
Function, query-value: Exported functions
Function, query-value-string: Exported functions
Function, redirect-to: Exported functions
Function, request-query-values: Exported functions
Function, session-variable: Exported functions
Function, write-html-sequence: Exported functions

G
Generic Function, authoriser-check-password: Exported generic functions
Generic Function, authoriser-deny-page: Exported generic functions
Generic Function, authoriser-get-user-password: Exported generic functions

H
html-bookmarks: Exported functions
html-checkbox: Exported functions
html-radio: Exported functions
html-select: Exported functions
html-table: Exported macros

M
Macro, defclp: Exported macros
Macro, defpage: Exported macros
Macro, defwa: Exported macros
Macro, html-table: Exported macros
Macro, url: Exported macros
Macro, with-html-form: Exported macros
Macro, with-query-values: Exported macros
Macro, with-request-values: Exported macros
Macro, with-session-variables: Exported macros
Macro, with-wa: Internal macros
Method, authoriser-check-password: Exported generic functions
Method, authoriser-check-password: Exported generic functions
Method, authoriser-deny-page: Exported generic functions
Method, authoriser-get-user-password: Exported generic functions

Q
query-value: Exported functions
query-value-string: Exported functions

R
redirect-to: Exported functions
request-query-values: Exported functions

S
session-variable: Exported functions

U
url: Exported macros

W
with-html-form: Exported macros
with-query-values: Exported macros
with-request-values: Exported macros
with-session-variables: Exported macros
with-wa: Internal macros
write-html-sequence: Exported functions

Jump to:   %   (  
A   B   C   D   E   F   G   H   M   Q   R   S   U   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*button-style*: Exported special variables
*crypt-library-loaded*: Internal special variables
*crypt-library-pathname*: Internal special variables
*default-form-class*: Exported special variables
*default-language*: Exported special variables

S
Special Variable, *button-style*: Exported special variables
Special Variable, *crypt-library-loaded*: Internal special variables
Special Variable, *crypt-library-pathname*: Internal special variables
Special Variable, *default-form-class*: Exported special variables
Special Variable, *default-language*: Exported special variables

Jump to:   *  
S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   B   C   H   P   S  
Index Entry  Section

B
better-password-authoriser: Exported classes

C
Class, better-password-authoriser: Exported classes
Class, crypt-password-authoriser: Exported classes
crypt-password-authoriser: Exported classes

H
html-sugar: The html-sugar system
html-sugar: The html-sugar package
html-sugar-system: The html-sugar-system package

P
Package, html-sugar: The html-sugar package
Package, html-sugar-system: The html-sugar-system package

S
System, html-sugar: The html-sugar system

Jump to:   B   C   H   P   S