Directory | Tags | Index | LinkIt | Submit   | Help
    Saturday, 26 July 2014 - anonymous
Login/Register to vote and to have access to more features

You are here: Root > By Topic > Web Development > HTML Macros

View the dependency graph for this library

YHTML-Template
Created by divanov on: Thu, 29 Dec 2011 08:12:37 GMT, Last modification: Mon, 30 Apr 2012 10:03:42 GMT

YHTML-Template is a an extension of Edi Weitz's HTML-TEMPLATE.

eMail
Web sitehttp://lisp.ystok.ru/yhtml/html-template.html
Mailing list
Version0.10.2 -
MaturityStable
OS compatibility
ASDF installableYes
Official Download
Mirrored Download
Source code repository

YHTML-Template is a part of YstokHTML collection. It accepts more "Lispy" expressions and provides the following extensions to the original HTML-TEMPLATE code.

  1. A Lisp form in place of "plane attribute" is allowed. Forms are read by the standard read function. All starting tags (except TMPL_INCLUDE) accept forms instead of "old style" attributes.
    The *attributes-are-lisp-forms* special variable was introduced. Bind or set it to NIL to treating those tags in the compatibility mode.
  2. Symbols follow standard Lisp syntax: a package specifier is allowed in front of the name. By default, symbols are interned into the package stored in *template-package*, a new special variable.
  3. To interpret the forms in run-time, the template-eval was introduced. It is a simple evaluator akin to the standard eval function except for:
    • A limited number of special-forms is supported, namely: IF WHEN UNLESS AND OR NOT QUOTE.
    • The symbol with a name like *var* is treated as a dynamic variable and is retrieved via symbol-value.
    • The values of other symbols are looked up via *value-access-function*.
  4. The TMPL_EVAL tag and create-eval-printer were introduced; the former should be used instead of the TMPL_VAR tag.
  5. The value of *format-non-strings* has got an additional meaning. If it equals to T, the result is produced by means of princ-to-string, i.e. (format nil "~A" ...).
    If it is true but not equals to T, the value must be a single-parameter function, which returns two values:
    (1) a string resulted from its argument, and optionally
    (2) do-not-modify flag controlling whether *string-modifier* is applied afterwards.
    The truth as second value can prevent the result of converting from predefined format, e.g. LHTML, from further escaping.
  6. Tag TMPL_ELSE and all ending tags /TMPL_... can embed an optional text between the tag name and the closing marker "-->". This text is intended for readability only and completely ignored by the template parser. For example:
  7. The TMPL_ELIF tag was introduced to allow a more concise code. In full, now the "if" pattern looks like:
    <!-- TMPL_IF condition_1 -->
    text_1
    <!-- TMPL_ELIF condition_2 -->
    text_2
     ...
    <!-- TMPL_ELSE -->
    text_else
    <!-- /TMPL_IF -->
    

Compatible Implementations

LispWorks

Authors and Maintainers

Dmitriy Ivanov

Tags

HTML Macros | LLGPL

0 Notes and 0 comments

0 Notes

You must be logged to add a note


0 Comments

You must be logged to add a comment