RDoc preview in Textmate
While working on writing some RDOC documentation within Textmate, Rein Henrichs and I ran into a problem. Textmate will give you previews if you use markdown, but not RDOC. Below is how to do it.
Create /usr/bin/rdoc2html:
[text]
#!/usr/bin/env ruby -rrdoc/markup/simple_markup -rrdoc/markup/simple_markup/to_html
input = ARGF ? ARGF.read : STDIN.read
print SM::SimpleMarkup.new.convert(input, SM::ToHtml.new)
[/text]
Make the file executable:
[text]
sudo chmod +x /usr/bin/rdoc2html
[/text]
In textmate, hit Cntrl-Option-Command-P. In the bottom left corner, click Show options. Click the Pipe text through checkbox and enter “/usr/bin/rdoc2html” in the text box.