

Pygments, a generic syntax highlighter - tilt
http://pygments.org/

======
jordigh
Yay, a major project using hg instead of git. This makes it seem like my work
on hg is still worth something (as are the pull requests I have sent to
pygments).

Btw, the next hg sprint will be at Pycon in Montréal!

[http://mercurial.selenic.com/wiki/3.4sprint](http://mercurial.selenic.com/wiki/3.4sprint)

~~~
the_mitsuhiko
> Yay, a major project using hg instead of git. This makes it seem like my
> work on hg is still worth something (as are the pull requests I have sent to
> pygments).

Mostly because nobody spend time to make the move. All other pocoo projects
move to git (Flask, Werkzeug, Jinja2, Click, Sphinx, etc.).

~~~
jordigh
Aw. So you have no intent on staying with hg? I thought Georg Brandl was a big
hg fan. :-(

And hg is so cool! Templates! Revsets! Evolve! Extensibility!

[http://jordi.inversethought.com/blog/customising-
mercurial-l...](http://jordi.inversethought.com/blog/customising-mercurial-
like-a-pro/)

[https://www.youtube.com/watch?feature=player_embedded&v=NSLv...](https://www.youtube.com/watch?feature=player_embedded&v=NSLvERZQSok#t=973)

[https://www.youtube.com/watch?v=4OlDm3akbqg](https://www.youtube.com/watch?v=4OlDm3akbqg)

[http://jordi.inversethought.com/blog/x-men-in-mercurial-
evol...](http://jordi.inversethought.com/blog/x-men-in-mercurial-evolve/)

~~~
DasIch
Whether or not hg is good or even better than git is pretty much irrelevant at
this point.

Github's popularity has made all other project hosting platforms irrelevant.
Git's popularity means that every potential contributor knows how to use it,
which significantly reduces friction for new ones.

~~~
jordigh
I don't buy the popularity argument. If I were to abandon software just
because it wasn't as popular as the alternative, I would have to stop working
on GNU Octave in favour of Matlab, and I would have to wipe GNU/Linux from my
machines and just use Mac OS X or Windows.

I understand that git transcends organisation, programming languages, and
operating systems. I still don't want to be stuck to the git way of doing
things, no matter how popular it is. Concessions have to be made for git users
coming to hg, but there are some things that hg does that git just will
probably never be able to.

I may one day work on improving hgit, which is an hg front-end to a git
storage backend proof-of-concept, but so far the hg-git workaround for git's
popularity is good enough for most purposes.

~~~
DasIch
Popularity is a strong argument. It's however not the only argument. In the
case of git and hg popularity is important because the other arguments are too
weak to matter in comparision.

That's not the case for GNU Octave or Linux. Those offer significant
financial, ideological and technical benefits over alternatives. Benefits a
large part of their user base actually cares about. Hg doesn't have that
luxury. Git is simply good enough and hg is not good enough to offset the cost
for choosing the unpopular option.

------
hk__2
If anyone is writing Clojure, you can use Clygments [1], a bridge to Pygments
I wrote a year ago

[1]:
[https://github.com/bfontaine/clygments#clygments](https://github.com/bfontaine/clygments#clygments)

------
perlgeek
Just the other day we added syntax hilighting to
[http://doc.perl6.org/](http://doc.perl6.org/) backed by pygments. Yay!

------
drtse4
A few years ago i've converted some popular vim color schemes (Twilight,
Wombat, Mustang,etc...) to pygments css styles:
[https://github.com/uraimo/pygments-
vimstyles](https://github.com/uraimo/pygments-vimstyles)

------
xs
Pygments for me has been easy to get working on my blog but extremely
difficult and so far impossible for me to customize. My blog is Ruby based and
so first of all I don't quite understand how a python program can be added as
a ruby gem. Second, I really don't understand how to create my own lexer. Do I
edit the Ruby gem? Do I need to create my own gem? If I edit the gem locally I
may be able to do something but how do those edits get to Heroku? The task is
much more complicated than I have the knowledge for.

------
moomin
I used Pygments to power the syntax colouring of ulisse
([https://github.com/JulianBirch/ulisse](https://github.com/JulianBirch/ulisse))
a Clojure documentation generator (specifically, a codox writer).

Here's some example output:
[http://julianbirch.github.io/arianna/arianna.html](http://julianbirch.github.io/arianna/arianna.html)

------
StavrosK
I switched to Pygments from a JS-based solution, and I highly recommend it.
The parser is great and the resulting CSS and HTML are much cleaner.

~~~
donatj
What is the js based solution?

~~~
StavrosK
It was this:
[http://alexgorbatchev.com/SyntaxHighlighter/](http://alexgorbatchev.com/SyntaxHighlighter/)

------
Luyt
Freenode #pocoo is also the channel were Flask users hang out.

------
kasabali
I use it as LESSPIPE and it's very nice. The only problem is it is slow, so
you can't view longer files immediately as in regular less.

~~~
the_mitsuhiko
> The only problem is it is slow, so you can't view longer files immediately
> as in regular less.

For most lexers this could be fixed to be iterative. The lexers can do
iterative processing, it's just that the command line tool does a horrible job
at supporting that.

~~~
kasabali
I should check it out sometimes, then. Thanks.

------
kornakiewicz
I think that REST service for Pygments would be a nice thing for solutions
that could not run python scripts directly.

~~~
gpsarakis
Interestingly enough, there is one unofficial API
[http://pygments.appspot.com/](http://pygments.appspot.com/), but supports an
outdated version (1.5).

------
thesz
Agda highlighting is as uninteresting as it can be.

It should be on par of the real Agda highlighting but it is not.

~~~
fijal
How about you contribute this missing bit or improve it instead of whining on
the internet? This is really a _minor_ feature for pyglets (most people would
use it for more mainstream stuff than Agda), so how about you take it over?

------
halosghost
I love pygments, but I wish the C lexer were better and I wish it were written
in C.

