# Cross-reference RDoc

**URL:** <https://www.ruby-forum.com/t/cross-reference-rdoc/110270>\
**Category:** Ruby\
**Created:** [July 24, 2007, 8:32pm UTC](https://www.ruby-forum.com/t/cross-reference-rdoc/110270 "2007-07-24T20:32:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [July 24, 2007, 8:32pm UTC](https://www.ruby-forum.com/t/cross-reference-rdoc/110270/1 "2007-07-24T20:32:12Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [July 24, 2007, 9:47pm UTC](https://www.ruby-forum.com/t/cross-reference-rdoc/110270/2 "2007-07-24T21:47:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [July 25, 2007, 5:01pm UTC](https://www.ruby-forum.com/t/cross-reference-rdoc/110270/3 "2007-07-25T17:01:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [July 25, 2007, 11:31pm UTC](https://www.ruby-forum.com/t/cross-reference-rdoc/110270/4 "2007-07-25T23:31:24Z")

</div>

Gavin K. wrote:

> # See Foo#foo
> 
> def bar; end

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

Thanks!
