PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.ruby > How to wrap code examples in comments
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
How to wrap code examples in comments

Réponse
 
LinkBack Outils de la discussion
Vieux 13/11/2007, 00h48   #1
Ubaldo Villaseca
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut How to wrap code examples in comments

Hi guys,
I tried to post this in ruby-talk@ruby-lang.org 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

  Réponse avec citation
Vieux 13/11/2007, 02h11   #2
Ubaldo Villaseca
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to wrap code examples in comments

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.

On Nov 12, 2007 7:48 PM, Ubaldo Villaseca <villas82@gmail.com> wrote:
> Hi guys,
> I tried to post this in ruby-talk@ruby-lang.org 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
>


  Réponse avec citation
Vieux 13/11/2007, 02h35   #3
Ubaldo Villaseca
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to wrap code examples in comments

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.

On Nov 12, 2007 9:09 PM, Ubaldo Villaseca <villas82@gmail.com> wrote:
> 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.
>
>
> On Nov 12, 2007 7:48 PM, Ubaldo Villaseca <villas82@gmail.com> wrote:
> > Hi guys,
> > I tried to post this in ruby-talk@ruby-lang.org 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
> >

>


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 13h25.


Édité par : vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13842 seconds with 11 queries