Page MenuHomePhabricator

A new MediaWiki extension to provide syntax highlighting with pygments
Closed, DeclinedPublic

Description

Author: mike.lifeguard+bugs

Description:
Please write a new syntax highlighting extension which uses Pygments instead of GeSHi.

*GeSHi is showing it's age
*Pygments produces nicer highlighting in many cases
*Pygments is actively developed, and ever so much trendier (just look at the purty webpage!)


Version: unspecified
Severity: enhancement
URL: http://pygments.org

Details

Reference
bz22512

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 10:58 PM
bzimport set Reference to bz22512.
bzimport added a subscriber: Unknown Object (MLST).

Pygments is written in Python, while MediaWiki in PHP. A monster that will combine the two pieces, apparently by execing a Python interpreter, is not an option for sites of any reasonable size for performance reasons. How do you suggest to overcome this?

(In reply to comment #0)

*GeSHi is showing it's age
*Pygments is actively developed, and ever so much trendier (just look at the
purty webpage!)

What makes you think that? I have quite an opposite impression of Geshi and its development activity.

mike.lifeguard+bugs wrote:

(In reply to comment #1)

How do you suggest to overcome this?

I have no idea, I am not writing it. If you think it is a bad idea, then you could just close this.

shauna wrote:

(In reply to comment #1)

Pygments is written in Python, while MediaWiki in PHP. A monster that will
combine the two pieces, apparently by execing a Python interpreter, is not an
option for sites of any reasonable size for performance reasons. How do you
suggest to overcome this?

There's now a bridge that overcomes this issue, called Pygments for PHP ( http://derek.simkowiak.net/pygments-for-php/ ). Given that a Wordpress extension has successfully been made using it, perhaps this is now a viable request?

As far as I can see pygmentize() is just launching the python interpreter behind the scenes.(In reply to comment #4)

(In reply to comment #1)

Pygments is written in Python, while MediaWiki in PHP. A monster that will
combine the two pieces, apparently by execing a Python interpreter, is not an
option for sites of any reasonable size for performance reasons. How do you
suggest to overcome this?

There's now a bridge that overcomes this issue, called Pygments for PHP (
http://derek.simkowiak.net/pygments-for-php/ ). Given that a Wordpress
extension has successfully been made using it, perhaps this is now a viable
request?

That bridge only does what was written above: "execing a Python interpeter".