Looking at the code for $http_agent, it's suffering from much the same problems Java's Servlet's do - lots of print statements containing HTML fragments, and the answer is much like that for servlets was JSP - MSP. Have properties like "foo.msp", which would look like:
<h1> Here's a list </h1>
<ul>
<% for p in (this.pages) %>
<li> <a href="<%= p.url %>"><%= p.content %></a>
<% endfor %>
<ul>
Then, rework the HTTP request handler so that any requests for pages that end in .msp are pulled through the MSP engine and rendered. Can still leave the / handling that currently exists, for form handling, etc.
--
CoKe - 28 Nov 2003
"I can't be the first person to try to do this."
And, I'm not.
http://www.moo.ca/ has a working implementation, though their source is obscured.
--
CoKe - 29 Dec 2003
- MSP.code: Sample implementation of a possible MSP engine.
--
JeffR - 22 Dec 2005
moo.ca's MSP home:
http://www.moo.ca/301
and
gopher://moo.ca/0/300:compile appears to be the core of their MSP compiler.
to top