<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8729213181221668863</id><updated>2012-02-16T12:43:15.643+01:00</updated><category term='script'/><category term='source'/><category term='highlighting'/><category term='code'/><category term='syntax'/><category term='haxe'/><title type='text'>Ideas Worth Shredding</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.ahnfelt.dk/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8729213181221668863/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://blog.ahnfelt.dk/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ahnfelt</name><uri>http://www.blogger.com/profile/13418038848142036358</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8729213181221668863.post-5651593913504997378</id><published>2009-06-08T17:39:00.002+02:00</published><updated>2009-06-08T17:42:16.935+02:00</updated><title type='text'>Plaintext table formatting</title><content type='html'>I just finished a very small library called &lt;a href="http://bitbucket.org/Ahnfelt/texttable/"&gt;TextTable&lt;/a&gt;, which will lay out tables in plaintext, ASCII-art style. It is available via haxelib or directly from the source code repository linked above.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8729213181221668863-5651593913504997378?l=blog.ahnfelt.dk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.ahnfelt.dk/feeds/5651593913504997378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8729213181221668863&amp;postID=5651593913504997378' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8729213181221668863/posts/default/5651593913504997378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8729213181221668863/posts/default/5651593913504997378'/><link rel='alternate' type='text/html' href='http://blog.ahnfelt.dk/2009/06/plaintext-table-formatting.html' title='Plaintext table formatting'/><author><name>Ahnfelt</name><uri>http://www.blogger.com/profile/13418038848142036358</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8729213181221668863.post-396310378229244831</id><published>2009-03-13T13:01:00.004+01:00</published><updated>2009-03-13T15:31:19.181+01:00</updated><title type='text'>Highlighter status</title><content type='html'>I just added Python support, as per Tong's request.

It now supports html, xml, javascript, php, css, perl, ruby, c, c++, c#, java, scala, haxe, python, haskell, latex, plus a few obscure languages. Admittedly, the support is pretty weak for some of the languages, like c, c++ and c#.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8729213181221668863-396310378229244831?l=blog.ahnfelt.dk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.ahnfelt.dk/feeds/396310378229244831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8729213181221668863&amp;postID=396310378229244831' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8729213181221668863/posts/default/396310378229244831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8729213181221668863/posts/default/396310378229244831'/><link rel='alternate' type='text/html' href='http://blog.ahnfelt.dk/2009/03/highlighter-status.html' title='Highlighter status'/><author><name>Ahnfelt</name><uri>http://www.blogger.com/profile/13418038848142036358</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8729213181221668863.post-1818294312344153667</id><published>2008-08-10T13:00:00.003+02:00</published><updated>2008-08-10T16:27:24.924+02:00</updated><title type='text'>New Highlighter Version</title><content type='html'>&lt;p&gt;
I cleaned up the code and changed the way nested languages works. The IE bug turned out to be an error in IE's handling of innerHTML for &amp;lt;pre&gt; and certain other elements. It was easily worked around by wrapping an extra &amp;lt;pre&gt; around it. I also made the line numbers non-selectable in FF and IE. I haven't shown off line-numbers really, but here's an example:
&lt;/p&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_5bNgfobr5U0/SJ4zZPWekUI/AAAAAAAAAAM/CgqG1dzs_yk/s1600-h/line-numbers.png"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_5bNgfobr5U0/SJ4zZPWekUI/AAAAAAAAAAM/CgqG1dzs_yk/s320/line-numbers.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5232676325761651010" /&gt;&lt;/a&gt;
&lt;p&gt;
I generated it at my own computer, obviously using a different style sheet than I use on this blog.
&lt;/p&gt;
&lt;p&gt;
The currently supported languages are:
html, xml, css, ebnf, php, javascript, java, haxe, and a few others.
I plan to add ruby, perl, C# and C++ (and C) some time this weekend.
&lt;/p&gt;
&lt;p&gt;
EDIT: Alright, I added those languages. &lt;a href="http://wiki.ahnfelt.dk/HighlighterSamples.html"&gt;Click here to see the examples&lt;/a&gt;.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8729213181221668863-1818294312344153667?l=blog.ahnfelt.dk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.ahnfelt.dk/feeds/1818294312344153667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8729213181221668863&amp;postID=1818294312344153667' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8729213181221668863/posts/default/1818294312344153667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8729213181221668863/posts/default/1818294312344153667'/><link rel='alternate' type='text/html' href='http://blog.ahnfelt.dk/2008/07/new-highlighter-version.html' title='New Highlighter Version'/><author><name>Ahnfelt</name><uri>http://www.blogger.com/profile/13418038848142036358</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_5bNgfobr5U0/SJ4zZPWekUI/AAAAAAAAAAM/CgqG1dzs_yk/s72-c/line-numbers.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8729213181221668863.post-4656115267108293429</id><published>2008-08-08T20:28:00.027+02:00</published><updated>2008-10-31T13:59:11.815+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='highlighting'/><category scheme='http://www.blogger.com/atom/ns#' term='haxe'/><category scheme='http://www.blogger.com/atom/ns#' term='code'/><category scheme='http://www.blogger.com/atom/ns#' term='source'/><category scheme='http://www.blogger.com/atom/ns#' term='syntax'/><category scheme='http://www.blogger.com/atom/ns#' term='script'/><title type='text'>Source Code Syntax Highlighting for Blogs</title><content type='html'>&lt;p&gt;
Ever wanted to include syntax highlighted source code on your blog? Here's one way to do it (for Blogger):
&lt;/p&gt;
&lt;p&gt;
First of all, you should disable automatic insertion of &amp;lt;br&amp;gt;, since those are shown verbatim if placed within &amp;lt;pre&amp;gt;-blocks. You do this under Settings -&gt; Formating -&gt; Convert Linebreaks (or similar, set it to "no").
&lt;/p&gt;
&lt;p&gt;
Then you should include the highlighting script somehow. Go to Settings -&gt; Layout and add a bottom element of type "HTML/JavaScript ". Then paste this in:
&lt;/p&gt;
&lt;pre class="code html"&gt;
&amp;lt;style type="text/css"&amp;gt;
.code {
    background-color:#F0FFEA;
    border:1px dashed #20A000;
    color:#000000;
    padding:6px 6px 6px 6px;
}

.code-line-numbers {
    color:#809080;
    border-right:1px dotted #809080;
    float:left;
    text-align:right;
    width:1.5em;
    padding-right:3px;
    margin-right:12px;
}

.code-code {
    /* This is the box around the actual code 
    (as opposed to .code which is both the 
    code and the line numbers) */
}

.code-keyword {
    font-weight: bold;
    color: #000000;
}

.code-type {
    font-weight: bold;
    color: #106020;
}

.code-variable {
    color: #004050;
}

.code-number {
    color: #F08000;
}

.code-comment {
    color: #208000;
}

.code-string {
    color: #F00000;
}
&amp;lt;/style&amp;gt;
&amp;lt;script type="text/javascript" 
src="http://highlighter.ahnfelt.dk/CodeHighlighter.js"&amp;gt;
&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript"&amp;gt;
CodeHighlighter.highlightAll();
&amp;lt;/script&amp;gt;
&lt;/pre&gt;
&lt;p&gt;
The last few lines load and apply the highlighting. Insert &lt;tt&gt;true&lt;/tt&gt; between the parenthesis in the call to &lt;tt&gt;highlightAll&lt;/tt&gt; to enable line numbers. You could also use another highlighter if you tweaked the above a little.
&lt;/p&gt;
&lt;p&gt;
Now hit save. You're done! To include code in your blog comments, you must write it like &lt;tt&gt;&amp;lt;pre class="code XXX"&amp;gt;CCC&amp;lt/pre&amp;gt;&lt;/tt&gt; where XXX is the language name (for example java) and CCC is your code. One example is:
&lt;/p&gt;
&lt;pre class="code html"&gt;
&amp;lt;pre class="code java"&amp;gt;
public class VisitorDemo {
    static public void main(String[] args) {
        Car car = new Car();
        Visitor printVisitor = new PrintVisitor();
        Visitor doVisitor = new DoVisitor();
        printVisitor.visitCar(car);
        doVisitor.visitCar(car);
    }
}
&amp;lt;/pre&amp;gt;
&lt;/pre&gt;
&lt;p&gt;
Which will show up as:
&lt;/p&gt;
&lt;pre class="code java"&gt;
public class VisitorDemo {
    static public void main(String[] args) {
        Car car = new Car();
        Visitor printVisitor = new PrintVisitor();
        Visitor doVisitor = new DoVisitor();
        printVisitor.visitCar(car);
        doVisitor.visitCar(car);
    }
}
&lt;/pre&gt;
&lt;p&gt;
You may sometimes have to escape &amp;lt; and &amp;gt; with the corresponding codes &amp;amp;lt; and &amp;amp;gt;. The preview won't show the code as highlighted, but it will be when you hit save. 
&lt;/p&gt;
&lt;p&gt;
Now it's time to chose the colors and style you want for your code. Go back to editing the &lt;tt&gt;&amp;lt;style type="text/css"&amp;gt;&lt;/tt&gt; code. It's CSS as you probably know, and it decides nearly everything about how your code looks. If you need more languages, you can ask me to add them or modify the &lt;a href="http://wiki.ahnfelt.dk/Highlighter.html"&gt;source code&lt;/a&gt; and compile it yourself.
&lt;/p&gt;
&lt;p&gt;
That's it, you're done!
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8729213181221668863-4656115267108293429?l=blog.ahnfelt.dk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.ahnfelt.dk/feeds/4656115267108293429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8729213181221668863&amp;postID=4656115267108293429' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8729213181221668863/posts/default/4656115267108293429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8729213181221668863/posts/default/4656115267108293429'/><link rel='alternate' type='text/html' href='http://blog.ahnfelt.dk/2008/08/source-code-syntax-highlighting-for.html' title='Source Code Syntax Highlighting for Blogs'/><author><name>Ahnfelt</name><uri>http://www.blogger.com/profile/13418038848142036358</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry></feed>
