Friday, June 26, 2009

ruby code format test

天哪!! 我成功了!! 原本是想說開始學ruby了,也應該像C# code一樣去找個formatter來用,這樣以後要貼code比較好看,結果找來找去,好像ruby本身就提供把code轉成html tags的function!! Ruby真的是programmer的好朋友!!!
in_data = Clipboard.data
convertor = Syntax::Convertors::HTML.for_syntax "ruby"
code_html = convertor.convert(in_data)
Clipboard.set_data(code_html)

過程還是有點卡XD 晚點整理好再來分享~

Comments

0 Responses to "ruby code format test"

Post a Comment

Tags