clip

API Reference

clip

An HTML templating engine using Plump.

CLIP

  • Condition CLIP-CONDITION
    Superclass for all conditions related to Clip.
  • Condition NODE-CONDITION  (CLIP-CONDITION)
    Superclass for all conditions related to problems with a node. See CLIP-CONDITION
  • Condition ATTRIBUTE-CONDITION  (NODE-CONDITION)
    Superclass for all conditions related to problems with a node's attribute. See NODE-CONDITION
  • Condition MISSING-ATTRIBUTE  (ERROR, ATTRIBUTE-CONDITION)
    Condition signalled when a required attribute is missing. See ATTRIBUTE-CONDITION
  • Condition UNKNOWN-ATTRIBUTE  (WARNING, ATTRIBUTE-CONDITION)
    Condition signalled when an unknown attribute is present. See ATTRIBUTE-CONDITION
  • Function CHECK-ATTRIBUTE (node attribute)
    Checks whether the given attribute is present on the node. If it is, the attribute's value is returned. Otherwise, an error of type MISSING-ATTRIBUTE is signalled. See MISSING-ATTRIBUTE
  • Function CHECK-NO-UNKNOWN-ATTRIBUTES (node &rest known-attributes)
    Checks whether there are any unknown attributes present on the node. If an unknown attribute is present, a warning of type UNKNOWN-ATTRIBUTE is signalled. Otherwise, NIL is returned. See UNKNOWN-ATTRIBUTE
  • Function CHECK-SOLE-ATTRIBUTE (node attribute)
    Checks whether the given attribute is the only attribute on the node. If it is not present, or not the only one, an error is signalled. Otherwise, the attribute's value is returned. See CHECK-NO-UNKNOWN-ATTRIBUTES See CHECK-ATTRIBUTE
  • Variable *CLIPBOARD-STACK*
    nil
    Template storage stack. When new clipboards are bound, they are pushed onto the stack. Once the binding is left, they are popped off the stack again.
  • Class CLIPBOARD
    Special class for clipboard environments. Use CLIPBOARD or CLIP to access and set values within. Field names are automatically transformed into strings as per STRING. Access is case-insensitive.
    %CLIPBOARD-ENV   Accessor: CLIPBOARD-ENV
  • Function MAKE-CLIPBOARD (&rest fields)
    Creates a new clipboard using the specified fields (like a plist).
  • Macro WITH-CLIPBOARD-BOUND ((new-clipboard &rest fields) &body body)
    Executes the body with the new clipboard on the *CLIPBOARD-STACK*. If fields are provided, they are set on the NEW-CLIPBOARD in plist fashion as per consecutive SETF. This means that side-effects of an early field set affect later fields. The fields are evaluated before the NEW-CLIPBOARD is pushed onto the *CLIPBOARD-STACK*.
  • Generic-Function CLIP (object field)
    Generic object accessor. If you want to get special treatment of objects or types, define your own methods on this.
  • Generic-Function (setf CLIP) (value object field)
    Generic object setter. If you want to get special treatment of objects or types, define your own methods on this.
  • Function CLIPBOARD (field)
    Shorthand for (CLIP (FIRST *CLIPBOARD-STACK*) FIELD)
  • Function (setf CLIPBOARD) (value field)
    Shorthand for (SETF (CLIP (FIRST *CLIPBOARD-STACK*) FIELD) VALUE)
  • Method CLIP ((board clipboard) field)
    Accessor for the clipboard object.
  • Method (setf CLIP) (value (board clipboard) field)
  • Method CLIP ((table hash-table) field)
    Generic hash-table accessor.
  • Method (setf CLIP) (value (table hash-table) field)
  • Method CLIP ((model list) field)
    Generic alist or plist accessor.
  • Method (setf CLIP) (value (model list) field)
  • Method CLIP ((model standard-object) field)
    Generic slot accessor.
  • Method (setf CLIP) (value (model standard-object) field)
  • Generic-Function RESOLVE-VALUE (object)
    Attempts to resolve the object to a specific value. This is usually used in combination with READ-FROM-STRING of an attribute value.
  • Method RESOLVE-VALUE (object)
    Default fallback for unrecognized objects; simply returns it.
  • Method RESOLVE-VALUE ((symbol symbol))
    Handler for symbols. If the symbol is EQL to '* the *CLIPBOARD* is returned, If the symbol is a keyword the symbol itself is returned, otherwise the value of (CLIPBOARD SYMBOL) is returned.
  • Method RESOLVE-VALUE ((list list))
    Handler for lists, aka function calls. The function call is decided upon the CAR of the list. The following cases are handled: QUOTE Returns the first argument FUNCTION Returns the symbol-function of the first argument OR Simulated version of the OR macro. AND Simulated version of the AND macro. Otherwise the symbol is looked for in the :CLIP package and then the current *PACKAGE*. If found, the function is applied with all arguments of the list (which are first all individually passed to RESOLVE-VALUE too).
  • Function RESOLVE-ATTRIBUTE (node attr)
    Shorthand to resolve the value of an attibute. See RESOLVE-VALUE.
  • Function PARSE-AND-RESOLVE (value)
    If the passed value is a STRING it is parsed using READ-FROM-STRING and subsequently passed to RESOLVE-VALUE. If it is not a string, the value itself is returned.
  • Variable *ATTRIBUTE-PROCESSORS*
    (make-hash-table :test 'equalp)
    Global registry of attribute processors. This has to be an EQUALP hash-table with the attribute name as keys and functions that accept two arguments (node attribute-value) as values. Binding this variable can be useful to establish local attributes.
  • Variable *TARGET*
    nil
    This variable is bound to whatever node is currently being processed.
  • Function ATTRIBUTE-PROCESSOR (attribute)
    Returns the processor function for the requested attribute if one is registered. Otherwise returns NIL. See *ATTRIBUTE-PROCESSORS*.
  • Function (setf ATTRIBUTE-PROCESSOR) (func attribute)
    Sets the attribute-processor bound to the given attribute to the specified function. See *ATTRIBUTE-PROCESSORS*.
  • Function PROCESS-ATTRIBUTE (node attribute value)
    Processes the specified attribute using the given value. If no attribute processor can be found, nothing is done. See *ATTRIBUTE-PROCESSORS*.
  • Macro DEFINE-ATTRIBUTE-PROCESSOR (attribute (node value) &body body)
    Defines a new attribute processor. ATTRIBTUE --- A symbol or string that matches the attribute to process (case-insensitive) NODE --- The current node is bound to this symbol. VALUE --- The value of the attribute is bound to this symbol. BODY ::= form*
  • Function PROCESS-ATTRIBUTES (node)
    Processes all attributes on the node. See PROCESS-ATTRIBUTE.
  • Variable *TAG-PROCESSORS*
    (make-hash-table :test 'equalp)
    Global registry of tag processors. This has to be an EQUALP hash-table with the tag name as keys and functions that accept one argument (the node) as values. Binding this variable can be useful to establish local tags.
  • Function TAG-PROCESSOR (tag)
    Returns the processor function for the requested tag if one is registered. Otherwise returns NIL. See *TAG-PROCESSORS*.
  • Function (setf TAG-PROCESSOR) (func tag)
    Sets the tag-processor bound to the given tag-name to the specified function. See *TAG-PROCESSORS*.
  • Function PROCESS-TAG (tag node)
    Processes the specified node as the given tag. If no tag processor can be found, PROCESS-ATTRIBUTES and PROCESS-CHILDREN is called. See *TAG-PROCESSORS*.
  • Macro DEFINE-TAG-PROCESSOR (tag (node) &body body)
    Defines a new attribute processor. TAG --- A symbol or string that matches the tag name to process (case-insensitive) NODE --- The node to process is bound to this symbol BODY ::= form*
  • Function PROCESS-CHILDREN (node)
    Calls PROCESS-NODE on all childrens of the passed node. This takes some care to make sure that splicing into the childrens array of the node is possible. However, note that inserting children before the node that is currently being processed will most likely lead to horrors. If such functionality is indeed ever needed (I hope not), this system needs to be rewritten to somehow be able to cope with such scenarios.
  • Function PROCESS-NODE (node)
    Processes the passed node. Depending on type the following is done: PLUMP:ELEMENT PROCESS-TAG is called. PLUMP:NESTING-NODE PROCESS-CHILDREN is called. PLUMP:NODE Nothing is done. T An error is signalled. Any call to this also increases the *TARGET-COUNTER* regardless of what is done.
  • Function PROCESS (target &rest fields)
    Processes all clip markup on the target with the given FIELDS used to initialise the clipboard.
  • Function PROCESS-TO-STRING (target &rest fields)
    Same as PROCESS, but automatically performs PLUMP:SERIALIZE on the result to a string.