Sunday, September 24th, 2006
at 2:41pm
As John Herren pointed out in the comments to yesterday's post, my suggestion for PHP syntax coloring wasn't working for several versions of Trac.
After a little digging, it turned out that my CSS rules were based on the non-standard SilverCity highlighting output, rather than the newer and more common native PHP highlighting.
While reviewing the output from the native PHP highlighter, I noticed that Trac's manipulation of the output from highlight_string() isn't quite right. The way things are now, as of Trac 0.10rc1, an intended multi-line docblock only has the first "/**" highlighted as a comment ... the rest of the docblock is highlighted as default PHP (the code-lang class).
I've been clamoring for good PHP syntax coloring output in Trac for a long time. Rather than pass the buck and put this on the Trac team, I've released a little PHP-based shell script called php_mimeview.
With php_mimeview installed, simply update the [mimeviewer] config section of trac.ini in your Trac project to point php_path to the full path location of php_mimeview. With that script, plus these rules in your site_css.cs template file:
[source language=":css"]
.code-keyword { color: #007700; }
.code-lang { color: #0000BB; }
.code-comment { color: #FF8000; }
.code-string { color: #DD0000; }
[/source]
... you'll get what you're probably used to seeing in syntax-highlighted PHP code.
Thanks to John Herren for the nudge to investigate this further.
Saturday, September 23rd, 2006
at 4:26pm
Two quick notes for Trac users out there:
- I banged out all 33 lines of my first Trac plugin last night. The FlexJsPlugin allows Trac users to add JavaScript to the <head> block of their Trac-powered sites without needing to hack ClearSilver templates.
- For PHP source files to display in the Trac Browser with default PHP syntax highlighting colors, use this:
/* trac php syntax highlighting */
.code-block {
line-height: 1em;
font-family: Courier, monotype;
font-size: 12px;
}
.h_question { color: #0000BB; } /* highlight.default */
.hphp_commentline { color: #FF8000; } /* highlight.comment */
.hphp_operator { color: #007700; } /* highlight.keyword */
.hphp_word { color: #007700; } /* highlight.keyword */
.hphp_default {}
.hphp_variable { color: #0000BB; } /* highlight.default */
.hphp_hstring { color: #DD0000; } /* highlight.string */
.hphp_simplestring { color: #DD0000; } /* highlight.string */
.h_tagunknown {}
.h_default {}
Drop the CSS in your project's site_css.cs file and you'll feel a little less like a stranger in a strange land. And while I haven't started playing too much with what some easily customizable JavaScript can bring to a Trac project, I'm looking forward to experimenting. Trac is great, but for all its coolness, it's lacking a bit in the area of today's JavaScript coolness.
Monday, May 1st, 2006
at 3:43am
As I mentioned in February, I've had a blog and site overhaul underway for awhile. Like a lot of developers, I always find it hard to take the time to work on my own site.
With the aid of the excellent Matt Brett, I've got a new theme in place for this site. I can't thank Matt enough -- he's been a pleasure to work with, and I highly recommend him.
I've scrambled a bit this evening to get this in place as part of the May 1 CSS Reboot event. Not sure if I'll have time to crank out the new Pearified.com design by the evening of May 1, but I'll do what I can. If I can't get to it, I'll certainly roll it out before the end of the week.
Please let me know if you find any issues or errors with the new site -- any that you find are my fault, not Matt's.
Friday, March 24th, 2006
at 5:37am
Angels could be heard singing softly in the background as I discovered the Internet Exploder Developer Toolbar this morning, just in time to debug a bit of fresh insanity produced by IE6's rendering of CSS otherwise deemed perfectly OK by Firefox, Safari and Opera.
A boon to myself and others who frequently groan in irritation over getting pulled away from PHP development to while away hours dealing with IE6 CSS rendering issues. It's not nearly as good as the Firefox Web Dev extension, but it's far better than nothing. Enjoy.