The clip Reference Manual

This is the clip Reference Manual, version 0.7.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:40:20 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 clip

An HTML templating engine using Plump.

Maintainer

Yukari Hafner <>

Author

Yukari Hafner <>

Home Page

https://Shinmera.github.io/clip/

Source Control

(GIT https://github.com/Shinmera/clip.git)

Bug Tracker

https://github.com/Shinmera/clip/issues

License

zlib

Version

0.7.0

Dependencies
  • array-utils (system).
  • lquery (system).
Source

clip.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 clip/clip.asd

Source

clip.asd.

Parent Component

clip (system).

ASDF Systems

clip.


3.1.2 clip/package.lisp

Source

clip.asd.

Parent Component

clip (system).

Packages

clip.


3.1.3 clip/toolkit.lisp

Dependency

package.lisp (file).

Source

clip.asd.

Parent Component

clip (system).

Internals

3.1.4 clip/conditions.lisp

Dependency

toolkit.lisp (file).

Source

clip.asd.

Parent Component

clip (system).

Public Interface

3.1.5 clip/clipboard.lisp

Dependency

conditions.lisp (file).

Source

clip.asd.

Parent Component

clip (system).

Public Interface
Internals

3.1.6 clip/attr-processors.lisp

Dependency

clipboard.lisp (file).

Source

clip.asd.

Parent Component

clip (system).

Public Interface
Internals

3.1.7 clip/tag-processors.lisp

Dependency

attr-processors.lisp (file).

Source

clip.asd.

Parent Component

clip (system).

Public Interface
Internals

splice-into (function).


3.1.8 clip/processor.lisp

Dependency

tag-processors.lisp (file).

Source

clip.asd.

Parent Component

clip (system).

Public Interface

4 Packages

Packages are listed by definition order.


4.1 clip

Source

package.lisp.

Nickname

org.tymoonnext.clip

Use List
  • common-lisp.
  • lquery.
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-processors*

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.

Package

clip.

Source

attr-processors.lisp.

Special Variable: *clipboard-stack*

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.

Package

clip.

Source

clipboard.lisp.

Special Variable: *tag-processors*

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.

Package

clip.

Source

tag-processors.lisp.

Special Variable: *target*

This variable is bound to whatever node is currently being processed.

Package

clip.

Source

attr-processors.lisp.


5.1.2 Macros

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*

Package

clip.

Source

attr-processors.lisp.

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*

Package

clip.

Source

tag-processors.lisp.

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

Package

clip.

Source

clipboard.lisp.


5.1.3 Ordinary functions

Function: attribute-processor (attribute)

Returns the processor function for the requested attribute if one is registered. Otherwise returns NIL. See *ATTRIBUTE-PROCESSORS*.

Package

clip.

Source

attr-processors.lisp.

Function: (setf attribute-processor) (attribute)

Sets the attribute-processor bound to the given attribute to the specified function. See *ATTRIBUTE-PROCESSORS*.

Package

clip.

Source

attr-processors.lisp.

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

Package

clip.

Source

conditions.lisp.

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

Package

clip.

Source

conditions.lisp.

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

Package

clip.

Source

conditions.lisp.

Function: clipboard (field)

Shorthand for (CLIP (FIRST *CLIPBOARD-STACK*) FIELD)

Package

clip.

Source

clipboard.lisp.

Function: (setf clipboard) (field)

Shorthand for (SETF (CLIP (FIRST *CLIPBOARD-STACK*) FIELD) VALUE)

Package

clip.

Source

clipboard.lisp.

Function: make-clipboard (&rest fields)

Creates a new clipboard using the specified fields (like a plist).

Package

clip.

Source

clipboard.lisp.

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.

Package

clip.

Source

clipboard.lisp.

Function: process (target &rest fields)

Processes all clip markup on the target with the given FIELDS used to initialise the clipboard.

Package

clip.

Source

processor.lisp.

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

Package

clip.

Source

attr-processors.lisp.

Function: process-attributes (node)

Processes all attributes on the node. See PROCESS-ATTRIBUTE.

Package

clip.

Source

attr-processors.lisp.

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.

Package

clip.

Source

tag-processors.lisp.

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.

Package

clip.

Source

tag-processors.lisp.

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

Package

clip.

Source

tag-processors.lisp.

Function: process-to-string (target &rest fields)

Same as PROCESS, but automatically performs PLUMP:SERIALIZE on the result to a string.

Package

clip.

Source

processor.lisp.

Function: resolve-attribute (node attr)

Shorthand to resolve the value of an attibute. See RESOLVE-VALUE.

Package

clip.

Source

clipboard.lisp.

Function: tag-processor (tag)

Returns the processor function for the requested tag if one is registered. Otherwise returns NIL. See *TAG-PROCESSORS*.

Package

clip.

Source

tag-processors.lisp.

Function: (setf tag-processor) (tag)

Sets the tag-processor bound to the given tag-name to the specified function. See *TAG-PROCESSORS*.

Package

clip.

Source

tag-processors.lisp.


5.1.4 Generic functions

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.

Package

clip.

Source

clipboard.lisp.

Methods
Method: clip ((model structure-object) field)

Generic slot accessor.

Method: clip ((model standard-object) field)

Generic slot accessor.

Method: clip ((model list) field)

Generic alist or plist accessor.

Method: clip ((table hash-table) field)

Generic hash-table accessor.

Method: clip ((board clipboard) field)

Accessor for the clipboard object.

Generic Function: (setf clip) (object field)

Generic object setter.
If you want to get special treatment of objects or types, define your own methods on this.

Package

clip.

Source

clipboard.lisp.

Methods
Method: (setf clip) ((model structure-object) field)
Method: (setf clip) ((model standard-object) field)
Method: (setf clip) ((model list) field)
Method: (setf clip) ((table hash-table) field)
Method: (setf clip) ((board clipboard) 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.

Package

clip.

Source

clipboard.lisp.

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

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 (object)

Default fallback for unrecognized objects; simply returns it.


5.1.5 Conditions

Condition: attribute-condition

Superclass for all conditions related to problems with a node’s attribute.

See NODE-CONDITION

Package

clip.

Source

conditions.lisp.

Direct superclasses

node-condition.

Direct subclasses
Direct slots
Slot: attribute
Initargs

:attribute

Condition: clip-condition

Superclass for all conditions related to Clip.

Package

clip.

Source

conditions.lisp.

Direct superclasses

condition.

Direct subclasses

node-condition.

Condition: missing-attribute

Condition signalled when a required attribute is missing.

See ATTRIBUTE-CONDITION

Package

clip.

Source

conditions.lisp.

Direct superclasses
Condition: node-condition

Superclass for all conditions related to problems with a node.

See CLIP-CONDITION

Package

clip.

Source

conditions.lisp.

Direct superclasses

clip-condition.

Direct subclasses

attribute-condition.

Direct slots
Slot: node
Initargs

:node

Condition: unknown-attribute

Condition signalled when an unknown attribute is present.

See ATTRIBUTE-CONDITION

Package

clip.

Source

conditions.lisp.

Direct superclasses

5.1.6 Classes

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.

Package

clip.

Source

clipboard.lisp.

Direct methods
Direct slots
Slot: %clipboard-env
Initform

(make-hash-table :test (quote equalp))

Initargs

:env

Readers

clipboard-env.

Writers

(setf clipboard-env).


5.2 Internals


5.2.1 Special variables

Special Variable: *target-counter*

This counter is upped whenever process-node is called.

Package

clip.

Source

attr-processors.lisp.


5.2.2 Ordinary functions

Function: concat (list)

Returns a space concatenated string of the passed list.

Package

clip.

Source

toolkit.lisp.

Function: make-keyword (name)

Returns a keyword of the passed name.

Package

clip.

Source

toolkit.lisp.

Function: replace-region (string start end replacer)
Package

clip.

Source

attr-processors.lisp.

Function: splice-into (node pos new-children)
Package

clip.

Source

tag-processors.lisp.


5.2.3 Generic functions

Generic Reader: clipboard-env (object)
Package

clip.

Methods
Reader Method: clipboard-env ((clipboard clipboard))

automatically generated reader method

Source

clipboard.lisp.

Target Slot

%clipboard-env.

Generic Writer: (setf clipboard-env) (object)
Package

clip.

Methods
Writer Method: (setf clipboard-env) ((clipboard clipboard))

automatically generated writer method

Source

clipboard.lisp.

Target Slot

%clipboard-env.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   C   D   F   G   M   P   R   S   T   W  
Index Entry  Section

(
(setf attribute-processor): Public ordinary functions
(setf clip): Public generic functions
(setf clip): Public generic functions
(setf clip): Public generic functions
(setf clip): Public generic functions
(setf clip): Public generic functions
(setf clip): Public generic functions
(setf clipboard): Public ordinary functions
(setf clipboard-env): Private generic functions
(setf clipboard-env): Private generic functions
(setf tag-processor): Public ordinary functions

A
attribute-processor: Public ordinary functions

C
check-attribute: Public ordinary functions
check-no-unknown-attributes: Public ordinary functions
check-sole-attribute: Public ordinary functions
clip: Public generic functions
clip: Public generic functions
clip: Public generic functions
clip: Public generic functions
clip: Public generic functions
clip: Public generic functions
clipboard: Public ordinary functions
clipboard-env: Private generic functions
clipboard-env: Private generic functions
concat: Private ordinary functions

D
define-attribute-processor: Public macros
define-tag-processor: Public macros

F
Function, (setf attribute-processor): Public ordinary functions
Function, (setf clipboard): Public ordinary functions
Function, (setf tag-processor): Public ordinary functions
Function, attribute-processor: Public ordinary functions
Function, check-attribute: Public ordinary functions
Function, check-no-unknown-attributes: Public ordinary functions
Function, check-sole-attribute: Public ordinary functions
Function, clipboard: Public ordinary functions
Function, concat: Private ordinary functions
Function, make-clipboard: Public ordinary functions
Function, make-keyword: Private ordinary functions
Function, parse-and-resolve: Public ordinary functions
Function, process: Public ordinary functions
Function, process-attribute: Public ordinary functions
Function, process-attributes: Public ordinary functions
Function, process-children: Public ordinary functions
Function, process-node: Public ordinary functions
Function, process-tag: Public ordinary functions
Function, process-to-string: Public ordinary functions
Function, replace-region: Private ordinary functions
Function, resolve-attribute: Public ordinary functions
Function, splice-into: Private ordinary functions
Function, tag-processor: Public ordinary functions

G
Generic Function, (setf clip): Public generic functions
Generic Function, (setf clipboard-env): Private generic functions
Generic Function, clip: Public generic functions
Generic Function, clipboard-env: Private generic functions
Generic Function, resolve-value: Public generic functions

M
Macro, define-attribute-processor: Public macros
Macro, define-tag-processor: Public macros
Macro, with-clipboard-bound: Public macros
make-clipboard: Public ordinary functions
make-keyword: Private ordinary functions
Method, (setf clip): Public generic functions
Method, (setf clip): Public generic functions
Method, (setf clip): Public generic functions
Method, (setf clip): Public generic functions
Method, (setf clip): Public generic functions
Method, (setf clipboard-env): Private generic functions
Method, clip: Public generic functions
Method, clip: Public generic functions
Method, clip: Public generic functions
Method, clip: Public generic functions
Method, clip: Public generic functions
Method, clipboard-env: Private generic functions
Method, resolve-value: Public generic functions
Method, resolve-value: Public generic functions
Method, resolve-value: Public generic functions

P
parse-and-resolve: Public ordinary functions
process: Public ordinary functions
process-attribute: Public ordinary functions
process-attributes: Public ordinary functions
process-children: Public ordinary functions
process-node: Public ordinary functions
process-tag: Public ordinary functions
process-to-string: Public ordinary functions

R
replace-region: Private ordinary functions
resolve-attribute: Public ordinary functions
resolve-value: Public generic functions
resolve-value: Public generic functions
resolve-value: Public generic functions
resolve-value: Public generic functions

S
splice-into: Private ordinary functions

T
tag-processor: Public ordinary functions

W
with-clipboard-bound: Public macros


A.4 Data types

Jump to:   A   C   F   M   N   P   S   T   U  
Index Entry  Section

A
attr-processors.lisp: The clip/attr-processors․lisp file
attribute-condition: Public conditions

C
Class, clipboard: Public classes
clip: The clip system
clip: The clip package
clip-condition: Public conditions
clip.asd: The clip/clip․asd file
clipboard: Public classes
clipboard.lisp: The clip/clipboard․lisp file
Condition, attribute-condition: Public conditions
Condition, clip-condition: Public conditions
Condition, missing-attribute: Public conditions
Condition, node-condition: Public conditions
Condition, unknown-attribute: Public conditions
conditions.lisp: The clip/conditions․lisp file

F
File, attr-processors.lisp: The clip/attr-processors․lisp file
File, clip.asd: The clip/clip․asd file
File, clipboard.lisp: The clip/clipboard․lisp file
File, conditions.lisp: The clip/conditions․lisp file
File, package.lisp: The clip/package․lisp file
File, processor.lisp: The clip/processor․lisp file
File, tag-processors.lisp: The clip/tag-processors․lisp file
File, toolkit.lisp: The clip/toolkit․lisp file

M
missing-attribute: Public conditions

N
node-condition: Public conditions

P
Package, clip: The clip package
package.lisp: The clip/package․lisp file
processor.lisp: The clip/processor․lisp file

S
System, clip: The clip system

T
tag-processors.lisp: The clip/tag-processors․lisp file
toolkit.lisp: The clip/toolkit․lisp file

U
unknown-attribute: Public conditions