On 9/25/06, Rob Hudson <[EMAIL PROTECTED]> wrote:
>
> Geshi is written in PHP... Is there a Python equivalent?
> http://geshi.org/
>
I recently looked into this and wasn't very impressed with what I saw,
unless all you want to do is highlight python code.

Python is very self aware and py2html [1] takes advantage of this. I
would recommend this route if you only ever need to highlight python
code. (As an aside I had found py2html2 which I liked the output of
better - but it seems to no longer be available online [2] )

SilverCity [3] claims to offer 20 different languages, but I have
never gotten it to work and have only ever heard bad things about it
from others. Although, I understand Trac [4] uses it as a backup to
the often used comman line utility Enscript [5]. I've tried searching
Trac's code to see how they implemented either with no success.

There is also the command line utility Highligh [6] which I really
like. However, it is much less likely to be installed on a shared host
than Enscript. Interestinly, Highlight also has Swig [7] bindings [8]
for python but I have not been able to get them to successfuly compile
into a python module.

In the end I wrote a few quick little scripts to use either Enscript
or Highlight from the command line. While they work, I'm not confident
in their stability or performance and have yet to release them at part
of a Markdown [9] extension I'm working on. I want to rework them to
use some of the ideas expressed in this [10] 5 part series on wrapping
command-line programs.


[1]: http://cheeseshop.python.org/pypi/py2html/0.6
[2]: http://www.google.com/search?q=py2html2
[3]: http://silvercity.sourceforge.net/
[4]: http://trac.edgewall.org/
[5]: http://www.codento.com/people/mtr/genscript/
[6]: http://www.andre-simon.de/
[7]: http://www.swig.org/
[8]: http://www.andre-simon.de/dokuwiki/doku.php?id=en:swig
[9]: http://www.freewisdom.org/projects/python-markdown/
[10]: 
http://www.dalkescientific.com/writings/diary/archive/2005/04/12/wrapping_command_line_programs.html



-- 
----
Waylan Limberg
[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to