RDoc preview in Textmate

Posted by Jason Noble on 04/24/2009 in Uncategorized |

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.

Copyright © 2008-2024 Jason Noble's Technical Adventures All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.5, from BuyNowShop.com.