On Jul 22, 6:45 pm, Georg Brandl <[email protected]> wrote:
> Gg schrieb:
>
> > Hi,
>
> > I'd like to know if there is a way to configure Apache to use Pygments
> > to highlight some source code (.cpp, .py) directly in the browser
> > instead of having the code displayed as plain text ?
>
> Not as such; one of the following would be possible
>
> * if there is an Apache module that allows you to pipe the file content
>   through an external program, you can use pygmentize for that
>
> * you can add some kind of default handler that executes a Python script
>   for files, perhaps Armin knows how to do this?

The latter is quite easy with mod_wsgi version 3.0 as there was a
specific feature added to support that sort of thing.

The handler script itself can be implemented as a WSGI application and
would just need to process the file named by SCRIPT_FILENAME in the
WSGI environment dictionary passed to the application.

Georg, if you can crank out a WSGI application that does what is
required to return pygmentised version of file named in
SCRIPT_FILENAME of WSGI environment, then I'll show how to setup
mod_wsgi to use it.

Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pocoo-libs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to