pygments support in hgweb

Peter Arrenbrecht peter.arrenbrecht at gmail.com
Mon Nov 5 00:22:05 CST 2007


> Is there any interest in including this change in mercurial?

Without being in a position to look at your patch knowledgably enough
to judge its inclusion as is, I would welcome syntax highlighting in
hgweb.
-peo

On Nov 5, 2007 12:55 AM, Adam Hupp <adam at hupp.org> wrote:
> I've modified hgweb to apply pygments syntax highlighting in the file
> revision view.  It's based on this patch[0] but has the following
> improvements:
>
>  * uses an external css file instead of inline styles.
>  * falls back to a plain view if pygments is not available or is disabled
>  * language determined based on file extension and contents
>  * supports striped line highlighting
>
> The changes are available in this repo:
>
> http://hupp.org/adam/hg/hg-pygments
>
> That repository is running the changes.
>
> One issue I ran into was an "unloaded module not callable" error
> within pygments.  This was resolved by adding
> mercurial.demandimport.disable() at the top of hgweb_mod.py.  That's
> probably not the right solution but I'm not sure how else to handle
> it.
>
> Is there any interest in including this change in mercurial?
>
> [0] http://www.selenic.com/pipermail/mercurial/2007-May/013207.html
>
>
>
> --
> Adam Hupp | http://hupp.org/adam/
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>


More information about the Mercurial-devel mailing list