Cross-reference RDoc

Ruby zealots:

I want RDoc to document two modules. One contains def foo and the
other def bar.

I want the comment for foo to link to bar, so I write # See: bar

If bar were in the same module as foo, RDoc would hyperlink its name.

How do I get this effect working between modules? How can foo’s
module’s document contain a hyperlink to bar?

Phlip wrote:

I want RDoc to document two modules. One contains def foo and the
other def bar.

I want the comment for foo to link to bar, so I write # See: bar

If bar were in the same module as foo, RDoc would hyperlink its name.

How do I get this effect working between modules? How can foo’s
module’s document contain a hyperlink to bar?

C:>type foo.rb
module Foo

See Bar#bar

def foo; end
end

C:>type bar.rb
module Bar

See Foo#foo

def bar; end
end

C:>rdoc *.rb

                         bar.rb: m.
                         foo.rb: m.

Generating HTML…

Files: 2
Classes: 0
Modules: 2
Methods: 2
Elapsed: 0.235s

C:>findfile html$ Bar#bar
./doc/classes/Foo.html
=“Bar.html#M000002”>Bar#bar

Found 1 file (out of 14) in 0.016 seconds

Gavin K. wrote:

I want RDoc to document two modules. One contains def foo and the
other def bar.

I want the comment for foo to link to bar, so I write # See: bar

If bar were in the same module as foo, RDoc would hyperlink its name.

How do I get this effect working between modules? How can foo’s
module’s document contain a hyperlink to bar?

/doc/classes/Foo.html
=“Bar.html#M000002”>Bar#bar

Thanks for the experiment… Now I have to demonstrate why it doesn’t
work
when the target is a Test::Unit.

Gavin K. wrote:

See Foo#foo

def bar; end

And that was the secret - the complete type-path with #.

Thanks!