Blog用に手軽にコードを引用したかったのでMac用のテキストエディタCotEditorからrb2htmlを呼び出すスクリプトを書いてみたら、なかなか良い感じだったのでご紹介。 まずは準備です。 rb2htmlをインストールする 下にあるスクリプトを~/Library/Application Support/CotEditor/ScriptMenu/配下のどこかへrb2html.rbというファイル名で保存する rb2html.rbへ実行権を与える(ターミナルからchmod +xする) CotEditorのメニューからスクリプトメニューを更新する #!/usr/bin/env ruby -Ku #%%%{CotEditorXInput=Selection}%%% #%%%{CotEditorXOutput=Pasteboard}%%% require 'rb2html/factory' f
![CotEditorを使ってRubyのコードを簡単にHTMLへ変換する方法 - /etc/services](https://cdn-ak-scissors.b.st-hatena.com/image/square/1d30b2cae069a155f570779c74a9e08dc84efaa9/height=288;version=1;width=512/http%3A%2F%2Fetcservices.cocolog-nifty.com%2F.shared-pleasy%2Fnifty_managed%2Fimages%2Fweb%2Fogp%2Fdefault.png)