Common Lisp Package: MUSTACHE

README:

FUNCTION

Public

MUSTACHE-CONTEXT (&KEY DATA PARTIALS)

Create mustache context from alist DATA.

MUSTACHE-RENDER-TO-STREAM (STREAM TEMPLATE &OPTIONAL CONTEXT)

Render TEMPLATE with optional CONTEXT to STREAM.

MUSTACHE-RENDER-TO-STRING (TEMPLATE &OPTIONAL CONTEXT)

Render TEMPLATE with optional CONTEXT to string.

MUSTACHE-TYPE

Return the implemented mustache spec version.

MUSTACHE-VERSION

Return the CL-MUSTACHE version.

Private

ALISTP (LIST)

Poor man's alistp

CHANGE-DELIMITER (TEXT)

Change the mustache tag delimiter according to TEXT. The syntax grammar is: delimiter-tag = left-d 1*space right-d left-d = *ALPHANUM right-d = *ALPHANUM space = #\Space #\Tab

ENSURE-CONTEXT (MAYBE-CONTEXT)

Ensure MAYBE-CONTEXT is a valid context. If not then make one.

Undocumented

COLLECT-LINE (TOKENS)

ESCAPE (STRING)

ESCAPE-CHAR (CHAR)

FOLD-TEXT (TOKENS)

GET-MUSTACHE-CHARACTER (CHAR)

GROUP-SECTIONS (TOKENS &OPTIONAL SECTIONS ACC)

KEY (TOKEN)

LOCATE-FILE (FILENAME)

MAKE-CONTEXT (&OPTIONAL DATA CONTEXT)

MAKE-SECTION-TAG (START-TAG END-TAG TOKENS)

MAKE-STANDALONE-TAG (TOKENS)

MAKE-TAG (&KEY RAW-TEXT ESCAPEP START END)

NEWLINE-CHAR-P (CHAR)

NEWLINEP (TOKEN)

PARSE (TEMPLATE)

PARSE-KEY (STRING)

POP-GROUP (ACC)

PUSH-GROUP (ACC)

PUSH-SECTION-TAG (START-TAG END-TAG ACC)

PUSH-TOKEN (TOKEN ACC)

READ-NEWLINE (STRING &OPTIONAL (START 0))

READ-PARTIAL (FILENAME &OPTIONAL CONTEXT)

READ-TAG (STRING &OPTIONAL TRIPLE (START 0) (END (LENGTH STRING)))

READ-TEXT (TYPE STRING &OPTIONAL (START 0) (END (LENGTH STRING)))

READ-TOKEN (STRING &OPTIONAL (START 0) (END (LENGTH STRING)))

RENDER-BODY (TOKENS CONTEXT TEMPLATE)

RENDER-TOKENS (TOKENS CONTEXT TEMPLATE)

SAVE-HASH-TABLE (SOURCE)

SCAN (STRING &OPTIONAL (START 0) (END (LENGTH STRING)))

SET-MUSTACHE-CHARACTER (CHAR NEW-FUNCTION)

SPACE-CHAR-P (CHAR)

STANDALONE-P (TOKENS)

STRING-MATCH (PATTERN STRING &OPTIONAL (START 0))

TAG-MATCH (TAG1 TAG2)

TAGP (TOKEN)

TEXT-CHAR-P (CHAR)

TEXTP (TOKEN)

TOP-GROUP (ACC)

TRIM-STANDALONE (TOKENS)

MACRO

Public

DEFMUSTACHE (NAME TEMPLATE)

Define a named renderer of string TEMPLATE.

Private

Undocumented

DEFINE-MUSTACHE-CHARACTER (CHAR &BODY BODY)

GENERIC-FUNCTION

Public

MUSTACHE-COMPILE (TEMPLATE)

Return a compiled rendering function.

MUSTACHE-RENDER (TEMPLATE &OPTIONAL CONTEXT)

Render TEMPLATE with optional CONTEXT to *mustache-output*

Private

CONTEXT-GET (KEY CONTEXT)

Get data from CONTEXT by KEY.

Undocumented

CALL-LAMBDA (LAMBDA TEXT &OPTIONAL CONTEXT)

RENDER-TOKEN (TOKEN CONTEXT TEMPLATE)

SLOT-ACCESSOR

Private

Undocumented

CLOSE-DELIMITER (OBJECT)

SETFCLOSE-DELIMITER (NEW-VALUE OBJECT)

DATA (OBJECT)

SETFDATA (NEW-VALUE OBJECT)

END (OBJECT)

SETFEND (NEW-VALUE OBJECT)

ESCAPEP (OBJECT)

FALSEY (OBJECT)

SETFFALSEY (NEW-VALUE OBJECT)

INDENT (OBJECT)

SETFINDENT (NEW-VALUE OBJECT)

NEXT (OBJECT)

SETFNEXT (NEW-VALUE OBJECT)

OPEN-DELIMITER (OBJECT)

SETFOPEN-DELIMITER (NEW-VALUE OBJECT)

PARTIALS (OBJECT)

SETFPARTIALS (NEW-VALUE OBJECT)

STANDALONE (OBJECT)

SETFSTANDALONE (NEW-VALUE OBJECT)

START (OBJECT)

SETFSTART (NEW-VALUE OBJECT)

TEXT (OBJECT)

SETFTEXT (NEW-VALUE OBJECT)

TOKENS (OBJECT)

SETFTOKENS (NEW-VALUE OBJECT)

TRAIL (OBJECT)

SETFTRAIL (NEW-VALUE OBJECT)

VARIABLE

Public

*DEFAULT-PATHNAME-TYPE*

The default file extension for partials.

*LOAD-PATH*

A list. The search pathes for partials.

*MUSTACHE-OUTPUT*

The default output stream for mustache rendering. Bind this variable before calling mustache-rendering and friends. Default is *standard-output*.

Private

Undocumented

*CHAR-TO-ESCAPES*

*CLOSE-DELIMITER*

*DEFAULT-CLOSE-DELIMITER*

*DEFAULT-OPEN-DELIMITER*

*DEFAULT-TRIPLE-CLOSE-DELIMITER*

*DEFAULT-TRIPLE-OPEN-DELIMITER*

*MUSTACHE-TAG-TABLE*

*OPEN-DELIMITER*

*TRIPLE-CLOSE-DELIMITER*

*TRIPLE-OPEN-DELIMITER*

BEGINNING-OF-LINE

CRLF

CRLF-NEWLINE

NEWLINE

CLASS

Private

Undocumented

AMPERSAND-TAG

BEGINNING-OF-LINE

CAN-STANDALONE-TAG

COMMENT-TAG

CONTEXT

CRLF-NEWLINE

DELIMITER-TAG

IMPLICIT-ITERATOR-TAG

NEWLINE

NON-STANDALONE-TAG

NORMAL-TAG

PARTIAL-TAG

SECTION-END-TAG

SECTION-START-TAG

SECTION-TAG

TAG

TEXT (OBJECT)

TOKEN

WHITESPACE