Forum: Ruby cross-reference RDoc

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2007-07-24 20:32
(Received via mailing list)
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?
852a62a28f1de229dc861ce903b07a60?d=identicon&s=25 Gavin Kistner (phrogz)
on 2007-07-24 21:47
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</a>

Found 1 file (out of 14) in 0.016 seconds
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2007-07-25 17:01
(Received via mailing list)
Gavin Kistner 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</a>

Thanks for the experiment... Now I have to demonstrate why it doesn't
work
when the target is a Test::Unit.
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2007-07-25 23:31
(Received via mailing list)
Gavin Kistner wrote:

> # See Foo#foo
> def bar; end

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

Thanks!
This topic is locked and can not be replied to.