Re: python html rendering
Pierre, Hi, Im looking for a way to display some python code in html: with correct indentation, possibly syntax hiliting, dealing correctly with multi-line comment, tongue - in - cheek - mode the usual way is to create your own web-framework /tongue - in - cheek - mode If it is just some Python code and you have to do it once, just look at scite. Scite can colour your code, and you can export it as HTML. Harald -- http://mail.python.org/mailman/listinfo/python-list
Re: python html rendering
Fredrik Lundh wrote: Pierre Imbaud wrote: I rather thought of some module built on python parser, generating html or xml, ideally customizable. see colorizer.py and element_colorizer.py in this directory: http://svn.effbot.python-hosting.com/stuff/sandbox/pythondoc /F +1 for colorizer.py (-1 for the american spelling ;-) ) it works a treat. examples here: http://www.gflanagan.net/site/python/utils/htmlbuilder/index.html maybe the HTML generator on this page might be useful to you (OP), and there's a quick py2html there as well. (Thanks Fredrik!) Gerard -- http://mail.python.org/mailman/listinfo/python-list
Re: python html rendering
GHUM [EMAIL PROTECTED] wrote: Hi, Im looking for a way to display some python code in html: with correct indentation, possibly syntax hiliting, dealing correctly with multi-line comment, tongue - in - cheek - mode the usual way is to create your own web-framework /tongue - in - cheek - mode Or you could use an existing web framework: Plone has the ability to colour python code built-in. If it is just some Python code and you have to do it once, just look at scite. Scite can colour your code, and you can export it as HTML. and if you need it more than once you can always find one of the existing chunks of colouring code and modify/reuse it. See Plone's PortalTransforms/transforms/python.py, or the MoinMoin code it was cribbed from. https://svn.plone.org/svn/archetypes/PortalTransforms/trunk/transforms/python.py -- http://mail.python.org/mailman/listinfo/python-list
Re: python html rendering
Pierre Imbaud wrote: Hi, Im looking for a way to display some python code in html: with correct indentation, possibly syntax hiliting, dealing correctly with multi-line comment, and... generating valid html code if the python code itself deals with html (hence manipulates tag litterals. Thanks for your help! Take a look at Highlight [1], a program used successfully in the otherwise Python-based open source project ViewVC [2]. Messing around with IDEs (as others have suggested) just isn't necessary here. Paul [1] http://www.andre-simon.de/ [2] http://www.viewvc.org/ -- http://mail.python.org/mailman/listinfo/python-list
python html rendering
Hi, Im looking for a way to display some python code in html: with correct indentation, possibly syntax hiliting, dealing correctly with multi-line comment, and... generating valid html code if the python code itself deals with html (hence manipulates tag litterals. Thanks for your help! -- http://mail.python.org/mailman/listinfo/python-list
Re: python html rendering
Hey Pierre,I'm using this plug-in for wordpress to display Python code. http://blog.igeek.info/wp-plugins/igsyntax-hiliter/It works pretty well and can display a lot of other languages as well. -JoshOn 10/3/06, Pierre Imbaud [EMAIL PROTECTED] wrote: Hi, Im looking for a way to display some python codein html: with correct indentation, possibly syntax hiliting, dealingcorrectly with multi-line comment, and... generating valid html code ifthe python code itself deals with html (hence manipulates tag litterals. Thanks for your help!--http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: python html rendering
Josh Bloom wrote: Hey Pierre, I'm using this plug-in for wordpress to display Python code. http://blog.igeek.info/wp-plugins/igsyntax-hiliter/ It works pretty well and can display a lot of other languages as well. -Josh On 10/3/06, *Pierre Imbaud* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi, Im looking for a way to display some python code in html: with correct indentation, possibly syntax hiliting, dealing correctly with multi-line comment, and... generating valid html code if the python code itself deals with html (hence manipulates tag litterals. Thanks for your help! -- http://mail.python.org/mailman/listinfo/python-list Another approach is to use PyScripter (an editor and IDE). One can generate documentation and then save the generated html doc. Also PyDoc can be used directly. Colin W. -- http://mail.python.org/mailman/listinfo/python-list
Re: python html rendering
On 10/3/06, Colin J. Williams [EMAIL PROTECTED] wrote: Another approach is to use PyScripter (an editor and IDE). One can generate documentation and then save the generated html doc. Also PyDoc can be used directly. And if you want to go the traditional way, Emacs and Vim can both be used to produce colored HTML IIRC. Not sure about Vim (something like 2html.vim I believe), but Emacs has htmlize.el. If someone already said this, pardon me; I just joined via python-list. -- http://mail.python.org/mailman/listinfo/python-list
Re: python html rendering
hanumizzle wrote: On 10/3/06, Colin J. Williams [EMAIL PROTECTED] wrote: Another approach is to use PyScripter (an editor and IDE). One can generate documentation and then save the generated html doc. Also PyDoc can be used directly. And if you want to go the traditional way, Emacs and Vim can both be used to produce colored HTML IIRC. Not sure about Vim (something like 2html.vim I believe), but Emacs has htmlize.el. htmlize.el works fine, but I was looking for an automated process! not that easy to call xemacs from cgi code! Thanks anyway, nice tool, might help If someone already said this, pardon me; I just joined via python-list. -- http://mail.python.org/mailman/listinfo/python-list
Re: python html rendering
Colin J. Williams wrote: Josh Bloom wrote: Hey Pierre, I'm using this plug-in for wordpress to display Python code. http://blog.igeek.info/wp-plugins/igsyntax-hiliter/ It works pretty well and can display a lot of other languages as well. -Josh On 10/3/06, *Pierre Imbaud* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi, Im looking for a way to display some python code in html: with correct indentation, possibly syntax hiliting, dealing correctly with multi-line comment, and... generating valid html code if the python code itself deals with html (hence manipulates tag litterals. Thanks for your help! -- http://mail.python.org/mailman/listinfo/python-list Another approach is to use PyScripter (an editor and IDE). One can generate documentation and then save the generated html doc. Also PyDoc can be used directly. pydoc doesnt html the code, but its documentation. U seem to say PyScripter does the same? I rather thought of some module built on python parser, generating html or xml, ideally customizable. Thanks for your help! Colin W. -- http://mail.python.org/mailman/listinfo/python-list
Re: python html rendering
Hi, Im looking for a way to display some python code in html: with correct indentation, possibly syntax hiliting, dealing correctly with multi-line comment, and... generating valid html code if the python code itself deals with html (hence manipulates tag litterals. Thanks for your help! I haven't used it, but these seem promising: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252170 http://silvercity.sourceforge.net/ Hope it helps. -- http://mail.python.org/mailman/listinfo/python-list
Re: python html rendering
Pierre Imbaud wrote: I rather thought of some module built on python parser, generating html or xml, ideally customizable. see colorizer.py and element_colorizer.py in this directory: http://svn.effbot.python-hosting.com/stuff/sandbox/pythondoc /F -- http://mail.python.org/mailman/listinfo/python-list