ANN: Munch 0.1 -- Embed Python in text as markup
Erik Max Francis
max at alcyone.com
Fri Apr 12 18:14:16 EDT 2002
Summary
Munch is a system for embedding Python expressions and statements
in text (or any other unexecuted content); it takes source files,
processes them, and produces output. These are done via
expansions, which are snippets of Python code delimited by special
characters involving the at sign (@), and are substituted in the
output with the return value (for expressions) or with any
in-Python printing to stdout that takes place (for both
expressions and statements). Textual data not explicitly
delimited in this way is sent unmolested to the output file,
allowing Python to be used effectively as a markup language. Explicit
expansion within Python code is possible. Also supported are
m4-style diversions, where output can be systematically deferred
and recalled.
Expressions are embedded in text with the '@(...)' notation; as a
shortcut, simple variables and expressions can be abbreviated as
'@variable', '@object.attribute', '@array[index]', or
'@function(arguments)'. Full-fledged statements are embedded with
'@{...}'.
Getting the software
The software is available in a tarball here:
http://www.alcyone.com/pyos/munch/munch-0.1.tar.gz.
The official URL for this Web site is
http://www.alcyone.com/pyos/munch/.
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/ \ Nationalism is an infantile sickness.
\__/ Albert Einstein
Alcyone Systems' Daily Planet / http://www.alcyone.com/planet.html
A new, virtual planet, every day.
More information about the Python-list
mailing list