Posts List

Highlight PHP and HTML in Octopress

In yesterday’s post on Octopress, I briefly mentioned the Pygments lexer documentation. One of the things I found incredibly useful was understanding all the available lexers and which language code would invoke them. For example, let’s say you want to have a code block that highlights both PHP and HTML. How would you do this?

Better PHP highlighting in Octopress

I recently moved my blog from WordPress to Octopress. The experience was painless and I wish I would have done it much earlier. One thing that puzzled me was how Octopress handled PHP syntax highlighting. It seemed that it would only work if every code block started with the opening <?php tag. I found this quite annoying, especially when I only want to show one line of code.