"C. Titus Brown" <c...@msu.edu> writes: > I guess docutils isn't in the stdlib (should it be?) or else we could > modify 'help' to use it to prepare a straight text formatting.
We're using light-weight ReST markup in the Mercurial help texts and transform it into straight text upon display in the terminal. We want no external dependencies for Mercurial, so I wrote a "mini ReST" parser in about 400 lines of code. It cheats a lot and can only handle simple constructs... but maybe it would be interesting for Python's help? You find it here: http://selenic.com/hg/file/tip/mercurial/minirst.py Its test and the corresponding output shows the markup it can parse: http://selenic.com/hg/file/tip/tests/test-minirst.py http://selenic.com/hg/file/tip/tests/test-minirst.py.out It would of course be much nicer to have Docutils in the standard library. I'm not a Docutils developer, but to me it seems that Docutils is now a very stable and widely used package, so it would IMHO make sense to include it. -- Martin Geisler Mercurial links: http://mercurial.ch/
pgpf0R31gMZHO.pgp
Description: PGP signature
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com