<?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>Marcus Hellberg &#187; code</title>
	<atom:link href="http://www.marcushellberg.com/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marcushellberg.com</link>
	<description>blog.</description>
	<lastBuildDate>Sat, 20 Mar 2010 12:39:50 +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>Syntax highlighters</title>
		<link>http://www.marcushellberg.com/2009/12/21/syntax-highlighters/</link>
		<comments>http://www.marcushellberg.com/2009/12/21/syntax-highlighters/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 07:05:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://www.marcushellberg.com/?p=66</guid>
		<description><![CDATA[As I am probably going to post much on programming, I felt that I needed a way of highlighting code syntax and showing it in an easier to read format to you. At first I thought of just using Alex Gorbatchev&#8217;s SyntaxHighlighter. It turned out that there were in fact several WordPress plugins using Alex&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>As I am probably going to post much on programming, I felt that I needed a way of highlighting code syntax and showing it in an easier to read format to you. At first I thought of just using Alex Gorbatchev&#8217;s <a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter" target="_blank">SyntaxHighlighter</a>. It turned out that there were in fact several WordPress plugins using Alex&#8217;s highlighter. Many of the existing highlighters did not work very well, they simply included the JavaScript file, requiring users to insert</p>
<pre class="brush:html">&lt;pre name="code" class="html"&gt;
...
&lt;/pre&gt;</pre>
<p>into the HTML. The problem is that WordPress&#8217; HTML editor strips out the name=&#8221;code&#8221; part, rendering the plugins useless.</p>
<p>What I settled on using, for the time being at least, is Vijesh Mehta <a href="http://www.lastengine.com/syntax-highlighter-wordpress-plugin/" target="_blank">Syntax Highlighter Wordpress Plugin</a>. The plugin still requires manual HTML editing, but avoids the stripping of the name attribute by using class=&#8221;brush:language_name&#8221; instead.</p>
<p>So, as a start for my posts on programming: the classical &#8220;hello world&#8221;, in ruby this time.</p>
<pre class="brush:ruby">puts "hello world!"</pre>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.marcushellberg.com/2009/12/21/syntax-highlighters/&amp;title=Syntax+highlighters" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.marcushellberg.com/2009/12/21/syntax-highlighters/&amp;title=Syntax+highlighters" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.marcushellberg.com/2009/12/21/syntax-highlighters/&amp;t=Syntax+highlighters" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Syntax+highlighters+-+http://b2l.me/bxacd+(via+@marcushellberg)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.marcushellberg.com/2009/12/21/syntax-highlighters/&amp;title=Syntax+highlighters&amp;summary=As%20I%20am%20probably%20going%20to%20post%20much%20on%20programming%2C%20I%20felt%20that%20I%20needed%20a%20way%20of%20highlighting%20code%20syntax%20and%20showing%20it%20in%20an%20easier%20to%20read%20format%20to%20you.%20At%20first%20I%20thought%20of%20just%20using%20Alex%20Gorbatchev%27s%20SyntaxHighlighter.%20It%20turned%20out%20that%20there%20were%20in%20fact%20several%20WordPress%20plugins%20using%20Al&amp;source=Marcus Hellberg" rel="nofollow" class="external" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.marcushellberg.com/2009/12/21/syntax-highlighters/&amp;title=Syntax+highlighters" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.marcushellberg.com/2009/12/21/syntax-highlighters/&amp;t=Syntax+highlighters" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.marcushellberg.com/2009/12/21/syntax-highlighters/&amp;n=Syntax+highlighters&amp;pli=1" rel="nofollow" class="external" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.marcushellberg.com/2009/12/21/syntax-highlighters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
