I wrote an email to the lovely Tumblr people asking for Syntax Highlighting for code chunks. Several hours passed and they still hadn’t jumped at the chance to appease me with some syntax highlighting.
So I wrote one, and so now all Tumblrers can use it.
See the demo from my tumblr, and in a frame below:
To use this in your own Tumblr (or probably anywhere I guess), do the following:
- Go to settings
- At the bottom, turn off ‘Use rich text editing’ and ‘Filter HTML’, and save settings.
- Go back into settings, and select Custom theme. This will give you the raw html for your previously selected theme
- Just above/before the
</head><body>section, insert these two lines of html
Can I change the highlighting?
Get the styles.css file, change it, post it somewhere (or give it to me with a new name, and I’ll post it here), and change the
<link href="...your dir/styles.css"> above.
Can I support more languages?
“I’m from Tumblr, we’ve just implemented syntax highlighting”
- Dr Nic’s Tumblelog Everyday I have 100s of blog articles to read [Ed:...