views:

28

answers:

2

When using the Darkfish RDoc generator to generate RDoc documentation, next to methods there is a Click to toggle source button next to each method. It isn't working for me when I generate my documentation, so how do you get that feature to work, do you have to add a keyword into your RDoc source or something? alt text

+1  A: 

It seems to be enabled by default. I just tried a quick test with rdoc v2.5.11 :-

$ mkdir temp
$ cd temp
$ cat temp.rb

class MyClass
  def my_method; end
end

$ rdoc
Parsing sources...
100% [ 1/ 1]  temp.rb                                                           

Generating Darkfish...

Files:         1
Classes:       1 (    1 undocumented)
Constants:     0 (    0 undocumented)
Modules:       0 (    0 undocumented)
Methods:       1 (    1 undocumented)
  0.00% documented

Elapsed: 0.1s
$ open doc/index.html

When I click on the link for #my_method and I hover over the description of the method, I see the "click to toggle source" link and it works when I click it.

You will need javascript enabled in your browser to make this work.

floehopper
Ok thanks for letting me know that it is on by default. This means something is wrong with my setup or something because I am running it on Safari 5 with JS enabled ... so idk what is causing it.
agentbanks217
+1  A: 

I am having the same problem with my Rails3 code. Its pretty generic and I don't remember playing with the RDoc setup, but my click to toggle source doesn't work either. I know that JS is turned on and their haven't been any errors when I run rake doc:app so I'm not quite sure whats going on.

The only thing I can think of is that I'm running Ruby 1.9.2 / Rails 3.0.0 under RVM. Does that make a difference?

UPDATE: I noticed that its trying to load non-existent Javascript files from a js directory. Is RDoc supposed to insert the JS files or are you supposed to do it manually?

RNHurt
I have no idea lol. We are have the same setup, so if you happen to find out how to fix it, please update your answer.
agentbanks217
Eh, I think I'm switching to YARD. It's where all the cool kids are playing nowadays, and it's "Show Source" works properly.
RNHurt