Objective-C Pygments

Mar 3, 2007 — Whitney Young

There's a nice extension to the Python implementation of Markdown that allows for syntax highlighting of code. It's called CodeHilite, and it allows you to use a couple of different syntax highlighting tools, one of which being Pygments. Pygments and CodeHilite are great except that Objective-C syntax highlighting hasn't been implemented in Pygments.

Fortunately the Pygments team has made it pretty easy to create a new Lexer. I quickly modified the CLexer to create an ObjectiveCLexer. It's not really ideal, but it works. If you have improvements to this Lexer, please email me and/or comment on the ticket I created for the Pygments team.

Read More...

No Comments Tags: Blog, Code, Pygments, Python