maanantai 26. syyskuuta 2016 14.17.24 UTC+3 Anthony kirjoitti:
>
> On Sunday, September 25, 2016 at 11:56:33 PM UTC-4, Marko Seppälä wrote:
>>
>> Hi,
>>
>> Not sure if this is expected behavior but I can't figure out any reason
>> why it is done like this.
>>
>> Currently include tag messes up the indentation level. Only first line of
>> included file is indented same level as parent file, other lines start from
>> zero. I think indentation level should be preserved, so that indentation in
>> include tag is added to every line in included file.
>>
>> How to fix that problem?
>>
>
> The {{include}} statement is intended to include exactly what is in the
> included file, starting at the point of the {{include}} -- if the text in
> the included file is not indented, then neither will it be indented once
> included. If you want it indented, then you must indent the text in the
> included file.
>
> Also, note that if you are producing HTML, indenting is not necessary
> anyway.
>
> Anthony
>
Yes I'm producing HTML and I know it's not a big problem since it's not
affecting to functionality. But still I prefer end result which looks clean
and is indented in a proper manner. Indenting matters for the readability
of HTML so I want it to be right.
I could get a right end result if I manually indent every other than first
line in a included file so that it match to indentation level in file where
it is included. But I think this is even worse since it mixes up my
original source code. In my opinion, include statement should work so that
it preserves the original indentation. So if include statement is indented
for example three tabs, then every line in included file should be indented
three tabs plus their indentation in original file. This way your source
code and end result looks always right.
Is there any quick fix how I could implement that? I haven't check web2py
template engine yet.
- Marko
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.