# Making rdoc see module-level documentation

**URL:** <https://rubytalk.org/t/making-rdoc-see-module-level-documentation/36526>\
**Category:** ruby-talk\
**Created:** [29 March 2007 05:34 UTC](https://rubytalk.org/t/making-rdoc-see-module-level-documentation/36526 "2007-03-29T05:34:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Candler](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@Brian\_Candler](https://rubytalk.org/u/Brian_Candler)\
**Post date:** [29 March 2007 05:34 UTC](https://rubytalk.org/t/making-rdoc-see-module-level-documentation/36526/1 "2007-03-29T05:34:33Z")

</div>

I'm having trouble getting rdoc to display the top-level documentation for a  
module.

A test case is attached below:

- lib/zzz/zzz.rb contains my main overview documentation about the 'Zzz'  
&nbsp;&nbsp;module. I want this to be displayed when the user clicks on Zzz.

- lib/zzz/bar.rb and lib/zzz/foo.bar contain other classes in module Zzz.

- I generate the HTML using any of these three commands:

&nbsp;&nbsp;rake doc  
&nbsp;&nbsp;rdoc lib  
&nbsp;&nbsp;rdoc lib/zzz/zzz.rb lib/zzz/bar.rb lib/zzz/foo.rb

However, clicking on Zzz doesn't show the module level documentation  
(although the constants defined in lib/zzz/zzz.rb are shown). In fact, the  
module level documentation isn't included anywhere.

&nbsp;&nbsp;$ find doc -type f | xargs grep -i interesting  
&nbsp;&nbsp;$

If I put comments at the top of lib/zzz/bar.rb they are displayed. But  
that's not really a logical place to put them, and will break if I later add  
lib/zzz/aardvark.rb

So, is there a way to tell rdoc to take its module documentation from a  
particular file?

Thanks,

Brian.

==\> ./lib/zzz/zzz.rb \<==  
=begin  
This is the background info on the Zzz module

Lots of interesting stuff goes here  
=end

module Zzz

MAX\_SLEEP\_WINKS = 40  
class ZzzError \< RuntimeError; end  
end

==\> ./lib/zzz/bar.rb \<==  
module Zzz  
class Bar  
end  
end

==\> ./lib/zzz/foo.rb \<==  
module Zzz  
class Foo  
end  
end

==\> ./Rakefile \<==  
require 'rake/rdoctask'

task :default do  
&nbsp;&nbsp;puts "Type 'rake --tasks' for a list of options"  
end

Rake::RDocTask.new("doc") { |rdoc|  
&nbsp;&nbsp;rdoc.rdoc\_dir = 'doc'  
&nbsp;&nbsp;rdoc.title = "Application Documentation"  
&nbsp;&nbsp;rdoc.options \<\< '--line-numbers' \<\< '--inline-source'  
&nbsp;&nbsp;rdoc.rdoc\_files.include('lib/\*\*/\*.rb')  
}
