The pludeck Reference Manual

This is the pludeck Reference Manual, version 1.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 06:22:38 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 pludeck

A friendly interface for creating a Plump DOM.

Author

Joram Schrijver <>

License

MIT

Version

1.0.0

Dependency

plump (system).

Source

pludeck.asd.

Child Component

pludeck.lisp (file).


3 Files

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


3.1 Lisp


3.1.1 pludeck/pludeck.asd

Source

pludeck.asd.

Parent Component

pludeck (system).

ASDF Systems

pludeck.


3.1.2 pludeck/pludeck.lisp

Source

pludeck.asd.

Parent Component

pludeck (system).

Packages

pludeck.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 pludeck

Source

pludeck.lisp.

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 Macros

Macro: <!-- (&optional text)

Create a comment with the closest enclosing element as the parent.

Returns the comment node.

Package

pludeck.

Source

pludeck.lisp.

Macro: <![cdata[ (&optional text)

Create a CDATA element with the closest enclosing element as the parent.

Returns the CDATA node.

Package

pludeck.

Source

pludeck.lisp.

Macro: <!doctype (doctype)

Create a doctype element with the closest enclosing element as the parent.

Returns the doctype node.

Package

pludeck.

Source

pludeck.lisp.

Macro: <> (tag/attributes &body body)

Create a new element, with the closest enclosing element as the parent. This element will in turn serve as the parent for any elements constructed in its body.

Note that this binding is dynamic, meaning an element constructed inside a function called from the body will also have this DOM root as its parent.

TAG/ATTRIBUTES can either be a string, which will be used as the tag name, or a list. If it is a list, the first item should be a string that serves as the tag name, and the rest of the items form a plist of attribute names and values. Both the names and the values are evaluated. If a name evaluates to a symbol, its lowercased name is used as the attribute name. In all other cases the value of (PRINC-TO-STRING name) is used. The values are also passed to PRINC-TO-STRING.

Any non-list in the body (non-recursive) is wrapped in a call to <>TEXT.

Returns the constructed element.

Package

pludeck.

Source

pludeck.lisp.

Macro: <>define (name tag &key attributes content)

Define a macro to simplify construction of a specific type of DOM element.

The macro will be named NAME, and TAG will be the tag name of the elements it produces. The arguments for this newly defined macro depend on the values of ATTRIBUTES and CONTENT:

- If neither ATTRIBUTES nor CONTENT is true, the macro will take no arguments.

- If ATTRIBUTES is true and CONTENT is not, the macro will take attribute names and values as direct arguments.

- If CONTENT is true and ATTRIBUTES is not, the macro will take a body as its arguments. This body will get the same treatment as the one for <>.

- If both ATTRIBUTES and CONTENT are true, the macro will take a list of attribute names and values as its first argument, followed by a body. This body will similarly get the same treatment as the one for <>.

Package

pludeck.

Source

pludeck.lisp.

Macro: <>fulltext (tag/attributes content)

Create a new fulltext node with the closest enclosing element as the parent. CONTENT is passed to PRINC-TO-STRING.

A fulltext node is a DOM element that contains text that is not escaped using HTML entities. This is primarily useful for <style> and <script> in HTML.

Returns the constructed text node.

Package

pludeck.

Source

pludeck.lisp.

Macro: <>root (&body body)

Bind a new Plump DOM root as the parent for enclosed elements.

Note that this binding is dynamic, meaning an element constructed inside a function called from the body will also have this DOM root as its parent.

Any non-list in the body (non-recursive) is wrapped in a call to <>TEXT.

Returns the constructed DOM root.

Package

pludeck.

Source

pludeck.lisp.

Macro: <>text (content)

Create a new text node with the closest enclosing element as the parent. CONTENT is passed to PRINC-TO-STRING.

Returns the constructed text node.

Package

pludeck.

Source

pludeck.lisp.

Macro: <>wrap (parent &body body)

Bind the given element as the parent for enclosed elements.

Note that this binding is dynamic, meaning an element constructed inside a function called from the body will also have this DOM root as its parent.

Any non-list in the body (non-recursive) is wrapped in a call to <>TEXT.

Returns the given parent element.

Package

pludeck.

Source

pludeck.lisp.

Macro: <?xml (&rest attributes)

Create a new XML header with the closest enclosing element as the parent. Attributes are handled just like in <>.

Returns the XML header node.

Package

pludeck.

Source

pludeck.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: *parent*
Package

pludeck.

Source

pludeck.lisp.


5.2.2 Ordinary functions

Function: parse-attributes (attributes attribute-map-sym)

Transform a plist of attributes into a list of calls to SETF, putting those attributes into a Plump attribute map. Both the keys and the values are evaluated. An evaluated key may either be a symbol, in which it is lowercased, or any other value that can be turned into a string using PRINC-TO-STRING.

Package

pludeck.

Source

pludeck.lisp.

Function: preprocess-body (body)

Wrap any element of the body that is not a list in <>text.

Package

pludeck.

Source

pludeck.lisp.


Appendix A Indexes


A.1 Concepts


A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*parent*: Private special variables

S
Special Variable, *parent*: Private special variables