<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>Eli wrote:</div><blockquote type="cite"><div>Dave wrote:<br><blockquote type="cite"><span class="Apple-style-span" style="-webkit-text-stroke-width: -1; ">I'm definitely considering building [HTML pretty printing] into Mirrors. [...]</span></blockquote><br>That's much more difficult than it sounds... It's easy to do<br>something simple -- actually, the xml collection *can* print stuff<br>with indentation:<br><br> (display-xml/content (xexpr->xml '(p (ul (li "foo") (li "bar")))))</div></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">but it doesn't take into account places where you shouldn't add<br>whitespaces (like after "<li>" and before "</li>" in that example) [...]</blockquote><div><br></div><div>Oh absolutely. The "simple" version I was referring to was a naive one you suggested above.</div><div><br></div><div>I was previously content to rely on pretty-printing plugins for Firefox to do my formatting for me (the "View Source Chart" extension is quite good). I'm really impressed with PPrint, though, so now I'm now tempted to give some full-featured Scheme code a try.</div><div><br></div><div>Come to think of it (and as an aside), there *is* a reason I haven't put pretty printing into Mirrors yet... the compile-time rendering features make it difficult to do. By default, something like:</div><div><br></div><div><font class="Apple-style-span" face="Monaco"> (xml (p "Hi " (b ,name)))</font></div><div><br></div><div>is macro-transformed to the equivalent of:</div><div><br></div><div><font class="Apple-style-span" face="Monaco"> (xml (!raw "<p>Hi <b>") ,name (!raw "</b></p>"))</font></div><div><font class="Apple-style-span" face="Monaco"><span class="Apple-style-span" style="font-family: 'Lucida Grande'; "><div><br></div><div>This feature can be turned off but !raw blocks are always available to the programmer and it's not obvious now to handle them in pretty printed output. Suggestions welcome.</div><div><br></div><div>-- Dave</div><div><br></div></span></font></div></div></body></html>