<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>David Peterson</title>
	<atom:link href="http://blog.peterson.id.au/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.peterson.id.au</link>
	<description>Random thoughts on technology and society ...</description>
	<lastBuildDate>Sun, 25 Apr 2010 12:51:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Railscast style syntax highlighting redux</title>
		<link>http://blog.peterson.id.au/2010/04/railscast-style-syntax-highlighting-redux/</link>
		<comments>http://blog.peterson.id.au/2010/04/railscast-style-syntax-highlighting-redux/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 11:54:17 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.peterson.id.au/?p=5</guid>
		<description><![CDATA[With a new version of Wordpress just installed, I went looking around for a Rails-style syntax highlighter plugin. I&#8217;ve always been a fan of Ryan Bates&#8217; excellent Railscasts series (and the Textmate-style code highlighting), so I wanted to see if I could find the same for Wordpress &#8230;
I came across this post by Adam Fortuna, [...]]]></description>
			<content:encoded><![CDATA[<p>With a new version of Wordpress just installed, I went looking around for a Rails-style syntax highlighter plugin. I&#8217;ve always been a fan of Ryan Bates&#8217; excellent <a href="http://railscasts.com/">Railscasts</a> series (and the Textmate-style code highlighting), so I wanted to see if I could find the same for Wordpress &#8230;</p>
<p>I came across <a href="http://adamfortuna.com/2009/08/04/railscast-theme-for-wordpress/" target="_blank">this post</a> by Adam Fortuna, which shows how to get &#8220;Railscast Style&#8221; syntax highlighting working with Wordpress and the SyntaxHighlighter Plus plugin. Unfortunately, this older plugin is not endorsed to run newer versions (&gt;2.7) of Wordpress and seems to be now superceded by the more popular <a href="http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/" target="_blank">SyntaxHighlighter Evolved</a> plugin. Adam has provided a <a href="http://github.com/adamfortuna/railscasts_wordpress" target="_blank">githib project</a> containing a Railscast style CSS theme for that plugin.</p>
<p>After a bit of poking and prodding, I was able to get this working with the new SyntaxHighlighter Evolved plugin. To do so, follow the steps below:</p>
<p>1. Install the <em>SyntaxHighlighter Evolved</em> plugin using the WP administration interface (Plugins &gt; Add new &#8230; Search for &#8220;syntaxhighlighter&#8221; and install the <em>SyntaxHighlighter Evolved</em> plugin &#8211; it&#8217;s the first result in the list!)</p>
<p>2. SSH / access the server running your wordpress instance, and navigate to the WP plugins directory (mine is in <em>/var/www/wordpress/wp-content/plugins</em> &#8230;)</p>
<p>3. Create a new file in the sub-directory <em>syntaxhighlighter/styles</em> for the Railscast style. (In keeping with the filename conventions, I called mine <em>shThemeRailscast.css</em>). Drop the content of Adam Fortuna&#8217;s github CSS style into this file.</p>
<p>4. Modify the <em>syntaxhighlighter.php</em> file in the plugin sub-directory, and add the following fields -</p>
<ul>
<li>Below the CSS theme definition for RDark, add an entry for the Railscast theme</li>
</ul>
<pre class="brush: php;">
wp_register_style( 'syntaxhighlighter-theme-rdark',
plugins_url('syntaxhighlighter/syntaxhighlighter/
styles/shThemeRDark.css'),
array('syntaxhighlighter-core'), $this-&gt;agshver );

wp_register_style( 'syntaxhighlighter-theme-railscast',
plugins_url('syntaxhighlighter/syntaxhighlighter/
styles/shThemeRailscast.css'),
array('syntaxhighlighter-core'), $this-&gt;agshver );
</pre>
<ul>
<li>Below the menu drop-down definition for RDark, add an entry for the Railscast theme</li>
</ul>
<pre class="brush: php;">
$this-&gt;themes = (array) apply_filters( 'syntaxhighlighter_themes', array(
...
'rdark'      =&gt; __( 'RDark', 'syntaxhighlighter' ),
'railscast'  =&gt; __( 'Railscast', 'syntaxhighlighter' ),
 ...
</pre>
<p>5. Finally, navigate back to the <em>SyntaxHighlighter Evolved</em> plugin settings page in Wordpress and select Railscast as your default theme.</p>
<p>If you have followed the steps correctly, you should have Railscast-style highlighting enabled. Here&#8217;s a sample (lifted from Adam&#8217;s posting):</p>
<pre class="brush: ruby;">
# This is a comment
class Test
  @testingalongname = &quot;Something here&quot;
  CONSTANT = 2323
  def test
    return (1*5)
  end
end
</pre>
<p>That&#8217;s it! Enjoy your Railscast-style syntax highlighting &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.peterson.id.au/2010/04/railscast-style-syntax-highlighting-redux/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Blog updated &#8230;</title>
		<link>http://blog.peterson.id.au/2010/04/hello-world/</link>
		<comments>http://blog.peterson.id.au/2010/04/hello-world/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 05:51:44 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://blog.peterson.id.au/?p=1</guid>
		<description><![CDATA[After years of neglect I&#8217;ve decided to renew my blog, using Wordpress and the beautiful, clean and modern-looking Titan theme.
Despite the fact we use Ruby on Rails for almost all of our new software development work, it&#8217;s hard to go past the simplicity, power and small footprint (PHP) of Wordpress for occasional blogging!
]]></description>
			<content:encoded><![CDATA[<p>After years of neglect I&#8217;ve decided to renew my blog, using <a href="http://www.wordpress.org" target="_blank">Wordpress</a> and the beautiful, clean and modern-looking <a href="http://wordpress.org/extend/themes/titan" target="_blank">Titan theme</a>.</p>
<p>Despite the fact we use Ruby on Rails for almost all of our new software development work, it&#8217;s hard to go past the simplicity, power and small footprint (PHP) of Wordpress for occasional blogging!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.peterson.id.au/2010/04/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
