[Bese-devel] [patch] Add plain HTML generation

Aankhen aankhen at gmail.com
Tue Feb 3 15:17:49 UTC 2009


[Sent directly to Drew by mistake.]

Hi Drew,

On Fri, Jan 30, 2009 at 00:19, Drew Crampsie <drewc at tech.coop> wrote:
> This is a good idea, but the execution (run time parameter checks) is
> not at all right.. it should be done at compile time.
>
> I'll accept the patch if you want to rework it so that the logic is
> all finished by run-time, but i can't possibly keep it like this ..
> there is no need to do the work every time a page is rendered :).

The reasoning behind it was that otherwise it becomes a nightmare to
maintain two seperate versions of everything in the case where one
Lisp image needs to generate both HTML and XHTML (or both HTML and any
XML format, for that matter).  This might happen if you run an
HTML-based site and an XHTML-based site in the same image; if you use
content negotiation to serve up XHTML to capable browsers, HTML to
others; if you use HTML everywhere on your site except in those cases
where you need to use XHTML features (e.g. specific pages with
embedded MathML or SVG); if you use YACLML to generate static HTML as
well as static XHTML; or if, indeed, you have a completely HTML-based
site and you generate any sort of XML output (RSS, Atom come to mind).

If the decision is made at compile-time as to which version to
generate, then each time you make a change to your template, you need
to first recompile every file under yaclml/src/tags/, then recompile
your own template, since the decision is made when you compile those
files rather than your template.

Given all that, I agree with you that unconditionally doing everything
at run-time isn't really such a good idea.  What I have right now is
pure static compilation.  My suggestion (which I'm working on) is to
have another variable *YACLML-STATIC-COMPILATION-P* which controls
whether to use static or dynamic compilation. (Perhaps "compilation"
is the wrong word?) The default value would be T, i.e. no change.  If
set to NIL, however, it would do what my earlier patch did.  I'd be
happy to put this together if it would be acceptable to you.

At any rate, here's a clean patch incorporating the changes you requested.

Aankhen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: yaclml-plain-html.patch
Type: application/octet-stream
Size: 8373 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/bese-devel/attachments/20090203/53fe7c3f/attachment.obj>


More information about the bese-devel mailing list