The flute Reference Manual

This is the flute Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Thu Feb 15 05:58:50 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 flute

A beautiful, easilly composable HTML5 generation library

Author

Bo Yao <>

License

MIT

Long Description

# Flute

Flute is a beautiful, easily composable HTML5 generation library in Common Lisp. It’s

- Simple: the most simplistic syntax, for builtin and customized elements;
- Easy to debug: pretty print generated html snippet in REPL;
- Powerful: help you define reusable and composable components, like that in React
- Modern: focus only on HTML5

# Getting started

## Install and run tests

“‘lisp
(ql:quickload :flute)
(ql:quickload :flute-test)
“‘

Then define a new package specifically for HTML generation, in its definition:
“‘lisp
(defpackage flute-user
(:use :cl :flute))
“‘
If you don’t want to import all symbols, see [H Macro](#h-macro), which provide a similar interface as a tranditional Lisp HTML generation library.

## Using html elements
“‘
(html
(head
(link :rel "...")
(script :src "..."))
(body
(div :id "a" :class "b"
(p :style "color: red"
"Some text")
"Some text in div"
(img :src "/img/dog.png")
(a ’(:href "/cat")
(img ’((:src . "/img/cat.png")))))))
“‘

These ‘html‘, ‘div‘, etc. are just functions. Element attribute can be given inline as the above example, or as alist/plist/attrs object as the first argument, like the last ‘a‘ and ‘img‘ in the above example. In this case they can be variables that calculated programmatically.

The remaining argument will be recognized as the children of this element. Each child can be:
1. string;
2. element, builtin or user defined;
3. list of 1, 2 and 3. Can also be NIL.
All children will be flattened as if they’re given inline.

## Define new element
“‘lisp
(define-element dog (id size)
(if (and (realp size) (> size 10))
(div :id id :class "big-dog"
children
"dog")
(div :id id :class "small-dog"
children
"dog")))
“‘
‘dog‘ will be defined as a function that takes ‘:id‘ and ‘:size‘ keyword arguments. ‘dog‘ returns an user-defined element object. Inside it, ‘children‘ will be replaced with the children elements you provided when creating this ‘dog‘:
“‘
FLUTE-USER> (defparameter *dog1* (dog :id "dog1" :size 20))
*DOG1*
FLUTE-USER> *dog1*
<div id="dog1" class="big-dog">dog</div>
FLUTE-USER> (dog :id "dog2" "I am a dog" *)
<div id="dog2" class="small-dog">
I am a dog
<div id="dog1" class="big-dog">dog</div>
dog
</div>
“‘

All elements, both builtin and user defined ones are objects, although they’re printed as html snippet in REPL. Their attribute can be accessed by ‘(element-attrs element)‘. Their children can be accessed by ‘(element-children elements)‘ and tag name by ‘(element-tag element)‘. You can modify an exising element’s attrs and children. If you modify a user defined element, the body you defined in it’s ‘define-element‘ also re-executed to take effect of the the attrs and children change:
“‘
FLUTE-USER> *dog1*
<div id="dog1" class="big-dog">dog</div>
FLUTE-USER> (setf (attr *dog1* :size) 10
;; attr is a helper method to set (flute:element-attrs *dog1*)
(attr *dog1* :id) "dooooog1"
(element-children *dog1*) (list "i’m small now"))
("i’m small now")
FLUTE-USER> *dog1*
<div id="dooooog1" class="small-dog">
i’m small now
dog
</div>
“‘

By default user element is printed as what it expand to. If you have a lot of user defined element nested deeply, you probably want to have a look at the high level:
“‘
FLUTE-USER> (let ((*expand-user-element* nil))
(print *dog1*)
(values))

<dog id="dooooog1" size=10>i’m small now</dog>
; No value
FLUTE-USER>
“‘

## Generate HTML
To generate a piece of HTML string that probably used in a response of a backend service:
“‘lisp
(elem-str element)
“‘
To generate HTML string that has nice indent as that in REPL:
“‘lisp
(element-string element)
“‘
To generate that and write to file, just create a stream, then ‘(write element :stream stream)‘ for human or ‘(write element :stream stream :pretty nil)‘ for production.

## H macro
If you don’t want to import all the symbols, you can use the ‘h‘ macro:
“‘lisp
(defpackage flute-min
(:use :cl)
(:import-from :flute
:h
:define-element))
“‘
Then just wrap ‘h‘ for all html generation part. In the same examples above, it becomes:
“‘ lisp
(in-package :flute-min)
(h (html
(head
(link :rel "...")
(script :src "..."))
(body
(div :id "a" :class "b"
(p :style "color: red"
"Some text")
"Some text in div"
(img :src "/img/dog.png")
(a ’(:href "/cat")
(img ’((:src . "/img/cat.png"))))))))

(define-element dog (id size)
(if (and (realp size) (> size 10))
(h (div :id id :class "big-dog"
flute:children
"dog"))
(h (div :id id :class "small-dog"
flute:children
"dog"))))

(defparameter *dog2* (dog :id "dog2" :size 20 "some children"))
“‘
From version 0.2 (available in Aug 2018 Quicklisp), flute supports css style id and class attribute for builtin elements. For example ‘div#id-name.class1.class2‘, So you can also write:
“‘lisp
(h (div#a.b "..."))
;; Provide additional class and attributes
(h (div#a.b :class "c" :onclick "fun()"))
“‘

## Inline CSS and JavaScript
With help of [cl-css](https://github.com/Inaimathi/cl-css) (available in Quicklisp), You can write inline CSS for the ‘style‘ attribute, in a similar syntax like flute:
“‘lisp
(div :style (inline-css ’(:margin 5px :padding 0px)))
“‘
‘cl-css:inline-css‘ is a function taking plist and returns the result css string, so it can be safely used inside or outside of ‘H‘ macro and with variable arguments.

With help of [Parenscript](https://github.com/vsedach/Parenscript) (available in Quicklisp), You can write inline JavaScript for ‘onclick‘, etc. attribute:
“‘lisp
(button :onclick (ps-inline (func)))
“‘

That’s all you need to know to define elements and generate html. Please reference the [API Reference](#api-reference) Section for detailed API.

# Change Logs
## 2018/07/28 Version 0.2-dev
- Support ‘element#id.class1.class2‘ in ‘H‘ macro for builtin elements;
- Suggestions on inline CSS and JavaScript in lispy way;
- Jon Atack fix an error example in README.
## 2018/07/11 Version 0.1
- Current features, APIs and Tests.

# Motivation
Currently there’re a few HTML generation library in Common Lisp, like [CL-WHO](https://edicl.github.io/cl-who/), [CL-MARKUP](https://github.com/arielnetworks/cl-markup) and [Spinneret](https://github.com/ruricolist/spinneret). They both have good features for generating standard HTML, but not very good at user element (components) that currently widely used in frontend: you need to define all of them as macros and to define components on top of these components, you’ll have to make these components more complex macros to composite them. [Spinneret](https://github.com/ruricolist/spinneret) has a ‘deftag‘ feature, but ‘deftag‘ is still expand to a ‘defmacro‘.

I’d also want to modify the customer component attribute after create it and incorporate it with it’s own logic (like the dog size example above), this logic should be any lisp code. This requires provide all element as object, not plain HTML text generation. With this approach, all elements have a same name function to create it, and returns element that you can modify later. These objects are virtual doms and it’s very pleasant to write html code and frontend component by just composite element objects as arguments in element creation function calls. Flute’s composite feature inspired by [Hiccup](https://github.com/weavejester/hiccup) and [Reagent](https://github.com/reagent-project/reagent) but more powerful – in flute, user defined elements is real object with attributes and it’s own generation logic.

# Limitation
With the function name approach, it’s not possible to support ‘div.id#class1#class2‘ style function names. I’m working on some tweak of reader macros in [illusion](https://github.com/ailisp/illusion) library to detect this and convert it to ‘(div :id "id" :class "class1 class2" ...)‘ call

The most and major limitation is we don’t have a substential subset of Common Lisp in browser so flute can be used in frontend. [Parenscript](https://github.com/vsedach/Parenscript) is essentially a JavaScript semantic in Lisp like syntax. [JSCL](https://github.com/jscl-project/jscl) is promosing, but by now it seems focus on creating a CL REPL on Web and doesn’t support ‘format‘ or CLOS. Also we lack enough infrastructure to build Common Lisp to JavaScript (might be an asdf plugin) and connect to a browser "Swank" via WebSocket from Emacs. I’ll be working these: a full or at least substential subset of Common Lisp to JavaScript Compiler to eventually have a full frontend development environment in Common Lisp. Any help or contribution is welcome.

# API Reference
Here is a draft version of API Reference, draft means it will be better organized and moved to a separate HTML doc, but it’s content is already quite complete.

## Builtin HTML elements
“‘
a abbr address area article aside audio b base bdi bdo blockquote
body br button canvas caption cite code col colgroup data datalist
dd del details dfn dialog div dl dt em embed fieldset figcaption
figure footer form h1 h2 h3 h4 h5 h6 head header hr i iframe html
img input ins kbd label legend li link main |map| mark meta meter nav
noscript object ol optgroup option output p param picture pre progress
q rp rt ruby s samp script section select small source span strong
style sub summary sup svg table tbody td template textarea tfoot th
thead |time| title tr track u ul var video wbr
“‘
All of above HTML5 elements are functions, which support same kinds of parameters, take ‘A‘ as example:
“‘ lisp
;; Function A &REST ATTRS-AND-CHILREN
;;
;; Create and return an <a> element object
;; ATTRS-AND-CHILDREN can be the following:

;; 1. an empty <a> tag
(a)

;; 2. attributes of alist, plist or ATTRS object
;; The following creates: <a id="aa" customer-attr="bb">
(a :id "aa" :customer-attr "bb")
(a ’(:id "aa" :customer-attr "bb"))
(a ’((:id . "aa") (:customer-attr . "bb")))
;; or assume we have the above one in variable a1
(a (element-attrs a1)) ; to share the same attrs with a1
(a (copy-attrs (element-attrs a1)))

;; 3. any of above format attributes with children
(a :id "aa" :customer-attr "bb"
"Some children"
(div ’(:id "an element children"))
; list of any depth containing elements and texts, will be flattened
(list a1 a2 (a ’((:id . "aaa")) "some text")
(list (h1 "aaa")))
"some other text")
“‘
The ‘HTML‘ element is a little special, it’s with ‘<!DOCTYPE html>‘ prefix to make sure browser recognize it correctly.

## User defined elements
“‘lisp
;; Macro DEFINE-ELEMENT NAME (&REST ARGS) &BODY BODY
;;
;; Define a user element with NAME as its tag name and function
;; NAME. After DEFINE-ELEMENT, a FUNCTION of NAME in current package
;; is defined. ARGS specified the possible keyword ARGS it can take as
;; it’s ATTRS. You can either use these ARGS as Lisp arguments in the
;; BODY of its definition and plug in them to the BODY it expand to.
;; You can use FLUTE:CHILDREN to get or set it’s children that you give
;; when call function NAME, FLUTE:ATTRS to get or set it’s attributes
;; and FLUTE:TAG to get or set it’s tag name.

;; Variable *EXPAND-USER-ELEMENT*
;;
;; Bind this variable to specify whether the user elements are print in
;; a high level (NIL), or expand to HTML elements (T). T by default.
“‘

## Attribute accessing utility
“‘ lisp
;; Function ATTRS-ALIST ATTRS
;; Function (SETF ATTRS-ALIST) ATTRS
;;
;; Return or set the attrs object in alist format

;; Function MAKE-ATTRS &KEYS ALIST
;;
;; Create a attrs aoject, given an alist of (:attr . "attr-value") pair.
;; Attribute values (cdr of each element in alist) will be escaped if
;; *ESCAPE-HTML* is not NIL

;; Function COPY-ATTRS ATTRS
;;
;; Make a copy and return the copy of ATTRS object

;; Method ATTR ATTRS KEY
;; Method (SETF ATTR) ATTRS KEY
;; Method ATTR ELEMENT KEY
;; Method (SETF ATTR) ELEMENT KEY
;;
;; Get or set the attribute value of given KEY. KEY should be an keyword.
;; If KEY does not exist, ATTR method will return NIL. (SETF ATTR) method
;; will create the (KEY . VALUE) pair. Don’t use (SETF (ATTR ATTRS :key) NIL)
;; or (SETF (ATTR ELEMENT :key) NIL) to remove an attr, use DELETE-ATTR.

;; Method DELETE-ATTR ATTRS KEY
;; Method DELETE-ATTR ELEMENT KEY
;;
;; Delete the attribute key value pair from ATTRS or ELEMENT’s ELEMENT-ATTRS,
;; will ignore if KEY doesn’t exist.

“‘

## Element slots
“‘lisp
;; Method ELEMENT-TAG ELEMENT
;; Method (SETF ELEMENT-TAG) ELEMENT
;;
;; Get or set the ELEMENT-TAG STRING. For example <html>’s ELEMENT-TAG is "html"

;; Method ELEMENT-ATTRS ELEMENT
;; Method (SETF ELEMENT-ATTRS) ELEMENT
;;
;; Get or set the ELEMENT-ATTRS. When set this, must be an ATTRS object

;; Method ELEMENT-CHILDREN ELEMENT
;; Method (SETF ELEMENT-CHILDREN) ELEMENT
;;
;; Get or set element children. When set this manually, must given a flatten list
;; of ELEMENT or STRING.

;; Method USER-ELEMENT-EXPAND-TO USER-ELEMENT
;;
;; Get what this USER-ELEMENT-TO. Returns the root ELEMENT after it expands.
“‘

## The H macro
“‘lisp
;; Macro H &BODY CHILDREN
;;
;; Like a PROGN, except it will replace all html tag SYMBOLs with the same name one
;; in FLUTE PACKAGE, so you don’t need to import all of them. As an alternative you
;; can import all or part of html element functions in FLUTE PACKAGE to use them
;; without H macro

“‘

## Escape utility
“‘lisp
;; Variable *ESCAPE-HTML*
;;
;; Specify the escape option when generate html, can be :UTF8, :ASCII, :ATTR or NIL.
;; If :UTF8, escape only #\<, #\> and #\& in body, and \" in attribute keys. #\’ will
;; in attribute keys will not be escaped since flute will always use double quote for
;; attribute keys.
;; If :ASCII, besides what escaped in :UTF8, also escape all non-ascii characters.
;; If :ATTR, only #\" in attribute values will be escaped.
;; If NIL, nothing is escaped and programmer is responsible to escape elements properly.
;; When given :ASCII and :ATTR, it’s possible to insert html text as a children, e.g.
;; (div :id "container" "Some <b>text</b>")
;; All the escapes are done in element creation time.

;; Function ESCAPE-STRING STRING TEST
;;
;; Escape the STRING if it’s a STRING and escaping all charaters C that satisfied
;; (FUNCALL TEST C). Return the new STRING after escape.

;; Function UTF8-HTML-ESCAPE-CHAR-P CHAR
;;
;; Return T if CHAR is a CHARACTER that need to be escaped when HTML is UTF-8 encoded.
;; Return NIL otherwise.

;; Function ASCII-HTML-ESCAPE-CHAR-P CHAR
;;
;; Return T if CHAR is a CHARACTER that need to be escaped when HTML is ASCII encoded.
;; Return NIL otherwise.

;; Function ATTR-VALUE-ESCAPE-CHAR-P CHAR
;;
;; Return T if CHAR is a CHARACTER that need to be escaped when as an attribute value.
;; Return NIL otherwise.

“‘

## Generate HTML string

“‘ lisp
;; Method ELEMENT-STRING ELEMENT
;;
;; Return human readable, indented HTML string for ELEMENT

;; Method ELEM-STR ELEMENT
;;
;; Return minify HTML string for ELEMENT
“‘

# License
Licensed under MIT License.
Copyright (c) 2018, Bo Yao. All rights reserved.

Dependencies
  • assoc-utils (system).
  • let-over-lambda (system).
Source

flute.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 flute/src

Source

flute.asd.

Parent Component

flute (system).

Child Components

4 Files

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


4.1 Lisp


4.1.1 flute/flute.asd

Source

flute.asd.

Parent Component

flute (system).

ASDF Systems

flute.


4.1.2 flute/src/package.lisp

Source

flute.asd.

Parent Component

src (module).

Packages

flute.


4.1.3 flute/src/util.lisp

Dependency

package.lisp (file).

Source

flute.asd.

Parent Component

src (module).

Public Interface
Internals

4.1.4 flute/src/flute.lisp

Dependency

util.lisp (file).

Source

flute.asd.

Parent Component

src (module).

Public Interface
Internals

5 Packages

Packages are listed by definition order.


5.1 flute

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

6 Definitions

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


6.1 Public Interface


6.1.1 Special variables

Special Variable: *escape-html*

Specify the escape option when generate html, can be :UTF8, :ASCII, :ATTR or NIL. If :UTF8, escape only #<, #> and #& in body, and " in attribute keys. #’ will
in attribute keys will not be escaped since flute will always use double quote for attribute keys.
If :ASCII, besides what escaped in :UTF8, also escape all non-ascii characters. If :ATTR, only #" in attribute values will be escaped.
If NIL, nothing is escaped and programmer is responsible to escape elements properly. When given :ASCII and :ATTR, it’s possible to insert html text as a children, e.g. (div :id "container" "Some <b>text</b>")

Package

flute.

Source

flute.lisp.

Special Variable: *expand-user-element*
Package

flute.

Source

flute.lisp.


6.1.2 Macros

Macro: define-element (name (&rest args) &body body)
Package

flute.

Source

flute.lisp.

Macro: h (&body body)
Package

flute.

Source

flute.lisp.


6.1.3 Ordinary functions

Function: a (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: abbr (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: address (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: area (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: article (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: ascii-html-escape-char-p (char)
Package

flute.

Source

util.lisp.

Function: aside (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: attr-value-escape-char-p (char)
Package

flute.

Source

util.lisp.

Reader: attrs-alist (instance)
Writer: (setf attrs-alist) (instance)
Package

flute.

Source

flute.lisp.

Target Slot

alist.

Function: audio (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: b (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: base (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: bdi (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: bdo (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: blockquote (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: body (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: br (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: button (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: canvas (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: caption (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: cite (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: code (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: col (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: colgroup (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: copy-attrs (instance)
Package

flute.

Source

flute.lisp.

Function: data (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: datalist (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: dd (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: del (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: details (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: dfn (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: dialog (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: div (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: dl (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: dt (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: em (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: embed (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: escape-string (string &optional test)
Package

flute.

Source

util.lisp.

Function: fieldset (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: figcaption (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: figure (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Package

flute.

Source

flute.lisp.

Function: form (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: h1 (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: h2 (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: h3 (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: h4 (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: h5 (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: h6 (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: head (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: header (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: hr (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: html (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: i (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: iframe (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: img (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: input (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: ins (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: kbd (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: label (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: legend (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: li (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Package

flute.

Source

flute.lisp.

Function: main (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: make-attrs (&key alist)
Package

flute.

Source

flute.lisp.

Function: map (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: mark (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: meta (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: meter (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: nav (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: noscript (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: object (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: ol (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: optgroup (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: option (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: output (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: p (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: param (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: picture (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: pre (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: progress (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: q (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: rp (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: rt (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: ruby (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: s (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: samp (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: script (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: section (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: select (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: small (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: source (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: span (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: strong (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: style (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: sub (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: summary (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: sup (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: svg (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: table (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: tbody (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: td (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: template (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: textarea (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: tfoot (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: th (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: thead (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: time (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: title (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: tr (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: track (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: u (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: ul (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: utf8-html-escape-char-p (char)
Package

flute.

Source

util.lisp.

Function: var (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: video (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.

Function: wbr (&rest attrs-and-children)
Package

flute.

Source

flute.lisp.


6.1.4 Generic functions

Generic Function: attr (attrs key)
Package

flute.

Methods
Method: attr ((element element) key)
Source

flute.lisp.

Method: attr ((attrs attrs) key)
Source

flute.lisp.

Generic Function: (setf attr) (attrs key)
Package

flute.

Methods
Method: (setf attr) ((element element) key)
Source

flute.lisp.

Method: (setf attr) ((attrs attrs) key)
Source

flute.lisp.

Generic Function: delete-attr (attrs key)
Package

flute.

Methods
Method: delete-attr ((element element) key)
Source

flute.lisp.

Method: delete-attr ((attrs attrs) key)
Source

flute.lisp.

Generic Function: elem-str (element)
Package

flute.

Methods
Method: elem-str ((element element))
Source

flute.lisp.

Generic Reader: element-attrs (object)
Package

flute.

Methods
Reader Method: element-attrs ((element element))

automatically generated reader method

Source

flute.lisp.

Target Slot

attrs.

Generic Writer: (setf element-attrs) (object)
Package

flute.

Methods
Writer Method: (setf element-attrs) ((element element))

automatically generated writer method

Source

flute.lisp.

Target Slot

attrs.

Generic Reader: element-children (object)
Package

flute.

Methods
Reader Method: element-children ((element element))

automatically generated reader method

Source

flute.lisp.

Target Slot

children.

Generic Writer: (setf element-children) (object)
Package

flute.

Methods
Writer Method: (setf element-children) ((element element))

automatically generated writer method

Source

flute.lisp.

Target Slot

children.

Generic Function: element-string (element)
Package

flute.

Methods
Method: element-string ((element element))
Source

flute.lisp.

Generic Reader: element-tag (object)
Package

flute.

Methods
Reader Method: element-tag ((element element))

automatically generated reader method

Source

flute.lisp.

Target Slot

tag.

Generic Writer: (setf element-tag) (object)
Package

flute.

Methods
Writer Method: (setf element-tag) ((element element))

automatically generated writer method

Source

flute.lisp.

Target Slot

tag.

Generic Function: user-element-expand-to (element)
Package

flute.

Methods
Method: user-element-expand-to ((element user-element))
Source

flute.lisp.


6.1.5 Standalone methods

Method: print-object ((attrs attrs) stream)
Source

flute.lisp.

Method: print-object ((element user-element) stream)
Source

flute.lisp.

Method: print-object ((element builtin-element-with-prefix) stream)
Source

flute.lisp.

Method: print-object ((element element) stream)
Source

flute.lisp.


6.1.6 Structures

Structure: attrs
Package

flute.

Source

flute.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: alist
Package

assoc-utils.

Readers

attrs-alist.

Writers

(setf attrs-alist).


6.2 Internals


6.2.1 Special variables

Special Variable: *builtin-elements*
Package

flute.

Source

flute.lisp.


6.2.2 Macros

Macro: define-and-export-builtin-elements (&rest element-names)
Package

flute.

Source

flute.lisp.

Macro: define-builtin-element (element-name)
Package

flute.

Source

flute.lisp.

Macro: tree-leaves (tree test result)
Package

flute.

Source

util.lisp.


6.2.3 Ordinary functions

Reader: !expanded-list (instance)
Writer: (setf !expanded-list) (instance)
Package

flute.

Source

util.lisp.

Target Slot

list.

Function: !expanded-p (object)
Package

flute.

Source

util.lisp.

Function: %make-attrs (&key alist)
Package

flute.

Source

flute.lisp.

Function: alist-plist* (alist)
Package

flute.

Source

util.lisp.

Function: append-inline-attrs (attrs-and-children)
Package

flute.

Source

util.lisp.

Function: attrs-p (object)
Package

flute.

Source

flute.lisp.

Function: collect-id-and-class (symbol)
Package

flute.

Source

util.lisp.

Function: collect-name-as-keyword (symbol)
Package

flute.

Source

util.lisp.

Function: collect-until-dot-or-sharp (string)
Package

flute.

Source

util.lisp.

Function: copy-!expanded (instance)
Package

flute.

Source

util.lisp.

Function: escape-attrs-alist (alist)
Package

flute.

Source

util.lisp.

Function: escape-char (char)
Package

flute.

Source

util.lisp.

Function: escape-children (children)
Package

flute.

Source

util.lisp.

Function: html-element-p (x)
Package

flute.

Source

flute.lisp.

Function: make-!expanded (&key list)
Package

flute.

Source

util.lisp.

Function: make-builtin-element (&key tag attrs children)
Package

flute.

Source

flute.lisp.

Function: make-builtin-element-with-prefix (&key tag attrs children prefix)
Package

flute.

Source

flute.lisp.

Function: make-user-element (&rest args &key tag attrs children expander)
Package

flute.

Source

flute.lisp.

Function: plist-alist (plist)
Package

flute.

Source

util.lisp.

Function: split-attrs-and-children (attrs-and-children)
Package

flute.

Source

util.lisp.

Function: tree-leaves%% (tree test result)
Package

flute.

Source

util.lisp.


6.2.4 Generic functions

Generic Reader: element-prefix (object)
Package

flute.

Methods
Reader Method: element-prefix ((builtin-element-with-prefix builtin-element-with-prefix))

automatically generated reader method

Source

flute.lisp.

Target Slot

prefix.

Generic Writer: (setf element-prefix) (object)
Package

flute.

Methods
Writer Method: (setf element-prefix) ((builtin-element-with-prefix builtin-element-with-prefix))

automatically generated writer method

Source

flute.lisp.

Target Slot

prefix.

Generic Reader: user-element-expander (object)
Package

flute.

Methods
Reader Method: user-element-expander ((user-element user-element))

automatically generated reader method

Source

flute.lisp.

Target Slot

expand-to.

Generic Writer: (setf user-element-expander) (object)
Package

flute.

Methods
Writer Method: (setf user-element-expander) ((user-element user-element))

automatically generated writer method

Source

flute.lisp.

Target Slot

expand-to.


6.2.5 Structures

Structure: !expanded
Package

flute.

Source

util.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: list
Package

common-lisp.

Readers

!expanded-list.

Writers

(setf !expanded-list).


6.2.6 Classes

Class: builtin-element
Package

flute.

Source

flute.lisp.

Direct superclasses

element.

Direct subclasses

builtin-element-with-prefix.

Class: builtin-element-with-prefix
Package

flute.

Source

flute.lisp.

Direct superclasses

builtin-element.

Direct methods
Direct slots
Slot: prefix
Initargs

:prefix

Readers

element-prefix.

Writers

(setf element-prefix).

Class: element
Package

flute.

Source

flute.lisp.

Direct subclasses
Direct methods
Direct slots
Slot: tag
Initargs

:tag

Readers

element-tag.

Writers

(setf element-tag).

Slot: attrs
Initargs

:attrs

Readers

element-attrs.

Writers

(setf element-attrs).

Slot: children
Initargs

:children

Readers

element-children.

Writers

(setf element-children).

Class: user-element
Package

flute.

Source

flute.lisp.

Direct superclasses

element.

Direct methods
Direct slots
Slot: expand-to
Initargs

:expander

Readers

user-element-expander.

Writers

(setf user-element-expander).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   !   %   (  
A   B   C   D   E   F   G   H   I   K   L   M   N   O   P   Q   R   S   T   U   V   W  
Index Entry  Section

!
!expanded-list: Private ordinary functions
!expanded-p: Private ordinary functions

%
%make-attrs: Private ordinary functions

(
(setf !expanded-list): Private ordinary functions
(setf attr): Public generic functions
(setf attr): Public generic functions
(setf attr): Public generic functions
(setf attrs-alist): Public ordinary functions
(setf element-attrs): Public generic functions
(setf element-attrs): Public generic functions
(setf element-children): Public generic functions
(setf element-children): Public generic functions
(setf element-prefix): Private generic functions
(setf element-prefix): Private generic functions
(setf element-tag): Public generic functions
(setf element-tag): Public generic functions
(setf user-element-expander): Private generic functions
(setf user-element-expander): Private generic functions

A
a: Public ordinary functions
abbr: Public ordinary functions
address: Public ordinary functions
alist-plist*: Private ordinary functions
append-inline-attrs: Private ordinary functions
area: Public ordinary functions
article: Public ordinary functions
ascii-html-escape-char-p: Public ordinary functions
aside: Public ordinary functions
attr: Public generic functions
attr: Public generic functions
attr: Public generic functions
attr-value-escape-char-p: Public ordinary functions
attrs-alist: Public ordinary functions
attrs-p: Private ordinary functions
audio: Public ordinary functions

B
b: Public ordinary functions
base: Public ordinary functions
bdi: Public ordinary functions
bdo: Public ordinary functions
blockquote: Public ordinary functions
body: Public ordinary functions
br: Public ordinary functions
button: Public ordinary functions

C
canvas: Public ordinary functions
caption: Public ordinary functions
cite: Public ordinary functions
code: Public ordinary functions
col: Public ordinary functions
colgroup: Public ordinary functions
collect-id-and-class: Private ordinary functions
collect-name-as-keyword: Private ordinary functions
collect-until-dot-or-sharp: Private ordinary functions
copy-!expanded: Private ordinary functions
copy-attrs: Public ordinary functions

D
data: Public ordinary functions
datalist: Public ordinary functions
dd: Public ordinary functions
define-and-export-builtin-elements: Private macros
define-builtin-element: Private macros
define-element: Public macros
del: Public ordinary functions
delete-attr: Public generic functions
delete-attr: Public generic functions
delete-attr: Public generic functions
details: Public ordinary functions
dfn: Public ordinary functions
dialog: Public ordinary functions
div: Public ordinary functions
dl: Public ordinary functions
dt: Public ordinary functions

E
elem-str: Public generic functions
elem-str: Public generic functions
element-attrs: Public generic functions
element-attrs: Public generic functions
element-children: Public generic functions
element-children: Public generic functions
element-prefix: Private generic functions
element-prefix: Private generic functions
element-string: Public generic functions
element-string: Public generic functions
element-tag: Public generic functions
element-tag: Public generic functions
em: Public ordinary functions
embed: Public ordinary functions
escape-attrs-alist: Private ordinary functions
escape-char: Private ordinary functions
escape-children: Private ordinary functions
escape-string: Public ordinary functions

F
fieldset: Public ordinary functions
figcaption: Public ordinary functions
figure: Public ordinary functions
footer: Public ordinary functions
form: Public ordinary functions
Function, !expanded-list: Private ordinary functions
Function, !expanded-p: Private ordinary functions
Function, %make-attrs: Private ordinary functions
Function, (setf !expanded-list): Private ordinary functions
Function, (setf attrs-alist): Public ordinary functions
Function, a: Public ordinary functions
Function, abbr: Public ordinary functions
Function, address: Public ordinary functions
Function, alist-plist*: Private ordinary functions
Function, append-inline-attrs: Private ordinary functions
Function, area: Public ordinary functions
Function, article: Public ordinary functions
Function, ascii-html-escape-char-p: Public ordinary functions
Function, aside: Public ordinary functions
Function, attr-value-escape-char-p: Public ordinary functions
Function, attrs-alist: Public ordinary functions
Function, attrs-p: Private ordinary functions
Function, audio: Public ordinary functions
Function, b: Public ordinary functions
Function, base: Public ordinary functions
Function, bdi: Public ordinary functions
Function, bdo: Public ordinary functions
Function, blockquote: Public ordinary functions
Function, body: Public ordinary functions
Function, br: Public ordinary functions
Function, button: Public ordinary functions
Function, canvas: Public ordinary functions
Function, caption: Public ordinary functions
Function, cite: Public ordinary functions
Function, code: Public ordinary functions
Function, col: Public ordinary functions
Function, colgroup: Public ordinary functions
Function, collect-id-and-class: Private ordinary functions
Function, collect-name-as-keyword: Private ordinary functions
Function, collect-until-dot-or-sharp: Private ordinary functions
Function, copy-!expanded: Private ordinary functions
Function, copy-attrs: Public ordinary functions
Function, data: Public ordinary functions
Function, datalist: Public ordinary functions
Function, dd: Public ordinary functions
Function, del: Public ordinary functions
Function, details: Public ordinary functions
Function, dfn: Public ordinary functions
Function, dialog: Public ordinary functions
Function, div: Public ordinary functions
Function, dl: Public ordinary functions
Function, dt: Public ordinary functions
Function, em: Public ordinary functions
Function, embed: Public ordinary functions
Function, escape-attrs-alist: Private ordinary functions
Function, escape-char: Private ordinary functions
Function, escape-children: Private ordinary functions
Function, escape-string: Public ordinary functions
Function, fieldset: Public ordinary functions
Function, figcaption: Public ordinary functions
Function, figure: Public ordinary functions
Function, footer: Public ordinary functions
Function, form: Public ordinary functions
Function, h1: Public ordinary functions
Function, h2: Public ordinary functions
Function, h3: Public ordinary functions
Function, h4: Public ordinary functions
Function, h5: Public ordinary functions
Function, h6: Public ordinary functions
Function, head: Public ordinary functions
Function, header: Public ordinary functions
Function, hr: Public ordinary functions
Function, html: Public ordinary functions
Function, html-element-p: Private ordinary functions
Function, i: Public ordinary functions
Function, iframe: Public ordinary functions
Function, img: Public ordinary functions
Function, input: Public ordinary functions
Function, ins: Public ordinary functions
Function, kbd: Public ordinary functions
Function, label: Public ordinary functions
Function, legend: Public ordinary functions
Function, li: Public ordinary functions
Function, link: Public ordinary functions
Function, main: Public ordinary functions
Function, make-!expanded: Private ordinary functions
Function, make-attrs: Public ordinary functions
Function, make-builtin-element: Private ordinary functions
Function, make-builtin-element-with-prefix: Private ordinary functions
Function, make-user-element: Private ordinary functions
Function, map: Public ordinary functions
Function, mark: Public ordinary functions
Function, meta: Public ordinary functions
Function, meter: Public ordinary functions
Function, nav: Public ordinary functions
Function, noscript: Public ordinary functions
Function, object: Public ordinary functions
Function, ol: Public ordinary functions
Function, optgroup: Public ordinary functions
Function, option: Public ordinary functions
Function, output: Public ordinary functions
Function, p: Public ordinary functions
Function, param: Public ordinary functions
Function, picture: Public ordinary functions
Function, plist-alist: Private ordinary functions
Function, pre: Public ordinary functions
Function, progress: Public ordinary functions
Function, q: Public ordinary functions
Function, rp: Public ordinary functions
Function, rt: Public ordinary functions
Function, ruby: Public ordinary functions
Function, s: Public ordinary functions
Function, samp: Public ordinary functions
Function, script: Public ordinary functions
Function, section: Public ordinary functions
Function, select: Public ordinary functions
Function, small: Public ordinary functions
Function, source: Public ordinary functions
Function, span: Public ordinary functions
Function, split-attrs-and-children: Private ordinary functions
Function, strong: Public ordinary functions
Function, style: Public ordinary functions
Function, sub: Public ordinary functions
Function, summary: Public ordinary functions
Function, sup: Public ordinary functions
Function, svg: Public ordinary functions
Function, table: Public ordinary functions
Function, tbody: Public ordinary functions
Function, td: Public ordinary functions
Function, template: Public ordinary functions
Function, textarea: Public ordinary functions
Function, tfoot: Public ordinary functions
Function, th: Public ordinary functions
Function, thead: Public ordinary functions
Function, time: Public ordinary functions
Function, title: Public ordinary functions
Function, tr: Public ordinary functions
Function, track: Public ordinary functions
Function, tree-leaves%%: Private ordinary functions
Function, u: Public ordinary functions
Function, ul: Public ordinary functions
Function, utf8-html-escape-char-p: Public ordinary functions
Function, var: Public ordinary functions
Function, video: Public ordinary functions
Function, wbr: Public ordinary functions

G
Generic Function, (setf attr): Public generic functions
Generic Function, (setf element-attrs): Public generic functions
Generic Function, (setf element-children): Public generic functions
Generic Function, (setf element-prefix): Private generic functions
Generic Function, (setf element-tag): Public generic functions
Generic Function, (setf user-element-expander): Private generic functions
Generic Function, attr: Public generic functions
Generic Function, delete-attr: Public generic functions
Generic Function, elem-str: Public generic functions
Generic Function, element-attrs: Public generic functions
Generic Function, element-children: Public generic functions
Generic Function, element-prefix: Private generic functions
Generic Function, element-string: Public generic functions
Generic Function, element-tag: Public generic functions
Generic Function, user-element-expand-to: Public generic functions
Generic Function, user-element-expander: Private generic functions

H
h: Public macros
h1: Public ordinary functions
h2: Public ordinary functions
h3: Public ordinary functions
h4: Public ordinary functions
h5: Public ordinary functions
h6: Public ordinary functions
head: Public ordinary functions
header: Public ordinary functions
hr: Public ordinary functions
html: Public ordinary functions
html-element-p: Private ordinary functions

I
i: Public ordinary functions
iframe: Public ordinary functions
img: Public ordinary functions
input: Public ordinary functions
ins: Public ordinary functions

K
kbd: Public ordinary functions

L
label: Public ordinary functions
legend: Public ordinary functions
li: Public ordinary functions
link: Public ordinary functions

M
Macro, define-and-export-builtin-elements: Private macros
Macro, define-builtin-element: Private macros
Macro, define-element: Public macros
Macro, h: Public macros
Macro, tree-leaves: Private macros
main: Public ordinary functions
make-!expanded: Private ordinary functions
make-attrs: Public ordinary functions
make-builtin-element: Private ordinary functions
make-builtin-element-with-prefix: Private ordinary functions
make-user-element: Private ordinary functions
map: Public ordinary functions
mark: Public ordinary functions
meta: Public ordinary functions
meter: Public ordinary functions
Method, (setf attr): Public generic functions
Method, (setf attr): Public generic functions
Method, (setf element-attrs): Public generic functions
Method, (setf element-children): Public generic functions
Method, (setf element-prefix): Private generic functions
Method, (setf element-tag): Public generic functions
Method, (setf user-element-expander): Private generic functions
Method, attr: Public generic functions
Method, attr: Public generic functions
Method, delete-attr: Public generic functions
Method, delete-attr: Public generic functions
Method, elem-str: Public generic functions
Method, element-attrs: Public generic functions
Method, element-children: Public generic functions
Method, element-prefix: Private generic functions
Method, element-string: Public generic functions
Method, element-tag: Public generic functions
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, user-element-expand-to: Public generic functions
Method, user-element-expander: Private generic functions

N
nav: Public ordinary functions
noscript: Public ordinary functions

O
object: Public ordinary functions
ol: Public ordinary functions
optgroup: Public ordinary functions
option: Public ordinary functions
output: Public ordinary functions

P
p: Public ordinary functions
param: Public ordinary functions
picture: Public ordinary functions
plist-alist: Private ordinary functions
pre: Public ordinary functions
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods
progress: Public ordinary functions

Q
q: Public ordinary functions

R
rp: Public ordinary functions
rt: Public ordinary functions
ruby: Public ordinary functions

S
s: Public ordinary functions
samp: Public ordinary functions
script: Public ordinary functions
section: Public ordinary functions
select: Public ordinary functions
small: Public ordinary functions
source: Public ordinary functions
span: Public ordinary functions
split-attrs-and-children: Private ordinary functions
strong: Public ordinary functions
style: Public ordinary functions
sub: Public ordinary functions
summary: Public ordinary functions
sup: Public ordinary functions
svg: Public ordinary functions

T
table: Public ordinary functions
tbody: Public ordinary functions
td: Public ordinary functions
template: Public ordinary functions
textarea: Public ordinary functions
tfoot: Public ordinary functions
th: Public ordinary functions
thead: Public ordinary functions
time: Public ordinary functions
title: Public ordinary functions
tr: Public ordinary functions
track: Public ordinary functions
tree-leaves: Private macros
tree-leaves%%: Private ordinary functions

U
u: Public ordinary functions
ul: Public ordinary functions
user-element-expand-to: Public generic functions
user-element-expand-to: Public generic functions
user-element-expander: Private generic functions
user-element-expander: Private generic functions
utf8-html-escape-char-p: Public ordinary functions

V
var: Public ordinary functions
video: Public ordinary functions

W
wbr: Public ordinary functions