The cl-why Reference Manual

This is the cl-why Reference Manual, version 1.1.4, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 15:52:43 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 cl-why

(X)HTML generation macros

Author

JP Cimalando

License

BSD

Version

1.1.4

Source

cl-why.asd.

Child Components

3 Files

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


3.1 Lisp


3.1.1 cl-why/cl-why.asd

Source

cl-why.asd.

Parent Component

cl-why (system).

ASDF Systems

cl-why.


3.1.2 cl-why/packages.lisp

Source

cl-why.asd.

Parent Component

cl-why (system).

Packages

cl-why.


3.1.3 cl-why/specials.lisp

Dependency

packages.lisp (file).

Source

cl-why.asd.

Parent Component

cl-why (system).

Public Interface
Internals

3.1.4 cl-why/util.lisp

Dependency

specials.lisp (file).

Source

cl-why.asd.

Parent Component

cl-why (system).

Public Interface
Internals

3.1.5 cl-why/why.lisp

Dependency

util.lisp (file).

Source

cl-why.asd.

Parent Component

cl-why (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 cl-why

Source

packages.lisp.

Nickname

why

Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


5.1 Public Interface


5.1.1 Special variables

Special Variable: *attribute-quote-char*

Quote character for attributes.

Package

cl-why.

Source

specials.lisp.

Special Variable: *downcase-tokens-p*

If NIL, a keyword symbol representing a tag or attribute name will not be automatically converted to lowercase. This is useful when one needs to output case sensitive XML.

Package

cl-why.

Source

specials.lisp.

Special Variable: *escape-char-p*

Used by ESCAPE-STRING to test whether a character should be escaped.

Package

cl-why.

Source

specials.lisp.

Special Variable: *html-empty-tag-aware-p*

Set this to NIL to if you want to use CL-WHY as a strict XML generator. Otherwise, CL-WHY will only write empty tags listed in *HTML-EMPTY-TAGS* as <tag/> (XHTML mode) or <tag> (SGML mode and HTML5 mode). For all other tags, it will always generate <tag></tag>.

Package

cl-why.

Source

specials.lisp.

Special Variable: *html-empty-tags*

The list of HTML tags that should be output as empty tags. See *HTML-EMPTY-TAG-AWARE-P*.

Package

cl-why.

Source

specials.lisp.

Special Variable: *html-no-indent-tags*

The list of HTML tags that should disable indentation inside them. The initial value is a list containing only :PRE and :TEXTAREA.

Package

cl-why.

Source

specials.lisp.

Special Variable: *prologue*

This is the first line that’ll be printed if the :PROLOGUE keyword argument is T

Package

cl-why.

Source

specials.lisp.


5.1.2 Macros

Macro: with-html-output ((var &optional stream &rest rest &key prologue indent) &body body)

Transform the enclosed BODY consisting of HTML as s-expressions into Lisp code to write the corresponding HTML as strings to VAR - which should either hold a stream or which’ll be bound to STREAM if supplied.

Package

cl-why.

Source

why.lisp.

Macro: with-html-output-to-string ((var &optional string-form &key element-type prologue indent) &body body)

Transform the enclosed BODY consisting of HTML as s-expressions into Lisp code which creates the corresponding HTML as a string.

Package

cl-why.

Source

why.lisp.


5.1.3 Ordinary functions

Function: conc (&rest list)

Concatenates all arguments into one string.

Package

cl-why.

Source

why.lisp.

Function: convert-attributes (attr-list)

Helper function for CONVERT-TAG-TO-STRING-LIST which converts the alist ATTR-LIST of attributes into a list of strings and/or Lisp forms.

Package

cl-why.

Source

why.lisp.

Function: escape-char (char &key test)

Returns an escaped version of the character CHAR if CHAR satisfies the predicate TEST. Always returns a string.

Package

cl-why.

Source

util.lisp.

Function: escape-char-all (char)

Escapes characters which aren’t in the 7-bit ASCII character set.

Package

cl-why.

Source

util.lisp.

Function: escape-char-iso-8859-1 (char)

Escapes characters that aren’t defined in ISO-8859-9.

Package

cl-why.

Source

util.lisp.

Function: escape-char-minimal (char)

Escapes only #<, #>, and #& characters.

Package

cl-why.

Source

util.lisp.

Function: escape-char-minimal-plus-quotes (char)

Like ESCAPE-CHAR-MINIMAL but also escapes quotes.

Package

cl-why.

Source

util.lisp.

Function: escape-string (string &key test)

Escape all characters in STRING which pass TEST. This function is not guaranteed to return a fresh string. Note that you can pass NIL for STRING which’ll just be returned.

Package

cl-why.

Source

util.lisp.

Function: escape-string-all (string)

Escapes all characters in STRING which aren’t in the 7-bit ASCII character set.

Package

cl-why.

Source

util.lisp.

Function: escape-string-iso-8859-1 (string)

Escapes all characters in STRING which aren’t defined in ISO-8859-1.

Package

cl-why.

Source

util.lisp.

Function: escape-string-minimal (string)

Escapes only #<, #>, and #& in STRING.

Package

cl-why.

Source

util.lisp.

Function: escape-string-minimal-plus-quotes (string)

Like ESCAPE-STRING-MINIMAL but also escapes quotes.

Package

cl-why.

Source

util.lisp.

Function: html-mode ()

Returns the current HTML mode. :SGML for (SGML-)HTML, :XML for XHTML and :HTML5 for HTML5 (HTML syntax).

Package

cl-why.

Source

why.lisp.

Function: (setf html-mode) ()

Sets the output mode to XHTML or (SGML-)HTML. MODE can be :SGML for HTML, :XML for XHTML or :HTML5 for HTML5 (HTML syntax).

Package

cl-why.

Source

why.lisp.


5.1.4 Generic functions

Generic Function: convert-tag-to-string-list (tag attr-list body body-fn)

Used by PROCESS-TAG to convert ‘HTML’ into a list
of strings. TAG is a keyword symbol naming the outer tag, ATTR-LIST is an alist of its attributes (the car is the attribute’s name as a keyword, the cdr is its value), BODY is the tag’s body, and BODY-FN is a function which should be applied to BODY. The function must return a list of strings or Lisp forms.

Package

cl-why.

Source

why.lisp.

Methods
Method: convert-tag-to-string-list (tag attr-list body body-fn)

The standard method which is not specialized. The idea is that you can use EQL specializers on the first argument.


5.1.5 Standalone methods

Method: print-object ((object <esc>) stream)

Prints a <ESC> object into the STREAM.

Source

specials.lisp.

Method: print-object ((object <raw>) stream)

Prints a <RAW> object into the STREAM.

Source

specials.lisp.


5.2 Internals


5.2.1 Constants

Constant: +newline+

Used for indentation.

Package

cl-why.

Source

specials.lisp.

Constant: +spaces+

Used for indentation.

Package

cl-why.

Source

specials.lisp.


5.2.2 Special variables

Special Variable: *empty-tag-end*

End of an empty tag. Default is XML style.

Package

cl-why.

Source

specials.lisp.

Special Variable: *html-mode*

:SGML for (SGML-)HTML, :XML (default) for XHTML, :HTML5 for HTML5.

Package

cl-why.

Source

specials.lisp.

Special Variable: *indent*

Whether to insert line breaks and indent. Also controls amount of indentation dynamically.

Package

cl-why.

Source

specials.lisp.


5.2.3 Macros

Macro: defconstant (name value &optional doc)

Make sure VALUE is evaluated only once (to appease SBCL).

Package

cl-why.

Source

specials.lisp.

Macro: n-spaces (n)

A string with N spaces - used by indentation.

Package

cl-why.

Source

util.lisp.

Macro: with-rebinding (bindings &body body)

WITH-REBINDING ( { var | (var prefix) }* ) form*

Evaluates a series of forms in the lexical environment that is formed by adding the binding of each VAR to a fresh, uninterned symbol, and the binding of that fresh, uninterned symbol to VAR’s original value, i.e., its value in the current lexical environment.

The uninterned symbol is created as if by a call to GENSYM with the string denoted by PREFIX - or, if PREFIX is not supplied, the string denoted by VAR - as argument.

The forms are evaluated in order, and the values of all but the last are discarded (that is, the body is an implicit PROGN).

Package

cl-why.

Source

util.lisp.

Macro: with-unique-names ((&rest bindings) &body body)

Syntax: WITH-UNIQUE-NAMES ( { var | (var x) }* ) declaration* form*

Executes a series of forms with each VAR bound to a fresh, uninterned symbol. The uninterned symbol is as if returned by a call to GENSYM with the string denoted by X - or, if X is not supplied, the string denoted by VAR - as argument.

The variable bindings created are lexical unless special declarations are specified. The scopes of the name bindings and declarations do not include the Xs.

The forms are evaluated in order, and the values of all but the last are discarded (that is, the body is an implicit PROGN).

Package

cl-why.

Source

util.lisp.


5.2.4 Ordinary functions

Function: -esc- (data)

Create a wrapper of type <ESC> for DATA if it is non-null, otherwise return NIL.

Package

cl-why.

Source

specials.lisp.

Function: -raw- (data)

Create a wrapper of type <RAW> for DATA if it is non-null, otherwise return NIL.

Package

cl-why.

Source

specials.lisp.

Reader: <esc>-data (instance)
Package

cl-why.

Source

specials.lisp.

Target Slot

data.

Function: <esc>-p (object)
Package

cl-why.

Source

specials.lisp.

Reader: <raw>-data (instance)
Package

cl-why.

Source

specials.lisp.

Target Slot

data.

Function: <raw>-p (object)
Package

cl-why.

Source

specials.lisp.

Function: copy-<esc> (instance)
Package

cl-why.

Source

specials.lisp.

Function: copy-<raw> (instance)
Package

cl-why.

Source

specials.lisp.

Function: extract-declarations (forms)

Given a FORM, the declarations - if any - will be extracted
from the head of the FORM, and will return two values the declarations, and the remaining of FORM

Package

cl-why.

Source

util.lisp.

Function: iso-8859-1-escape-char-p (char)

Helper function for the ESCAPE-FOO-ISO-8859-1 functions to determine whether CHAR must be escaped.

Package

cl-why.

Source

util.lisp.

Function: list-to-string (list)

Concatenates a list of objects into one string.

Package

cl-why.

Source

why.lisp.

Function: make-<esc> (&key data)
Package

cl-why.

Source

specials.lisp.

Function: make-<raw> (&key data)
Package

cl-why.

Source

specials.lisp.

Function: minimal-escape-char-p (char)

Helper function for the ESCAPE-FOO-MINIMAL functions to determine whether CHAR must be escaped.

Package

cl-why.

Source

util.lisp.

Function: minimal-plus-quotes-escape-char-p (char)

Helper function for the ESCAPE-FOO-MINIMAL-PLUS-QUOTES functions to determine whether CHAR must be escaped.

Package

cl-why.

Source

util.lisp.

Function: non-7bit-ascii-escape-char-p (char)

Helper function for the ESCAPE-FOO-ISO-8859-1 functions to determine whether CHAR must be escaped.

Package

cl-why.

Source

util.lisp.

Function: process-tag (sexp body-fn)

Returns a string list corresponding to the ‘HTML’ (in CL-WHY syntax) in SEXP. Uses the generic function CONVERT-TO-STRING-LIST internally. Utility function used by TREE-TO-TEMPLATE.

Package

cl-why.

Source

why.lisp.

Function: tree-to-commands (tree stream &key prologue indent)
Package

cl-why.

Source

why.lisp.

Function: tree-to-template (tree)

Transforms an HTML tree into an intermediate format - mainly a flattened list of strings. Utility function used by TREE-TO-COMMANDS-AUX.

Package

cl-why.

Source

why.lisp.

Function: wrapper-p (object)

Returns whether object is a wrapper of either type <RAW> or <ESC>.

Package

cl-why.

Source

specials.lisp.


5.2.5 Structures

Structure: <esc>

A wrapper for objects to print with HTML escapes.

Package

cl-why.

Source

specials.lisp.

Direct superclasses

structure-object.

Direct methods

print-object.

Direct slots
Slot: data
Readers

<esc>-data.

Writers

This slot is read-only.

Structure: <raw>

A wrapper for objects to print without HTML escapes.

Package

cl-why.

Source

specials.lisp.

Direct superclasses

structure-object.

Direct methods

print-object.

Direct slots
Slot: data
Readers

<raw>-data.

Writers

This slot is read-only.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (   -   <  
C   D   E   F   G   H   I   L   M   N   P   T   W  
Index Entry  Section

(
(setf html-mode): Public ordinary functions

-
-esc-: Private ordinary functions
-raw-: Private ordinary functions

<
<esc>-data: Private ordinary functions
<esc>-p: Private ordinary functions
<raw>-data: Private ordinary functions
<raw>-p: Private ordinary functions

C
conc: Public ordinary functions
convert-attributes: Public ordinary functions
convert-tag-to-string-list: Public generic functions
convert-tag-to-string-list: Public generic functions
copy-<esc>: Private ordinary functions
copy-<raw>: Private ordinary functions

D
defconstant: Private macros

E
escape-char: Public ordinary functions
escape-char-all: Public ordinary functions
escape-char-iso-8859-1: Public ordinary functions
escape-char-minimal: Public ordinary functions
escape-char-minimal-plus-quotes: Public ordinary functions
escape-string: Public ordinary functions
escape-string-all: Public ordinary functions
escape-string-iso-8859-1: Public ordinary functions
escape-string-minimal: Public ordinary functions
escape-string-minimal-plus-quotes: Public ordinary functions
extract-declarations: Private ordinary functions

F
Function, (setf html-mode): Public ordinary functions
Function, -esc-: Private ordinary functions
Function, -raw-: Private ordinary functions
Function, <esc>-data: Private ordinary functions
Function, <esc>-p: Private ordinary functions
Function, <raw>-data: Private ordinary functions
Function, <raw>-p: Private ordinary functions
Function, conc: Public ordinary functions
Function, convert-attributes: Public ordinary functions
Function, copy-<esc>: Private ordinary functions
Function, copy-<raw>: Private ordinary functions
Function, escape-char: Public ordinary functions
Function, escape-char-all: Public ordinary functions
Function, escape-char-iso-8859-1: Public ordinary functions
Function, escape-char-minimal: Public ordinary functions
Function, escape-char-minimal-plus-quotes: Public ordinary functions
Function, escape-string: Public ordinary functions
Function, escape-string-all: Public ordinary functions
Function, escape-string-iso-8859-1: Public ordinary functions
Function, escape-string-minimal: Public ordinary functions
Function, escape-string-minimal-plus-quotes: Public ordinary functions
Function, extract-declarations: Private ordinary functions
Function, html-mode: Public ordinary functions
Function, iso-8859-1-escape-char-p: Private ordinary functions
Function, list-to-string: Private ordinary functions
Function, make-<esc>: Private ordinary functions
Function, make-<raw>: Private ordinary functions
Function, minimal-escape-char-p: Private ordinary functions
Function, minimal-plus-quotes-escape-char-p: Private ordinary functions
Function, non-7bit-ascii-escape-char-p: Private ordinary functions
Function, process-tag: Private ordinary functions
Function, tree-to-commands: Private ordinary functions
Function, tree-to-template: Private ordinary functions
Function, wrapper-p: Private ordinary functions

G
Generic Function, convert-tag-to-string-list: Public generic functions

H
html-mode: Public ordinary functions

I
iso-8859-1-escape-char-p: Private ordinary functions

L
list-to-string: Private ordinary functions

M
Macro, defconstant: Private macros
Macro, n-spaces: Private macros
Macro, with-html-output: Public macros
Macro, with-html-output-to-string: Public macros
Macro, with-rebinding: Private macros
Macro, with-unique-names: Private macros
make-<esc>: Private ordinary functions
make-<raw>: Private ordinary functions
Method, convert-tag-to-string-list: Public generic functions
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
minimal-escape-char-p: Private ordinary functions
minimal-plus-quotes-escape-char-p: Private ordinary functions

N
n-spaces: Private macros
non-7bit-ascii-escape-char-p: Private ordinary functions

P
print-object: Public standalone methods
print-object: Public standalone methods
process-tag: Private ordinary functions

T
tree-to-commands: Private ordinary functions
tree-to-template: Private ordinary functions

W
with-html-output: Public macros
with-html-output-to-string: Public macros
with-rebinding: Private macros
with-unique-names: Private macros
wrapper-p: Private ordinary functions


A.3 Variables