A view defined by defview must return or an instance of class , which has two subclasses:
is for views defined by Lisp code using the CLOG API. This is the most flexible form of view, but also the most laborious to write. For an example, see .
is for views defined in terms of HTML code plus an ALIST mapping HTML ids to Lisp objects. The ALIST is used to define clickable references inside a view, in particular links to other objects to be inspected, action buttons, and eval buttons.
Since HTML + ALIST is the most common type of view, there is an extensive support library for writing them, which is best explored by looking at view definitions by alt-clicking. This support code uses the cl-who library for producing HTML code, so it's recommended to read its manual.
You can insert a view into another view, a process known as transclusion. As a simple example, here is a transcluded view showing the items of the list :
Transclusion is particularly useful for inserting the source code of classes or functions in the system. For example, this is the source code for the function transclusion:
The title bar of an inspector pane consists of two single-line HTML views, constructed by methods of two generic functions:
constructs the left-hand part, containing by default the class and the object's textual representation.
constructs the right-hand part, placed right before the refresh/maximize/close buttons, which is empty by default. It is meant to be used only for placing action buttons into the title bar.
There are very few specializers for html-inspector-views:title-bar because most often it is only the textual representation that needs to be customized. It is constructed by the generic function html-inspector-views:title-bar-representation, which by default simply calls html-inspector-views:html-representation, the generic function that is also used by several HTML views, e.g. to show an object as an item of a list or a vector. Its default implementation calls html-inspector-views:text-representation, which returns a plain-text representation of an object. In most cases, specializing this function is sufficient. Check out its "Methods" view to see examples!