[Gambas-devel] gambas wiki db scheme

Benoît Minisini gambas at ...1...
Wed Sep 19 01:35:22 CEST 2012


Le 19/09/2012 00:14, Sebastian Kulesz a écrit :
> On Tue, Sep 18, 2012 at 6:51 PM, Benoît Minisini
> <gambas at ...1...> wrote:
>> Le 18/09/2012 23:34, Sebastian Kulesz a écrit :
>>>
>>> Actually, the parsing could be done inside a module, input text with
>>> markup > output html. So, if we start building the website now, this
>>> module would just plug in really easily, so it's not a hard
>>> requirement for now.
>>>
>>
>> The current markup routine can be used. It is just that the '@' special
>> commands are not implemented. But this can be done later.
>>
>>>>
>>>> I'd like the new wiki to be entirely based on one Gambas CGI script
>>>> using the gb.web component and ASP-like pages. That way it will be a
>>>> good demo for how to use that component.
>>>
>>> I like the idea, but i think that the ASP rendering engine would need
>>> a few changes. First, it should be possible to get the result without
>>> it being printed.
>>
>> What for? What do you mean?
>>
>>> Second, i don't know if this currently exists, but
>>> there should be a syntax declaration to include the content of another
>>> webpage inside the current one. Maybe <% Include "Webpage2" %>
>>
>> The syntax exists, but it is not wonderful:
>>
>> <%:WebPage2%>
>>
>> But it can take arguments: <%:WebPage2 foo="bar" zip="zap"%>
>>
>> And these arguments can be used inside WebPage2 with <%!foo%> and <%!zip%>
>>
>> Not wonderful syntaxes! :-/
>>
>> Maybe I could change them into something like that:
>>
>> <<WebPage2> foo="bar" zip="zap">
>> <%=[foo]%>
>>
>> More readable? More logical?
>
> What about something like... <% Webpage2, ("foo", "bar", ...) %>

This is ambiguous: <% ... %> is gambas code.

>
> <%=Args[0] %> --> foo
> <%=Args[1] %> --> bar
>
> <%=Args[2] %> --> NULL, no error should be thrown, but instead return
> an empty string.

Ambiguous too: <%=xxx%> is just the same as "Print Html$(xxx)" (see below).

>
> This way we don't get local vs global variables, and is easy to check
> if an argument was passed or not. A webpage should be much more
> "malleable" than a class. What do you think?

Maybe you should look at the source code of gbc_form_webpage.c. :-)

A WebPage is just a class with a big "Render" routine that use Print to 
send the HTML.

All these markups are converted to Print instructions, or directly sent 
to the compiler when you use <% ... %>.

And the Webpage arguments are just a collection sent to the Render 
routine through its first argument, named "_Args" - you almost got it, 
just an underscore! :-) So if you need you can use _Args["foo"]... but 
of course this is not recommended nor documented.

So all you want has already been done.

All these <% ... %> syntaxes are syntactic sugar whose aim is just being 
easier to read, and make think that a WebPage can be included like a 
HTML markup (<%: ... %>).

Regards,

-- 
Benoît Minisini




More information about the Devel mailing list