This is the lquery Reference Manual, version 3.2.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 05:58:12 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
lquery
A library to allow jQuery-like HTML/DOM manipulation.
Yukari Hafner <shinmera@tymoon.eu>
Yukari Hafner <shinmera@tymoon.eu>
(GIT https://github.com/Shinmera/lquery.git)
zlib
3.2.1
array-utils
(system).
form-fiddle
(system).
plump
(system).
clss
(system).
package.lisp
(file).
toolkit.lisp
(file).
lquery.lisp
(file).
lquery-funcs.lisp
(file).
lquery-macros.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
lquery/lquery.asd
lquery/package.lisp
lquery/toolkit.lisp
lquery/lquery.lisp
lquery/lquery-funcs.lisp
lquery/lquery-macros.lisp
lquery/toolkit.lisp
package.lisp
(file).
lquery
(system).
*lquery-master-document*
(special variable).
copy-proper-vector
(function).
ensure-proper-vector
(function).
initialize
(function).
load-page
(function).
make-proper-vector
(function).
parse-html
(function).
with-master-document
(macro).
assure-attribute
(function).
build-elements
(function).
classes
(function).
funcs-or-select
(function).
get-css-styles
(function).
mkstr
(function).
nodes-or-build
(function).
nodes-or-select
(function).
nodes-or-selector-func
(function).
parse-css
(function).
replace-vector
(function).
replace-vector-if
(function).
set-css-styles
(function).
symb
(function).
trim
(function).
lquery/lquery.lisp
toolkit.lisp
(file).
lquery
(system).
$
(macro).
$1
(macro).
define-argument-handler
(macro).
define-lquery-function
(macro).
define-lquery-list-function
(macro).
define-lquery-macro
(macro).
define-lquery-subroutine
(macro).
define-value-handler
(macro).
%$
(function).
deflqfun
(macro).
determine-argument
(generic function).
determine-value
(generic function).
lquery/lquery-funcs.lisp
lquery.lisp
(file).
lquery
(system).
add
(function).
add-class
(function).
after
(function).
ancestor
(function).
append
(function).
append-to
(function).
attr
(function).
before
(function).
child-index
(function).
children
(function).
clone
(function).
closest
(function).
contains
(function).
contents
(function).
css
(function).
data
(function).
deepest
(function).
detach
(function).
each
(function).
empty
(function).
empty-p
(function).
eq
(function).
even
(function).
filter
(function).
find
(function).
first
(function).
gt
(function).
has
(function).
has-class
(function).
hide
(function).
html
(function).
html-file
(function).
index
(function).
initialize
(function).
insert-after
(function).
insert-before
(function).
is
(function).
is-empty
(function).
last
(function).
length
(function).
lt
(function).
map
(function).
map-apply
(function).
next
(function).
next-all
(function).
next-until
(function).
node
(function).
not
(function).
not-empty
(function).
odd
(function).
parent
(function).
parents
(function).
parents-until
(function).
prepend
(function).
prepend-to
(function).
prev
(function).
prev-all
(function).
prev-until
(function).
remove
(function).
remove-attr
(function).
remove-class
(function).
remove-data
(function).
render-text
(function).
replace-all
(function).
replace-with
(function).
root
(function).
serialize
(function).
show
(function).
siblings
(function).
size
(function).
slice
(function).
splice
(function).
text
(function).
toggle-class
(function).
unwrap
(function).
val
(function).
wrap
(function).
wrap-all
(function).
wrap-inner
(function).
write-to-file
(function).
parent-lists
(function).
lquery/lquery-macros.lisp
lquery-funcs.lisp
(file).
lquery
(system).
Packages are listed by definition order.
lquery
org.shirakumo.lquery
array-utils
.
common-lisp
.
$
(macro).
$1
(macro).
*lquery-master-document*
(special variable).
copy-proper-vector
(function).
define-argument-handler
(macro).
define-lquery-function
(macro).
define-lquery-list-function
(macro).
define-lquery-macro
(macro).
define-lquery-subroutine
(macro).
define-value-handler
(macro).
ensure-proper-vector
(function).
initialize
(function).
load-page
(function).
make-proper-vector
(function).
parse-html
(function).
with-master-document
(macro).
%$
(function).
assure-attribute
(function).
build-elements
(function).
classes
(function).
deflqfun
(macro).
determine-argument
(generic function).
determine-value
(generic function).
funcs-or-select
(function).
get-css-styles
(function).
mkstr
(function).
nodes-or-build
(function).
nodes-or-select
(function).
nodes-or-selector-func
(function).
parent-lists
(function).
parse-css
(function).
replace-vector
(function).
replace-vector-if
(function).
set-css-styles
(function).
symb
(function).
trim
(function).
lquery-funcs
org.shirakumo.lquery.funcs
add
(function).
add-class
(function).
after
(function).
ancestor
(function).
append
(function).
append-to
(function).
attr
(function).
before
(function).
child-index
(function).
children
(function).
clone
(function).
closest
(function).
contains
(function).
contents
(function).
css
(function).
data
(function).
deepest
(function).
detach
(function).
each
(function).
empty
(function).
empty-p
(function).
eq
(function).
even
(function).
filter
(function).
find
(function).
first
(function).
gt
(function).
has
(function).
has-class
(function).
hide
(function).
html
(function).
html-file
(function).
index
(function).
initialize
(function).
insert-after
(function).
insert-before
(function).
is
(function).
is-empty
(function).
last
(function).
length
(function).
lt
(function).
map
(function).
map-apply
(function).
next
(function).
next-all
(function).
next-until
(function).
node
(function).
not
(function).
not-empty
(function).
odd
(function).
parent
(function).
parents
(function).
parents-until
(function).
prepend
(function).
prepend-to
(function).
prev
(function).
prev-all
(function).
prev-until
(function).
remove
(function).
remove-attr
(function).
remove-class
(function).
remove-data
(function).
render-text
(function).
replace-all
(function).
replace-with
(function).
root
(function).
serialize
(function).
show
(function).
siblings
(function).
size
(function).
slice
(function).
splice
(function).
text
(function).
toggle-class
(function).
unwrap
(function).
val
(function).
wrap
(function).
wrap-all
(function).
wrap-inner
(function).
write-to-file
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
The master document used at the beginning of a chain.
Performs lQuery operations on the current document.
Each argument is executed in sequence. The arguments are evaluated according to the defined argument-handlers. By default, the following cases are handled:
* STRING Translates to a CLSS:QUERY on the current elements.
* FUNCTION Translates to a function call with the list of nodes as argument.
* SYMBOL Delegates to the value handlers.
* LIST Lists are transformed according to their first element, which must be a symbol. If the symbol’s name corresponds to a function found in the LQUERY-MACROS package, The form is assembled according to that function. Otherwise if it corresponds to an LQUERY-FUNCS function, it is expanded into a call to that function. If the symbol cannot be found in either package, it is put back in place, but the call itself is assembled like so: (FUNCTION PREVIOUS-RESULT ARGUMENT*)
Values are handled at runtime according to the defined variable-handlers. By default, the following cases are handled at run time:
* STRING Performs a CLSS:QUERY on the current elements.
* DOM:NODE Replaces the current set of nodes with just this node.
* FUNCTION Calls the given function with the current set of nodes as argument.
* LIST Lists are transformed into a proper vector.
* ARRAY Arrays are transformed into a proper vector.
* VECTOR Vectors that are not adjustable are transformed into a proper vector.
* T Any other value simply replaces the current list of nodes.
This is the same as $, except it automatically uses NODE at the end and thus only returns the first result, if any.
Defines a new argument handler that decides what to do with a certain type of argument at compile-time.
TYPE — A type or EQL specifier.
ARGUMENT-NAME — Symbol bound to the argument.
OPERATOR-NAME — Symbol bound to the object being operated on.
BODY ::= form*
Defines a new node function. This is the main mechanism by which node manipulations are defined.
All lquery functions are automatically created in the lquery-funcs package.
NAME — A symbol naming the lquery function. Automatically interned in the LQUERY-FUNCS package.
NODE-NAME — Symbol bound to the current node.
ARGUMENTS — A lambda-list specifying the arguments for the function.
BODY ::= form*
Defines a new function that operates on the current node array instead of individual elements.
All lquery functions are automatically created in the lquery-funcs package.
NAME — A symbol naming the lquery function. Automatically interned in the LQUERY-FUNCS package.
VECTOR-NAME — Symbol bound to the node vector.
ARGUMENTS — A lambda-list specifying the arguments for the function.
BODY ::= form*
Define a new lquery local macro.
All lquery macros are automatically created in the lquery-macros package.
NAME — A symbol naming the lquery macro. Automatically interned in the LQUERY-MACROS package.
PREVIOUS-FORM — Symbol bound to the so far assembled form, the previous value so to speak.
ARGUMENTS — A lambda-list specifying the arguments for the macro (note that this must be a standard lambda-list).
BODY ::= form*
Defines a shorthand function. The body is a set of lQuery instructions as you’d use in $.
NAME — A symbol naming the subroutine. Automatically interned in the LQUERY-FUNCS package.
ARGUMENTS — A lambda-list specifying the arguments for the function.
BODY ::= lquery-form*
Defines a new symbol handler that decides what to do with a certain type of symbol at run-time (variable type).
TYPE — A type or EQL specifier.
VARIABLE-NAME — Symbol bound to the argument.
OPERATOR-NAME — Symbol bound to the object being operated on.
BODY ::= form*
Surrounds the body in a binding for the *lquery-master-document* to ensure it does not get clobbered.
Shorthand to allow dropping the package prefix when nesting $/$1.
See $
Shorthand to allow dropping the package prefix when nesting $/$1.
See $1
Add elements to the set of matched elements.
Adds the specified class(es) to the set of matched elements.
The following types are handled for each class to add:
NULL — No class is added.
STRING — The string is added as a class.
SYMBOL — The symbol name, downcased, is added as a class.
LIST — Add all classes in the list. Each item must be one of
the above types.
Insert content (in html-string or node-list form) after each element.
Find the common ancestor of all elements.
Insert content (in html-string or node-list form) to the end of each element.
Insert every element to the end of the target(s).
Retrieve or set attributes on a node.
The value on a node is turned into a string using PRINC-TO-STRING.
If a value is NIL, the associated attribute is removed.
Insert content (in html-string or node-list form) before each element.
Returns the index of the element within its parent, also counting text nodes. See index() otherwise.
Get the children of each element, optionally filtered by a selector.
Create a deep copy of the set of matched elements.
For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. If no matching element can be found the root is entered instead.
COMBINES multiple lquery function calls into one by gathering them into a list for each element.
($ (combine (text) (attr :a))) would be equivalent to
($ (map #’(lambda (node) (list (lquery-funcs:text node) (lquery-funcs:attr node :a)))))
This construct is especially useful in combination with MAP-APPLY.
Select all elements that contain the specified text.
Get the children of each element, including text and comment nodes.
Copies the sequence into a new proper vector.
Retrieve or set css style attributes on a node.
Retrieve or set data attributes on a node. This is a convenience method and uses attr in the back.
Returns the innermost (left-bound) child element.
Removes the node (optionally filtered by the selector) from the document. Alias for remove()
Execute the specified function on each element until NIL is returned or all elements have been processed. The original set of elements is returned if replace is NIL.
Remove all child nodes from the set of matched elements.
Check if the node contains no children and/or only empty (whitespace) text nodes. If it is empty, T is returned, otherwise NIL.
Ensure that the variable is a proper vector.
Reduce the set of matched elements to the one at the specified index
Evaluates the form at compile-time and puts its resulting value in place.
Selects even elements, 1-indexed
Reduce the set of matched elements to those that match the selector or pass the function’s test.
Get the descendants of each element filtered by selector or function.
Reduce the set of matched elements to the first in the set.
Macro to allow #’foo to be used in lquery chains.
Select all elements at a greater than index(0) within the matched set.
Reduce the set of matched elements to those that have a descendant that matches the selector or element.
Determine whether any of the matched elements are assigned to the given class.
Hide the matched elements (short for (css "display" "none")).
Get the HTML contents of the elements or set the HTML contents of every matched element. The new content can be either a plump node, root, pathname, or string. If it is none of those, it is treated as a string via PRINC-TO-STRING
Read an HTML file and insert its contents into each element.
Find the index of the node within its parent.
See lquery function INITIALIZE.
This is merely a performance macro to avoid the unnecessary default allocation of a vector.
Sets the *lquery-master-document* variable to the provided document.
Re-initializes lQuery with a new page.
Treats the form as if the evaluated value was put literally in place.
See DETERMINE-VALUE.
Insert every element after the target.
Insert every element before the target.
Check the current elements against a selector or list of elements and return true if at least one of them matches.
Check if the node contains no children and/or only empty (whitespace) text nodes. If it is empty, T is returned, otherwise NIL. Alias of EMPTY-P
Reduce the set of matched elements to the final one in the set.
Returns the number of elements in the list.
Load the given file or string into a HTML DOM.
Select all elements at an index less than the index within the matched set.
Creates a new proper vector.
Pass each element through a function (which has to accept one argument, the node), returning the list of all results.
Pass each element through a function by apply, returning the vector of all results. This is commonly useful in combination with COMBINE.
Get the immediately following sibling of each element (if there is one). If a selector is provided, the sibling is only included if it matches.
Get all following siblings of each element. If a selector is provided, the sibling is only included if it matches.
Get all following silings of each element up to (excluding) the element matched by the selector or node list.
Return the specified node (default first) directly, without encompassing it into a vector if it exists. Otherwise return NIL.
Remove matching elements from the working elements.
Check if the node contains no children and/or only empty (whitespace) text nodes. If the node is effectively empty NIL is returned, otherwise T
Select all odd elements from the current set, 1-indexed.
Get the parent of each element, optionally filtered by a selector.
Get the ancestors of each element, optionally filtered by a selector. Closest parent first.
Get the ancestors of each element, up to (excluding) the element matched by the selector or node list. Closest parent first
Build the given string into DOM objects related to the master document.
Insert content, specified by the parameter, to the beginning of each element.
Insert every element to the beginning of the target(s).
Get the immediately preceding sibling of each element (if there is one). If a selector is provided, the sibling is only included if it matches.
Get all preceeding siblings of each element. If a selector is provided, the sibling is only included if it matches.
Get all preceeding silings of each element down to (excluding) the element matched by the selector or node list.
Remove the set of matched elements from the DOM.
Remove attributes from each element.
Remove classes from each element.
Each class in the list can be of the following types:
NULL — Nothing is done.
STRING — Matching classes by string= are removed.
SYMBOL — Matching classes against the symbol name by string-equal are removed.
LIST — Add all classes in the list. Each item must be one of
the above types.
Remove data attributes from each element. This is a convenience method and uses remove-attr in the back.
Return the "rendered" representation of the text inside the node and its children.
In effect the text is gathered from the component and all of
its children, but transforming the text in such a way that:
- All ASCII white space (Space, Tab, CR, LF) is converted into spaces.
- There are no consecutive spaces.
- There are no spaces at the beginning or end.
Replace each in the set of matched elements with the current nodes.
Replace each element with the provided new content and return the set of elements that was removed.
Returns to the root. Essentially traverses up the tree of the first element in the set until the root is reached.
Serialize the node into a string.
Allows two optional arguments:
STREAM — NIL to return a string, or a stream to output to.
FORMAT — One of :DEFAULT, :HTML, :XML to designate the way
in which to invoke Plump’s serializer.
Display the matched elements (short for (css :display ’block’))
Get the siblings of each element, optionally filtered by a selector.
Return the number of elements in the list.
Reduce the set of matched elements to a subset specified by a range of indices
Splice the element’s contents in place of itself.
Get the combined text contents of each element, including their descendants. If text is set, all text nodes are removed and a new text node is appended to the end of the node. If text is NIL, all direct text nodes are removed from the node. If text is not a string, it is transformed into one by PRINC-TO-STRING.
Add or remove one or more classes from each element, depending on their presence within the element.
Remove the parents of the set of matched elements from the DOM, inserting the parents children in place of it.
Get the current values or set the value of every matched element.
Wrap an HTML structure around each element. Note that always the first node of the structure to wrap is chosen.
Wrap an HTML structure around all elements and put it in place of the first element, removing all other elements from their position.
Wrap an HTML structure around the contents of each element.
Write the serialized node to the file. Note that always only the first element is written.
Return the object as a function or use it to construct a node-matches? function.
Concatenates args by printing into string.
Clone the object as a node list or use it to build a new HTML node.
Return the object as a node list or use it to form a select query.
Build a function matching the selector or checking the equality/inclusion of the object.
Interns the mkstr output/returns as symbol.
Determines what to do with a given argument at compile-time (static type).
Determines what to do with a given symbol at run-time (variable type).
function
) nodes) ¶node
) nodes) ¶string
) nodes) ¶vector
) nodes) ¶array
) nodes) ¶list
) nodes) ¶Jump to: | $
%
A B C D E F G H I L M N O P R S T U V W |
---|
Jump to: | $
%
A B C D E F G H I L M N O P R S T U V W |
---|
Jump to: | *
S |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
* | |||
*lquery-master-document* : | Public special variables | ||
| |||
S | |||
Special Variable, *lquery-master-document* : | Public special variables | ||
|
Jump to: | *
S |
---|
Jump to: | F L P S T |
---|
Jump to: | F L P S T |
---|