[albatross-users] Two questions (client-side production of static pages)

Dave Kuhlman dkuhlman at cutter.rexx.com
Fri Jun 28 07:11:07 EST 2002


On Thu, Jun 27, 2002 at 04:25:13PM +0100, Andy Gimblett wrote:
> Hi there,
> 
> First, let me say I've been using Albatross for a little while now to
> power my weblog (http://gimbo.org.uk/) and I really like it: it
> certainly seems to achieve the stated aim of staying "out of the way"
> and letting me get on with what I want to do in a reasonably obvious
> manner.
> 
> I'm (currently) only using Albatross on the client-side.
> Specifically, I'm using its templating capabilities to build static
> pages which then get uploaded to my ISP's web server.  There are a
> couple of things I've had problems with.  I've fixed one (sort of),
> but the other leaves me stumped.
> 
> The first question/point: I want to be able to produce output to a
> file, not just stdout (don't want to use redirection as using stdout
> for other purposes).  Now, I've achieved this by patching ExecuteMixin
> and SimpleContext in the following "quick and dirty" manner:

Sounds like you are asking for the template processing to be more
localized and isolated from the rest of Albatross processing, so
that it can be called independently and even used in non-Albatross
applications.  Are there other changes that should be made to make
this more convenient?  For example, should we be able to pass
values to the template processor in some way other than ctx.locals.

Well, I just looked, and the current mechanism seems pretty
convenient just the way it is.  Neat.  I'm interesting in general
text processing.  So a template processing capability that can be
called from Python code in other ways sounds like a good idea to
me.

[snip]

> 
> My second question, which I haven't been able to solve, regards
> macros.  I have pages which are based on a master template, along
> these lines:
> 
> master.html:
> 
>     <al-macro name="master">
>       Stuff stuff stuff
>       <al-usearg name="body">
>       Blah blah blah
>     </al-macro>
> 
> somepage.html:
> 
>     <al-expand name="master">
>     <al-setarg name="body">
>         Foo bar, foo bar, foo bar...
>     </al-setarg>
>     </al-expand>
> 
> Make sense?
> 
> Now, what I'd _really_ like is to have a number of templates which are
> used to build each page.  In particular, a large chunk of master.html
> is a sidebar table which is rather large: I'd love to be able to break
> that out into a seperate template then bring it in in either
> master.html or better yet, somepage.html (then I could have a choice
> of sidebars for different pages, all of which use the same master).
> 
> My instinct tells me there should be a way to do this but I haven't
> been able to find it.  Can anyone clue me in?

Is this a request for "include" processing and an "al-include" tag?
If so, you will need to define its semantics (processing).  Perhaps
something like: "Includes are inserted, recursively, before other
template processing is performed."

> 
> That's it - thanks again for a cool product.
> 

Ditto from me.


-- 
Dave Kuhlman
dkuhlman at rexx.com
http://www.rexx.com/~dkuhlman



More information about the Albatross-users mailing list