Testing code snippets

I figured I’d test a code snippet and see what happens.

That’s a PHP example. How about Objective C:

- (void) drawRect:(NSRect)rect
{
NSLog(@“my drawrect”);
[super drawRect: rect];
}

Outstanding! One issue is that when you specify the “code” tag, you have to use double quotes, and you have to know the random identifier that GeSHi uses (Objective C is “objc”). So for instance:

<code lang=“objc”>

Won’t work. But:

<code lang=“objc”>

Works fine.

I’m excited.

Oh, and by the way, I did this with the Code Snippet plugin, which uses GeSHi for syntax highlighting (which seems cool in its own right).

Comments are closed.