Eventually (in the far distint future) I want to set up my own server to host rails apps on and perhaps a blog driven by Mephisto - particularly cause you can get good syntax highlighting plugins for it.
In the meantime, I discovered that you can export your current highlighting theme from textmate as CSS, using the bundle command 'Create CSS From Current Theme' (vaguely enough ;) ). Then any time I want to post code snippets here, I use the similarly vague command 'Create HTML From Document'
All you need to do is copy and paste the CSS into your Blogger template.
Beautiful.
Wednesday, 21 March 2007
Subscribe to:
Post Comments (Atom)
4 comments:
Could you post your css here? Since I don't have textmate around, thanks.
Yi Wen,
Apologies for the delay in replying. Unfortunately the css wont be of any use to you without textmate.
For example - if I want to pretty print:
def test
foo
end
Textmate just wraps each word in a html span. One class for a keyword, one class for a variable, etc...
<pre class="textmate-source"><span class="source source_ruby source_ruby_rails"><span class="meta ...
foo
<span class="keyword keyword_control keyword_control_ruby">end</span></span></pre>
My corresponding css file just defines the colour of each class.
I'm not sure, but other editors may give you the same html/css 'pair'. Feel free to mail me and I'll try to be of more help.
I made something similar if you're interested:
Check it out here:
http://heim.ifi.uio.no/~ivarref/blogger/hoho.html
Check out the source for the file. You can have one line code snippets with syntax highlighting and some other features.
I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.
Ruth
http://fendisite.com
Post a Comment