List Info

Thread: How to wrap code examples in comments




How to wrap code examples in comments
user name
2007-11-12 17:07:21
Hi guys,
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


Re: How to wrap code examples in comments
country flaguser name
United States
2007-11-14 00:35:22
On Nov 12, 2007, at 15:07 , Ubaldo Villaseca wrote:

> Hi guys,
> 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?

# You can do blah blah blah like this:
#
#   class MyClass < YourClass
#     def initialize
#       files = []
#     end
#   <-- important trailing whitespace here
#     def some_method
#     end
#   end

--
Poor workers blame their tools. Good workers build better
tools. The
best workers get their tools to do the work for them. --
Syndicate Wars




[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )