[Zope] DTML reformulated as XML (was RE: [Zope] <% ... %> ?)
Hannu Krosing
hannu@trust.ee
Sat, 12 Jun 1999 20:40:48 +0300
Jules Allen wrote:
>
> It is *hard* to read DTML! Partly because my eyes aren't used to it and
> partly because my editors (vim and Homesite) don't know about DTML. In
> an earlier email either you or somebody else made a comment about having
> to write a syntax highlighter for each editor and what a drag it would
> be. Sure, any decent html editor will deal with <!-- --> correctly but
> it's a bigger drag for the newbie who doesn't know the syntax of the
> language.
I think that allowing \ as a line continuation would enable us to write
much cleaner DTML. There are many places where proper rendering requires
no whitespace but readability would need proper indentation.
so I want
<textarea>\
<!--#in "[1,2,3]"-->\
<!--#var sequence-item html_quote-->,\
<!--#/in-->\
</textares>
to be rendered as
<textarea>1,2,3,</textarea>
the current (ugly) way to do is
<textarea><!--#in "[1,2,3]"
--><!--#var sequence-item html_quote
-->,<!--#/in
--></textares>
(btw, did I mention this is real ugly ;)
I have done this using re.sub(r"\\[ \t]*\n[ \n]*", "")
(or somthing similar, this is from memory)
on my DTML source before passing it to DocumentTemplate.HTML
the meaning is to remove the \ as the last non-whitespace char on line
together with the \n and all the indenting whitespace on the next line.
> One of the sexiest PHP features is the syntax highlighter. If a site
> allows it. It's not a very whizzy example but take a look at
>
> http://www.php.net/docs.php3
>
> and then take a look at
>
> http://www.php.net/source.php3?page_url=/docs.php3
>
> That takes newbie "look, how did they do that?" questions to a "look
> how they did that!" level. Nice.
>
> Is this already in Zope? And if it is, why couldn't I find it? (Hint:
> because you're a wickedly lazy individual, Jules)
Not syntax hilighting, but there is a "DTML source" link at the lower
right of pages at www.zope.org
-----------------
Hannu