3

Is it possible to document ruby script, using RDoc or any other documentation generator , if it does not have any structure inside?

Timb
  • 31
  • 2

1 Answers1

4

RDoc was really designed to be used on code with a structure; for the kind of thing you're talking about, you might look at Rocco. (That link is also an example of Rocco-generated documentation.)

Rocco is a Ruby port of Docco, the quick-and-dirty, hundred-line-long, literate-programming-style documentation generator.

Rocco reads Ruby source files and produces annotated source documentation in HTML format. Comments are formatted with Markdown and presented alongside syntax highlighted code so as to give an annotation effect. This page is the result of running Rocco against its own source file.

Michelle Tilley
  • 157,729
  • 40
  • 374
  • 311
  • I'm currently out of office. Thank you for the quick reply. Will try this today. – Timb Jun 19 '12 at 12:04
  • I'm new to all this stuff. Unfortunatelly i can't install rocco gem. My system is Fedora 17 32 bit, ruby 1.9.3. While typing: gem install rocco, getting the following log. [izia@Fedora1 ~]$ gem install rocco Building native extensions. This could take a while... ERROR: Error installing rocco: ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h Gem files will remain installed in /home/izia/.gem/ruby/1.9.1/gems/redcarpet-2.1.1 for inspection. – Timb Jun 20 '12 at 09:06
  • Finally I've installed the rocco, for some reason I'm getting errors with version 0.8.1 and 0.8.2, but 0.8 works. Is it possible that rocco will run over multiple folders? And another question is it possible to have only commented data inside the html file? – Timb Jun 20 '12 at 18:53