If you look at the Ruby In Twenty Minutes page here
http://www.ruby-lang.org/en/documentation/quickstart/ you will see they
have some nice formatted html from IRB console. How does one go about
getting that into a word processor such as MS Word? I need this for a
little book I'm writing on Ruby for numerical methods.
I have been successful in getting nicely formatted code from NetBeans
into Word using the print html command. I use the Dark Pastels theme and
it looks great. Now I just need the IRB printouts...
Thank you!
···
--
Posted via http://www.ruby-forum.com/.
Here is my best solution so far:
Use http://tryruby.org/ to generate the html I need for my document then
paste it right in.
I would have loved to see it the same color theme as that used on
ruby-lang.org but oh well.
Jason
···
--
Posted via http://www.ruby-forum.com/.
This is a nice library. Thank you!
···
--
Posted via http://www.ruby-forum.com/.
Your could pass your whole code through CodeRay:
···
Am 04.01.2011 19:15, schrieb Jason Lillywhite:
Here is my best solution so far:
Use http://tryruby.org/ to generate the html I need for my document then
paste it right in.
I would have loved to see it the same color theme as that used on
ruby-lang.org but oh well.
Jason
--------------------------
require "coderay"
html = CodeRay.scan("puts 'Your Code goes here!'", :ruby).html(:wrap =>
:div)
puts html
------------------------
The according CSS stylesheet is outputted by the shell command
$ coderay_stylesheet
CodeRay is available as a gem:
# gem install coderay
Vale,
Marvin