Common Lisp Package: DJULA

README:

FUNCTION

Public

FETCH-TEMPLATE* (KEY)

Return the text of a template fetched from the *CURRENT-STORE*.

URL-DECODE (STRING)

Decodes a URL-encoded STRING which is assumed to be encoded using the external format EXTERNAL-FORMAT.

URL-ENCODE (STRING)

URL-encodes a string using the external format EXTERNAL-FORMAT.

Undocumented

COMPILE-TEMPLATE (PATH)

COMPILE-TEMPLATE-STRING (STRING)

FIND-TEMPLATE* (NAME)

URL-ENCODE-PATH (PATH)

Private

COMPILE-LOGICAL-STATEMENT (STATEMENT)

takes a "logical statement" like you would give {% if %} that has been parsed into a list of keywords [eg: '(:not :foo) or '(:foo :and :baz) or `(:foo.bar :or :list.1)] and turns them into a thunk predicate for dispatching the conditional branching of the {% if %} tag. when called, the function returns two values: 1. the value returned by resolving the phrase 2. an error message string if something went wrong [ie, an invalid variable]. [note: if return value 2 is present, then its probably not safe to consider return value 1 useful]

ESCAPE-FOR-HTML (STRING)

Escapes the characters #\<, #\>, #\', #\", and #\& for HTML output.

FIND-END-TAG (TAG-NAME TOKENS)

returns NIL if a :TAG token with the name `TAG-NAME' can't be found in `TOKENS'. Otherwise returns three values: 1. a list of all the tokens up to that token 2. a list of all tokens after that token 3. T, indicating that `TAG-NAME' was found

GET-VARIABLE (NAME)

takes a variable `NAME' and returns: 1. the value of `NAME' 2. any error string generated by the lookup (if there is an error string then the lookup was unsuccessful)

RESOLVE-VARIABLE-PHRASE (LIST)

takes a list starting wise a variable and ending with 0 or more keys or indexes [this is a direct translation from the dot (.) syntax] and returns two values: 1. the result [looking up the var and applying index/keys] 2. an error string if something went wrond [note: if there is an error string then the result probably shouldn't be considered useful.

SPLIT-IF-CLAUSE (CLAUSE-TOKENS)

returns two values: 1. all clause tokens that appear _before_ the first :ELSE token 2. all clause tokens that appear _after_ the first :ELSE token

Undocumented

.CHECK-EXAMPLE-TABLE-PLIST (EXAMPLE-TABLE-PLIST)

.COMPILE-TEMPLATE-STRING (STRING)

APPLY-FILTERS (STRING FILTERS)

APPLY-KEYS/INDEXES (THING KEYS/INDEXES)

COMPILE-TOKEN (TOKEN)

GET-CLOSING-DELIMITER (TYPE)

PARSE-FILTER-STRING (STRING)

PARSE-REST-OF-TAG (STRING START)

PARSE-TEMPLATE-STRING (STRING)

PARSE-VARIABLE-CLAUSE (UNPARSED-STRING)

PARSE-VARIABLE-PHRASE (STRING)

PROCESS-IFEQUAL-ARGS (UNPARSED-STRING)

PROCESS-TOKEN (TOKEN REST-TOKEN-LIST)

PROCESS-TOKENS (TOKENS)

SEMI-PARSE-TAG (STRING)

SLURP (PATHNAME)

SPLIT-TEMPLATE-STRING (STRING START)

TEMPLATE-ERROR (MSG &REST ARGS)

TEMPLATE-ERROR-STRING (FMT &REST ARGS)

MACRO

Public

Undocumented

DEF-TAG-COMPILER (NAME ARGS &BODY BODY)

Private

ACOND (&REST CLAUSES)

Just like cond-bind except the var is automatically IT.

AIF (TEST THEN &OPTIONAL ELSE)

Just like IF-BIND but the var is always IT.

WITH-FILE-HANDLER ((STRING-VAR TEMPLATE-PATH) &BODY BODY)

evaluates `BODY' with `STRING-VAR' bound to a string representing the contents of the file pointed to be the template-path `TEMPLATE-PATH', returning it's results. if there is an error while binding `STRING-VAR' and *CATCH-TEMPLATE-ERRORS-P* is T then it returns a function that is suitable output for the body of a DEF-TOKEN-COMPILER form that returns some debugging info.

Undocumented

AAND (&REST FORMS)

DEF-DELIMITED-TAG (STARTTAG ENDTAG DELIMITED-NAME)

DEF-FILTER (NAME ARGS &BODY BODY)

DEF-TAG-PROCESSOR (NAME ARGS REST-VAR &BODY BODY)

DEF-TOKEN-COMPILER (NAME ARGS &BODY BODY)

DEF-TOKEN-PROCESSOR (NAME ARGS REST-VAR &BODY BODY)

DEF-UNPARSED-TAG-PROCESSOR (NAME ARGS REST-VAR &BODY BODY)

WITH-TEMPLATE-ERROR (RECOVERY-FORM &BODY BODY)

GENERIC-FUNCTION

Public

FETCH-TEMPLATE (STORE KEY)

Return the text of the template identified by the given key.

FIND-TEMPLATE (STORE NAME)

Return a hashable key that uniquely identifies the named template.

Private

Undocumented

TEMPLATE-ERROR-MESSOGE (CONDITION)

VARIABLE

Public

*CURRENT-STORE*

The currently in-use template store. Defaults to a FILE-STORE.

Undocumented

*ALLOW-INCLUDE-ROOTS*

*CATCH-TEMPLATE-ERRORS-P*

*CURRENT-LANGUAGE*

*DEFAULT-LANGUAGE*

*TEMPLATE-STRING-IF-INVALID*

*USE-EXAMPLE-VALUES-P*

Private

Undocumented

*ACCUMULATED-JAVASCRIPT-STRINGS*

*BLOCK-ALIST*

*EVAL-LISP-TAGS*

*EXAMPLE-TABLE-REGEXPS*

*TRANSLATION-TABLE-REGEXPS*

CLASS

Public

FILE-STORE

Searches for template files on disk according to the given search path.

CONDITION

Private

Undocumented

TEMPLATE-ERROR (MSG &REST ARGS)