Common Lisp Package: GTFL

README:

FUNCTION

Public

DEFINE-CSS (ID CSS)

adds css code fragments to the client page

DRAW-NODE-WITH-CHILDREN (NODE CHILDREN &KEY (RIGHT-TO-LEFT NIL) (COLOR #888) (WIDTH 10px) (LINE-WIDTH 1px) (STYLE solid))

A function for recursively drawing trees in html. It draws a node with connections to it's children (which can be trees themselves). See example below.

HTML-PPRINT (THING &KEY MAX-WIDTH)

Creates html code for displaying an x-expression in the web browser. The result lookes like coming from pprint (proper indention), but the layout is dynamic depending on the available width.

MAKE-EXPANDABLE/COLLAPSABLE-ELEMENT (ELEMENT-ID EXPAND/COLLAPSE-ALL-ID COLLAPSED-ELEMENT EXPANDED-ELEMENT &KEY (EXPAND-INITIALLY NIL))

Creates an element with an expanded and a collapsed version.

MAKE-ID-STRING (&OPTIONAL (BASE id))

Creates an uniquely numbered id string

RESET-GTFL

Clears the content area of the client page and resets things

Undocumented

DEFINE-JS (ID JS)

START-GTFL

Private

EXPAND-OR-COLLAPSE-ALL (ID EXPAND?-STRING)

Called from the html page to expand/collapse a set of elements

EXPAND-OR-COLLAPSE-NODE (ID EXPAND?-STRING)

Called from the html page to expand/collapse a single element

EXPAND-OR-COLLAPSE-NODE-AUX (ID EXPAND?)

A helper function that sends the correct version of an element to the browser

GET-COLOR-FOR-SYMBOL (SYMBOL-NAME)

Returns for the same symbols the same color

RESET-EXPANDABLE/COLLAPSABLE-ELEMENTS

resets the hash tables

Undocumented

CLIENT-PAGE (&KEY)

EXPANDABLE-ELEMENTS-EXAMPLE

GET-REQUESTS

HTML-PPRINT-AUX (THING &OPTIONAL (APPEND ))

HTML-PPRINT-EXAMPLE

RESET

RESET-HTML-PPRINT

RESET-REQUESTS

TREE-DRAWING-EXAMPLE

MACRO

Public

APPEND-TO-ELEMENT (ID &REST HTML-EXPRESSIONS)

appends expressions to the element with id (a string)

GTFL-OUT (&REST EXPRESSIONS)

Adds some content to the bottom of the client page. expressions can be anything that is ok in cl-who's with-html-output macro.

REPLACE-ELEMENT-CONTENT (ID &REST EXPRESSIONS)

replaces the content of the element with id (a string) by expressions

WHO (&REST EXPRESSIONS)

shortcut for with-html-output

WHO-LAMBDA (&REST EXPRESSIONS)

makes an anonymous function that generates cl-who output for expression

WHO2S (&REST EXPRESSIONS)

shortcut for with-html-output-to-string

VARIABLE

Public

*CREATE-STATIC-EXPANDABLE/COLLAPSABLE-ELEMENTS*

When this is set to t, both the expanded and collapsed version will be embedded in the html code (one visible and the other hidden). This makes the html code bigger (and thus rendering slower), but allows to save generated html pages, with the expand/collapse functionality still working when not connected to the web server.

*RESET-FUNCTIONS*

a list of functions that are called whenever gtfl is reset, i.e. when the 'reset' button is clicked or when (reset-gtfl) is called. For resetting own stuff in these cases add your reset-function here, for example (pushnew #'my-reset-function *reset-functions*)

Undocumented

*GTFL-ADDRESS*

*GTFL-PORT*

Private

*COLORS*

colors for highlighing symbols

*EXPAND/COLLAPSE-ALL-IDS*

contains for each expand/collapse-all id the ids of all group elements.

*EXPANDABLE/COLLAPSABLE-ELEMENTS*

contains for each element id a list (collapsed-element expanded-element)

*SYMBOL-NAME->COLOR*

makes sure that all instances of the same symbol get the same background color

Undocumented

*AJAX-PROCESSOR*

*CSS-DEFINITIONS*

*GTFL-SERVER*

*JS-DEFINITIONS*

*NID-TABLE*

*REQUESTS*