How to wrap code examples in comments

U

Ubaldo Villaseca

Hi guys,
I tried to post this in (e-mail address removed) but nobody seems to be there.
I'm new on documenting Ruby sources, I have some early opinions about
RDoc but this time and want to ask you something.
I tried to wrap code examples in comments using the following:
# <tt>
# def setUp
# files << File.new()
# end
# </tt>

But it doesn't work, it generates an ugly HTML like
<tt> def setUp

@appStates << AppState1.new()

end </tt>

What am I missing here?

Thanks,
Ubaldo
 
U

Ubaldo Villaseca

I found the answer by accident, just adding extra spaces at the begin
of comment line, but now I have another question, I'm trying to place
a labeled list in two lines like:

# objInputData:: Optional. The input data required by the logic defined in
# derived classes. It's commonly a hash map. Set
to <tt>nil</tt> by default.

Line two HTML is generated in typewriter mode. How could build a
labeled list using multiple lines? Is there a nice site to find more
information about RDoc? http://rdoc.sourceforge.net/doc/index.html
seems to be insufficient.

Thanks a lot.
 
U

Ubaldo Villaseca

I found the answer again, wow this list works great. Just adding or
removing spaces from the second line until RDoc generated the proper
HTML, this is a try-and-error process:

# objInputData:: Optional. The input data sent by the testcase caller
and available to be used by the logic defined in
# derived testcases. It's commonly a hash map. Set to
<tt>nil</tt> by default.

I'm impressed, RDoc is absolutely intuitive and well programmed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top