On Sun, Oct 11, 2009 at 1:11 AM, OKB <[email protected]> wrote:
>
> I'm trying to figure out how exactly indentation in templates is
> handled by web.py.  What I would like is to be able to do something
> like this
>
> $def someFunc(item):
>    $if blahblah(item):
>        <div>Some HTML</div>
>    $else:
>        <div>Some other HTML</div>
>
> and then in the midst of my page code
>
> <div>
>    <div>
>        $someFunc('foo')
>    </div>
>    <div>
>        $someFunc('bar')
> </div>
>
> . . . and have the HTML from someFunc show up indented nicely in the
> output (i.e., indented at the level where I have the $).  I can't find
> any documentation on how whitespace is handled.  I found an old post
> ( 
> http://groups.google.com/group/webpy/browse_thread/thread/3face3500a5ddcc8/9904f972c63b55a0
> ) but it's old, and I'm wondering if there have been any changes.  Is
> there a way to selectively tell web.py to ignore leading whitespace in
> a particular part of the template (either when defining the someFunc
> or when calling it later in the page)?

It finds the indentation by looking at the first line in the block and
there is no provision to ignore leading whitespace.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to