Dmitriy Ivanov | 28 Dec 10:27
Picon

HTML_EVAL and other add-ons - new version available

Hello folks,

I have reported about my first attempts to augment HTML-TEMPLATE about three
years ago. Please take a look at http://lisp.ystok.ru/yhtml/html-template.html

There are too many changes now and I hardly believe they can be considered
as patches but rather a branch.

Moreover, I am not using the documentation tool used by Edi. So I could only
augment the HTML documentation file "by hands".

Is there any chance to integrate my version into mainstream repository?
Any hints or suggestions are welcome.

The main differences are below.

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
(Continue reading)

Edi Weitz | 31 Aug 17:11
Picon
Favicon

My open source libraries (aka "ediware")

[My apologies if you receive multiple copies of this email.]

Hi everybody!

As some of you will know, I'll start on a new job tomorrow.  This new
job won't involve much hacking, if at all, and thus it doesn't look
like I'll have a lot of time to maintain my open source libraries in
the near future.  I have no plans to suddenly disappear from the CL
world, but don't expect new releases of any of my libs any time soon.
(At least none published by me or on my server.)

Luckily, Hans Hübner - who already did most of the maintenance and
development work for Hunchentoot in the last two years or so - offered
to coordinate further development via github.  See his full
announcement at
<http://netzhansa.blogspot.com/2011/08/ediware-moving-to-github.html>.

I'll continue to read the mailing lists for my libs and I'm still
interested in fixing bugs you might find in the release tarballs
available on my web server.  However, I will likely not bother to
discuss or work on new features or compatibility code for
implementations other than LispWorks (which happens to be the one I'm
using).

Lastly, I hope to see a lot of you in Amsterdam
<http://weitz.de/eclm2011/> in October.  The number of registrations
so far has been pretty disappointing, but you still have three weeks
left to change your mind... :)

Take care,
(Continue reading)

Dmitriy Ivanov | 28 Apr 19:41
Picon

HTML_EVAL addition - "lispy" extension of tag attribute syntax

Hello folks,

This addition has been inspired by the suggestion of Andrew Golding posted
more than one year and a half ago.

Summary
-----------
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.
To force reading those tags in "compatibility" mode, set
*attributes-are-lisp-forms*, a new special variable, to NIL.

2. Symbols follow standard Lisp syntax: a package specifier is allowed
in front of the name. By default, symbols are interned into the
package *template-package*, a new special variable.
(Shall we reuse the same *template-symbol-package* instead?)

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.
(Continue reading)

Dmitriy Ivanov | 15 Apr 15:29
Picon

More power of *format-non-strings*

Hello folks,

I suggest making *format-non-strings* more meaningful and differentiating
among true values.

It the value of  *format-non-strings* equals to T, it uses
   (format nil "~A" ...).

Otherwise it must be a function of one argument converting the variable
value to a string.
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru

Sohail Somani | 21 Nov 07:43
Gravatar

Easier way to fill tmpl_var environment?

Hi,

First of all, thank you for a nice library.

Now, I have a question. Is there a way to have html-template call back 
into the calling environment so I don't have to pass all slot values of a 
list of objects in as a list?

So instead of:

;;; prints "b c"
(fill-and-print-template "<!-- tmpl_loop ... -->" 
   (list :a (list :b "b" :c "c")))

I can do something like:

;;; prints "b c"
(fill-and-print-template 
  "<!-- tmpl_callback (b-of a) --> <!-- tmpl_callback (c-of a) -->"
  (list :a a))

Where b-of and c-of are readers. It is just very very tedious to make 
lists of all the values.

Does that make any sense?

Thanks for your time.

--

-- 
Sohail Somani
(Continue reading)

Chaitanya Gupta | 14 Nov 20:01
Gravatar

Is this behaviour for SKIP-LEADING-WHITESPACE correct?

Hello,

I have come across a situation where SKIP-LEADING-WHITESPACE
(HTML-TEMPLATE's internal function) throws an error while trying to
create a template printer. I have narrowed it down to the following -

CL-USER> (let ((html-template:*ignore-empty-lines* t))
           (html-template::skip-leading-whitespace
            (make-array 4 :element-type 'character :fill-pointer 0)))

This throws an error. Here's the debugger output -

Index(s) to array function is/are out of the range of the array.
   [Condition of type TYPE-ERROR]

Restarts:
  0: [ABORT-REQUEST] Abort handling SLIME request.
  1: [ABORT] Abort entirely from this (lisp) process.

Backtrace:
  0: (SWANK::DEBUG-IN-EMACS #<TYPE-ERROR @ #x1143b6d2>)
  1: (SWANK:SWANK-DEBUGGER-HOOK #<TYPE-ERROR @ #x1143b6d2> #<Function
SWANK-DEBUGGER-HOOK>)
  2: (ERROR TYPE-ERROR :DATUM NIL :EXPECTED-TYPE FIXNUM :FORMAT-CONTROL
"Index(s) to array function is/are out of the range of the array."
:FORMAT-ARGUMENTS (NIL))
  3: (HTML-TEMPLATE::SKIP-LEADING-WHITESPACE "")
  4: (LET ((HTML-TEMPLATE:*IGNORE-EMPTY-LINES* T))
(HTML-TEMPLATE::SKIP-LEADING-WHITESPACE (MAKE-ARRAY 4 :ELEMENT-TYPE
(QUOTE CHARACTER) :FILL-POINTER 0)))
(Continue reading)

Dimitre Liotev | 18 May 16:01

problem with UTF characters in template


Hi,

when I have UTF characters in a template I get this error:

#\? is not a LATIN-1 character.
   [Condition of type FLEXI-STREAMS:FLEXI-STREAM-ENCODING-ERROR]

Is there a way to fix this?

I use Allegro CL Express on Windows. 

--

-- 
Dimitre Liotev
Edi Weitz | 19 Apr 13:38
Picon
Favicon

Re: HTML-TEMPLATE

Hi Niek,

On Thu, 19 Apr 2007 13:15:09 +0200, Niek <nieka <at> dsv.nl> wrote:

[Please use the mailing list.  See Cc.]

> Looking at your HTML::Template port to Common Lisp, have you ever
> considered porting http://template-toolkit.org/ ?

No, that is definitely something I don't want to do.  But there are
similar things for Common Lisp AFAIK.

Cheers,
Edi.
Chaitanya Gupta | 28 Mar 12:56
Gravatar

TMPL_INCLUDE and *default-template-pathname*

Hello,

I have noticed some strange behaviour while using TMPL_INCLUDE tags when 
*default-template-pathname* is set to some relative path. I am not sure 
whether its a bug or not, but it sure doesn't work as I expect it to -

Let's start with a some directory -

CL-USER(5): *default-pathname-defaults*
#P"/Users/chaitanya/lisp/"

Now I define a string with the TMPL_INCLUDE tag.

CL-USER(7): (setf *tmpl-string* "before test || <!-- TMPL_INCLUDE 
'temp/test-template' --> || after test")
"before test || <!-- TMPL_INCLUDE 'temp/test-template' --> || after test"

Calling fill-and-print-template works fine here.

CL-USER(8): (html-template:fill-and-print-template *tmpl-string* nil)
before test || Just a test template -  || after test

The value of *default-template-pathname* currently is

CL-USER(11): html-template:*default-template-pathname*
#P""

Now we will change it to #p"temp/"

CL-USER(12): (setf html-template:*default-template-pathname* #p"temp/")
(Continue reading)

Igor Plekhov | 1 Mar 13:15
Picon

external format in an included template printer

Function #'create-template-printer has :external-format key
parameter which is used when opening a file with a template
to be filled.

But if that file <tmpl_include>s some other file, than
:external-format supplied is not used when opening the second
file as it should be.

In #'create-template-printer-aux function #'create-template-printer
function is called with an included file only.  May be it is worth
to make a special variable like *hunchentoot-default-external-format*
for default value of :external-format parameter for
#'create-template-printer function.

In SBCL special variable sb-impl::*default-external-format* can be
binded to an external-format required as a workaround.

--
Registered Linux User #124759
Edi Weitz | 22 Feb 19:09
Picon
Favicon

Darcs repositories

[My apologies if you get this more than once.]

Several people have asked for Darcs repositories of my software.
These do exists now:

  http://common-lisp.net/~loliveira/ediware/

Special thanks to Luís Oliveira who made this possible and who
maintains the repositories.

Cheers,
Edi.
_______________________________________________
cl-interpol-devel site list
cl-interpol-devel <at> common-lisp.net
http://common-lisp.net/mailman/listinfo/cl-interpol-devel


Gmane