Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: template driven development? Re: Rebol Server Pages

From: al:bri:xtra at: 7-Oct-2002 21:43

pekr wrote:
> uhm, well - what's that? :-) Such kind of code it totally unacceptable to
me :-) I hope build-markup does not work that way??? 'Build-markup works the same way, but doesn't allow block! values to be separated by HTML tags and plain text. It also requires each expression within the "<%" and "%>" to be "complete", not separated likes 'RSP allows.
> Do you really like the mixture of Rebol code and html that way?
Of course not. That's why I went to eText, ML dialect and naked objects concept. Along the way I was forced to discard the HTML page designer. :) But I didn't miss him. :)
> What will be the result? Your visual editor will show both strings unless
you upload your page and let it be processed in production environment, where rebol is installed. Some kind of marker will have to be visible to the designer, otherwise they can't see it and move it around? :-/ I'm a bit confused here.
> Displaying date or time is a simple task, what I will probably need is to
generate some database query results, whatever the database is (initially rebol objects text files). My idea is that my friend does compelete design, including table, where results are displayed. The table will have one example element in it, so my friend will still be able to see, how does result of his code looks like in visual editor, but he will mark sections for me, e.g. <!--[table_1]-->, so I will be able to look at my code repository to look, if there is any code named section called "table_1". Oh, you mean something like this, perhaps: <html> <head> <title>{{Test}</title> </head> <body> <%hide [ Data: [ ; This is like results of query. "L1 Foo Stuff" "L1 Bar Stuff" "L2 Foo Stuff" "L2 Bar Stuff" ] ]%> <h1>Test</h1> <% random/seed now either random true [ %> Have a <b>nice</b> day! <% ] [ %> Have a <b>lousy</b> day! <% ] %><br/> The date and time now is: <% now %>.<br/> <table> <tr><th>Foo</th><th>Bar</th></tr> <%map Data func [Foo Bar] [reform [%> <tr><td><%Foo%></td><td><%Bar%></td></tr> <%]]%> </table> </body> </html> And here's the results: {<html> <head> <title>^{^{Test^}</title> </head> <body> <h1>Test</h1> Have a <b>nice</b> day! <br/> The date and time now is: 7-Oct-2002/21:36:57+13:00 .<br/> <table> <tr><th>Foo</th><th>Bar</th></tr> <tr><td> L1 Foo Stuff </td><td> L1 Bar Stuff </td></tr> <tr><td> L2 Foo Stuff </td><td> L2 Bar Stuff </td></tr> </table> </body> </html> } Now all your designer has to do is keep this: <%map Data func [Foo Bar] [reform [%> to the left of the first example row, and keep this: <%]]%> to the right of the first example row, and put these: <%Foo%> and: <%Bar%> where the contents of the columns are meant to go. I don't think that would be too hard?! :) The only time your effort needs to change if the number of columns changes, but then that implies that the database is changing as well... Andrew Martin ICQ: 26227169 http://valley.150m.com/