Greetings, Feel free to tell me this is a stupid idea, but for sake of clean sources after rendering a page in Zope, could it be possible to indent the contents of a var statement? Observe: Doc1 <html> <body> <dtml-var Doc2> <body> </html> Doc2 <table> <tr> <td> Hi </td> </tr> </table> Note the doc2 is not indented to where the var tag starts, you would typically want it indented properly. When rendered you see <html> <body> <table> <tr> <td> Hi </td> </tr> </table> <body> </html> But if the rendering indented all the outputted contents of doc2 to the space that the var tag is in the calling document you should see: <html> <body> <table> <tr> <td> Hi </td> </tr> </table> <body> </html> Is this totally useless or do I miss something? Regards, Paz
Feel free to tell me this is a stupid idea, but for sake of clean sources after rendering a page in Zope, could it be possible to indent the contents of a var statement? Observe:
Is this totally useless or do I miss something?
Just the opposite might be useful. Zope Documents and methods should include an option to strip all whitespace from the left in rendered HTML. Not only would it cut download time, but it could prevent a mishap I suffered recently: <td> <a href="/some/place"> <img src="someImage"> <...a lot of DTML code here> </a> <...a lot of DTML code here> </td> This renders additional 1 milimeter whitespace on image bottom, making it impossible to have two tighthly aligned tables. The only solution is reformat the code like this: <td> <a href="/some/place"> <img src="someImage"> <...a lot of DTML code here></a><...a lot of DTML code here></td> I do not know if this is browser quirk or HTML standard, but for both Mozilla 0.9.8 and MSIE 5.5 the additional whitespace gets created unless </a>, <img src> and </td> sit tight together on a single line. Imagine a tag called <dtml-tighthtml> </dtml-tighthtml>. When you embrace a piece of code with such tag, Zope would render everything as a single line. -- Milos Prudek
From: "Milos Prudek" <milos.prudek@tiscali.cz>
<td> <a href="/some/place"> <img src="someImage"> <...a lot of DTML code here> </a> <...a lot of DTML code here> </td>
This renders additional 1 milimeter whitespace on image bottom, making it impossible to have two tighthly aligned tables. The only solution is reformat the code like this:
<td> <a href="/some/place"> <img src="someImage"> <...a lot of DTML code here></a><...a lot of DTML code here></td>
Or like this: <a href="/some/place"> <img src="someImage"> <...a lot of DTML code here ></a><...a lot of DTML code here ></td> In other words: the extra whitespace is put *inside* the dtml-tags. Ugly, but works most of the time. Stripping whitespace could be nice, but it takes processor power. I think I'd rather have an external formatting/stripping app. Then I could strip the whitespace when I'm finished with the dtml-hacking. :-)
Milos Prudek wrote:
Feel free to tell me this is a stupid idea, but for sake of clean sources after rendering a page in Zope, could it be possible to indent the contents of a var statement? Observe:
Is this totally useless or do I miss something?
Just the opposite might be useful. Zope Documents and methods should include an option to strip all whitespace from the left in rendered HTML.
Not only would it cut download time, but it could prevent a mishap I suffered recently:
<td> <a href="/some/place"> <img src="someImage"> <...a lot of DTML code here> </a> <...a lot of DTML code here> </td>
This renders additional 1 milimeter whitespace on image bottom, making it impossible to have two tighthly aligned tables. The only solution is reformat the code like this:
<td> <a href="/some/place"> <img src="someImage"> <...a lot of DTML code here></a><...a lot of DTML code here></td>
I do not know if this is browser quirk or HTML standard, but for both Mozilla 0.9.8 and MSIE 5.5 the additional whitespace gets created unless </a>, <img src> and </td> sit tight together on a single line.
Imagine a tag called <dtml-tighthtml> </dtml-tighthtml>. When you embrace a piece of code with such tag, Zope would render everything as a single line.
well, inside dtml-tags white space including line breaks is legal, same for html. therefore <a href="...."
<dtml-something <img src="..." <dtml-lots of code here </a> i admit, this layout is not the layout i want.
participants (4)
-
hans -
Lennart Regebro -
Milos Prudek -
Paz