Reputation: 15257
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
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
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