user502052
user502052

Reputation: 15257

How to use the `:include:` directive using RDoc?

I am using Ruby on Rails 3.0.7 and I am writing some documentation for my application using RDoc. Since I have not found on the Web some good documentation with examples, what I would like to know is how to use the :include: directive at all.

Can you make me an example of using that in application files?

Upvotes: 1

Views: 718

Answers (2)

apneadiving
apneadiving

Reputation: 115541

Here is the doc: http://rdoc.rubyforge.org/RDoc/Markup.html

And here is a very basic example:

First a ruby file, say /tests/my_func.rb

#:include: doc.txt 

def my_function
  puts "yo"
end 

Then a doc /tests/documentations/doc.txt

This describes the method very well

In command line (executed from /tests):

rdoc -i /Users/benjaminroth/Sites/Tests/rdoc/descriptions

Upvotes: 0

s.m.
s.m.

Reputation: 8043

AIUI, :include: allows you to (surprise) include the contents of another file, keeping the same indentation level of the block in which the include appears.

It will look for the named file in the current directory, but it's something you can override by means of the --include switch.

If you want an example, this could prove useful.

Upvotes: 0

Related Questions