[Twisted-web] HTML Tidy and Stan

Cory Dodt corydodt at twistedmatrix.com
Thu Apr 6 10:12:35 CDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Moof wrote:
> Hiya,

> * Is there a way to get stan to pretty-print its output?
>

My favorite, very simple technique for getting nicer output from stan is just
to embed literal newlines: '\n' between elements in the stan tree I'm
generating.  This is almost always good enough to read the source code when
I'm working on a markup problem, and they're innocuous enough to leave in the
production code.


e.g.

T.body['\n',
  T.ol['\n',
    T.li['hahaha'], '\n',
    T.li['yayayay'], '\n', ...


This is particularly useful when you're building a stan tree with lots of
loops, you just add one newline in each iteration.

C
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFENS/i3A5SrXAiHQcRAs8KAJ4s/De+1zSrxR8WZsuP33SXSTpRGACeJOBU
QZ4HhazugzRFtrdajAJrWyE=
=mCPz
-----END PGP SIGNATURE-----



More information about the Twisted-web mailing list