html-template

API Reference

html-template

HTML-TEMPLATE

  • Variable *TEMPLATE-START-MARKER*
    "<!--"
    The string template tags must start with
  • Variable *TEMPLATE-END-MARKER*
    "-->"
    The string template tags must end with
  • Variable *DEFAULT-TEMPLATE-PATHNAME*
    (make-pathname)
    Each pathname is merged with this value before it is used by CREATE-TEMPLATE-PRINTER.
  • Variable *DEFAULT-TEMPLATE-OUTPUT*
    *standard-output*
    The output stream used by FILL-AND-PRINT-TEMPLATE when no STREAM keyword was provided.
  • Variable *CONVERT-NIL-TO-EMPTY-STRING*
    t
    Controls whether NIL values should resolve to empty strings or raise an error.
  • Variable *FORMAT-NON-STRINGS*
    t
    Controls whether TMPL_VAR will accept values which aren't strings and convert them using (FORMAT NIL "~A" ...).
  • Variable *SEQUENCES-ARE-LISTS*
    t
    Controls whether TMPL_LOOP printers expect lists or vectors.
  • Variable *UPCASE-ATTRIBUTE-STRINGS*
    t
    Controls whether attribute strings associated with template tags are upcased before they are interned.
  • Variable *NO-CACHE-CHECK*
    nil
    Controls whether the FILE-WRITE-DATE check will be circumvented when using FILL-AND-PRINT-TEMPLATE.
  • Variable *TEMPLATE-SYMBOL-PACKAGE*
    (find-package '#:keyword)
    The package symbols are interned into.
  • Variable *IGNORE-EMPTY-LINES*
    nil
    Controls whether template tags on their own lines produce empty lines or not.
  • Variable *WARN-ON-CREATION*
    t
    Controls whether a warning should be signaled if a new template printer is created from a pathname argument.
  • Variable *VALUE-ACCESS-FUNCTION*
    (lambda (symbol values &optional html-template::in-loop-p)
      (let ((html-template::result (getf values symbol)))
        (cond
         ((and html-template::in-loop-p html-template:*sequences-are-lists*)
          (loop html-template::for html-template::element html-template::in html-template::result
                when (and html-template::element (listp html-template::element))
                html-template::collect (append html-template::element
                                               values) html-template::else
                html-template::collect html-template::element))
         (t html-template::result))))
    The function which associates (attribute) symbols with their values.
  • Variable *CALL-TEMPLATE-ACCESS-FUNCTION*
    #'car
    Accessor function for extracting the called template from a TMPL_CALL form.
  • Variable *FORCE-DEFAULT*
    nil
    The default value for the FORCE keyword argument to CREATE-TEMPLATE-PRINTER.
  • Variable *STRING-MODIFIER*
    'html-template:escape-string-iso-8859-1
    The function which is applied to strings which replace TMPL_VAR tags. Use #'CL:IDENTITY if you don't want to change the strings.
  • Variable *ESCAPE-CHAR-P*
    #'(lambda (char) (or (find char "<>&'\"") (> (char-code char) 127)))
    Used by ESCAPE-STRING to test whether a character should be escaped.
  • Condition TEMPLATE-ERROR  (SIMPLE-ERROR)
    All errors signaled by HTML-TEMPLATE are of this type.
  • Condition TEMPLATE-INVOCATION-ERROR  (TEMPLATE-ERROR)
    Signaled when HTML-TEMPLATE functions are invoked with wrong arguments.
  • Condition TEMPLATE-MISSING-VALUE-ERROR  (TEMPLATE-ERROR)
    Signaled when a TMPL_VAR printer is provided with a NIL value and *CONVERT-NIL-TO-EMPTY-STRING* is false.
  • Condition TEMPLATE-NOT-A-STRING-ERROR  (TEMPLATE-ERROR)
    Signaled when a TMPL_VAR printer is provided with a non-string value.
  • Condition TEMPLATE-SYNTAX-ERROR  (TEMPLATE-ERROR)
    Signaled when a syntax error occurs while parsing a template.
  • Function ESCAPE-STRING (string &key (test *escape-char-p*))
  • Function ESCAPE-STRING-MINIMAL (string)
    Escape only #<, #>, and #& in STRING.
  • Function ESCAPE-STRING-MINIMAL-PLUS-QUOTES (string)
    Like ESCAPE-STRING-MINIMAL but also escapes quotes.
  • Function ESCAPE-STRING-ISO-8859-1 (string)
    Escapes all characters in STRING which aren't defined in ISO-8859-1.
  • Function ESCAPE-STRING-ALL (string)
    Escapes all characters in STRING which aren't in the 7-bit ASCII character set.
  • Generic-Function CREATE-TEMPLATE-PRINTER (template &key force element-type if-does-not-exist external-format)
    Creates a template printer from TEMPLATE which is an open input stream, a string, or a pathname. If FORCE is true a printer will be newly created no matter what the state of the cache is. If FORCE is :DO-NOT-CACHE the newly created printer won't be cached. Other keyword arguments will be given to WITH-OPEN-FILE. Keyword arguments will only be accepted if TEMPLATE is a PATHNAME.
  • Method CREATE-TEMPLATE-PRINTER ((input-stream stream) &rest rest)
  • Method CREATE-TEMPLATE-PRINTER ((string string) &rest rest)
  • Method CREATE-TEMPLATE-PRINTER ((pathname pathname) &key (force *force-default*) (element-type 'character) (if-does-not-exist :error) (external-format *external-format*))
  • Generic-Function FILL-AND-PRINT-TEMPLATE (template/printer values &key stream &allow-other-keys)
    Fills the template denoted by TEMPLATE/PRINTER with VALUES and print it to STREAM. If TEMPLATE/PRINTER is a function uses it as if it were a template printer, otherwise creates a printer (or pull one out of the cache) with CREATE-TEMPLATE-PRINTER. Optional keyword arguments are given to CREATE-TEMPLATE printer and can only be used if TEMPLATE/PRINTER is a pathname.
  • Method FILL-AND-PRINT-TEMPLATE ((function function) values &rest rest &key (stream *default-template-output*))
  • Method FILL-AND-PRINT-TEMPLATE ((string string) values &rest rest &key (stream *default-template-output*))
  • Method FILL-AND-PRINT-TEMPLATE ((input-stream stream) values &rest rest &key (stream *default-template-output*))
  • Method FILL-AND-PRINT-TEMPLATE ((pathname pathname) values &rest rest &key (stream *default-template-output*))
  • Function CLEAR-TEMPLATE-CACHE
    Complete clears all template printers from the cache.
  • Function DELETE-FROM-TEMPLATE-CACHE (pathname)
    Deletes the template printer denoted by PATHNAME from the cache. Returns true if such a printer existed, false otherwise.