Thursday, December 17, 2009

Syntax Highlighting in Blogger with TicTac Theme

At first I tried to get Prettifier to work on Blogger by following these steps. However, it then complained about a "--" string or something similar. So I removed the old HTML comments that were in the script tag (<!-- -->), and it fixed that problem. It then started complaining about something else though. I tried both the standard version and the small version downloads from their website, neither worked.
So instead, I decided to try out SyntaxHighlighter by following the directions here. This ended up working. The only problem was that orange bullets were being shown in the code on every line. This is what it looked like: I found out that the reason is because of this Tic Tac theme I'm using on blogger. To fix it, I added the following code inside the CSS:
/* Remove background image from the tictac theme */
.dp-highlighter li { background-image: none }
And, as you can see, there are no more orange bullets appearing. The only bad thing is I have to write the name of the language everytime unlike in Prettifier that does it for you, but oh well, I'm just happy this works.

No comments:

Post a Comment