This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: [ANN] DiscussMethods
Feed Title: Michael Lucas-Smith
Feed URL: http://www.michaellucassmith.com/site.atom
Feed Description: Smalltalk and my misinterpretations of life
With Travis Griggs, I've just made a new goodie called DiscussMethods. The basic idea is to be able to post code snippits in to our blogs from Smalltalk while keeping the syntax colouring that we get in our development environment.
There is a goodie called RBCodeHighlighting which provides on-the-fly colouring of methods as you edit them. It's great, it parses the method as you code and uses the parse tree to apply colouring to the Core.Text object in the widget.
Using the Core.Text object, we then extract that styling information in to some basic HTML, then put some CSS over the top of it to make it look colourful. Here's the result:
Naturally, this method should be refactored, but it served as a good colourful example.
Once it's loaded you can right click on a method name in the refactoring browser an dchoose 'Copy as Styled HTML'. The other option available is 'View as Styled HTML in WithSTyle' - this is only live if you have WithStyle loaded. It's more for a preview of what you're about to copy than for anything else.