[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Extending RDoc with custom sections?

Eloy Duran

1/16/2007 11:44:00 AM

Hello peeps!

I'm in the process of converting Apple's Cocoa reference docs to
RubyCocoa style RDoc source/comments.
This is working out rather well :)

The only problem I have run into is that I need extra sections like
the constants one, but for Notifications and possibly others too.

Are there people with experience in this area or know of a project
that extends RDoc in such a way??
Or any help in this direction?

Cheers,
Eloy

6 Answers

Vincent Fourmond

1/16/2007 11:50:00 AM

0

Eloy Duran wrote:
> Hello peeps!
>
> I'm in the process of converting Apple's Cocoa reference docs to
> RubyCocoa style RDoc source/comments.
> This is working out rather well :)
>
> The only problem I have run into is that I need extra sections like
> the constants one, but for Notifications and possibly others too.
>
> Are there people with experience in this area or know of a project
> that extends RDoc in such a way??
> Or any help in this direction?

I wrote some code to extend rdoc to understand other kinds of
statements, see my patch for rdoc there:

http://rubyforge.org/tracker/?func=detail&aid=6938&group_id=627&...

and some (little) information about it:

http://vincent.fourmon...blog/...

I'll be glad to hear if you manage to make it work for you (and also
if you don't).

Cheers,

Vince

--
Vincent Fourmond, PhD student
http://vincent.fourmon...

Eloy Duran

1/16/2007 12:06:00 PM

0

Thanks for the quick reply Vincent!

I've quickly skimmed through the information you provide on several places,
but I failed to find any info about adding a extra section.
If I understand correctly your patch adds the ability to define extra
'methods', their args and description etc. right?

However if I don't find any substantial info about the subject that
I'm looking for,
your code will probably be a nice guide into the depths of rdoc :)

Cheers,
Eloy

On 1/16/07, Vincent Fourmond <vincent.fourmond@9online.fr> wrote:
> Eloy Duran wrote:
> > Hello peeps!
> >
> > I'm in the process of converting Apple's Cocoa reference docs to
> > RubyCocoa style RDoc source/comments.
> > This is working out rather well :)
> >
> > The only problem I have run into is that I need extra sections like
> > the constants one, but for Notifications and possibly others too.
> >
> > Are there people with experience in this area or know of a project
> > that extends RDoc in such a way??
> > Or any help in this direction?
>
> I wrote some code to extend rdoc to understand other kinds of
> statements, see my patch for rdoc there:
>
> http://rubyforge.org/tracker/?func=detail&aid=6938&group_id=627&...
>
> and some (little) information about it:
>
> http://vincent.fourmon...blog/...
>
> I'll be glad to hear if you manage to make it work for you (and also
> if you don't).
>
> Cheers,
>
> Vince
>
> --
> Vincent Fourmond, PhD student
> http://vincent.fourmon...
>
>

Vincent Fourmond

1/16/2007 1:01:00 PM

0

Eloy Duran wrote:
> I've quickly skimmed through the information you provide on several places,
> but I failed to find any info about adding a extra section.
> If I understand correctly your patch adds the ability to define extra
> 'methods', their args and description etc. right?

Exactly. But, presumably, you'll need to parse a different syntax to
add contents to this new section ? Something of the like:

class NiceStuff
my_stuff :nice_code, 'to be put in the new section'
end

For that, the code I wrote may come in useful ;-)...

> However if I don't find any substantial info about the subject that
> I'm looking for,
> your code will probably be a nice guide into the depths of rdoc :)

I'm afraid I essentially meant it as a guide, but I'll be glad if you
shared your findings: a combination of what I wrote and what you're
looking for could be a very nice addition to rdoc.

Cheers,

Vincent
--
Vincent Fourmond, PhD student
http://vincent.fourmon...

Eloy Duran

1/16/2007 1:18:00 PM

0

> > I've quickly skimmed through the information you provide on several places,
> > but I failed to find any info about adding a extra section.
> > If I understand correctly your patch adds the ability to define extra
> > 'methods', their args and description etc. right?
>
> Exactly. But, presumably, you'll need to parse a different syntax to
> add contents to this new section ? Something of the like:
>
> class NiceStuff
> my_stuff :nice_code, 'to be put in the new section'
> end
>
> For that, the code I wrote may come in useful ;-)...

Yes that's true... :)

> > However if I don't find any substantial info about the subject that
> > I'm looking for,
> > your code will probably be a nice guide into the depths of rdoc :)
>
> I'm afraid I essentially meant it as a guide, but I'll be glad if you
> shared your findings: a combination of what I wrote and what you're
> looking for could be a very nice addition to rdoc.

Indeed, once (and if) I have the time to wrap this up myself
I'll obviously share my findings. Because RDoc is in some desperate need
to be easily customizable :)

Cheers,
Eloy

Joel VanderWerf

1/16/2007 6:26:00 PM

0

Eloy Duran wrote:
> Hello peeps!
>
> I'm in the process of converting Apple's Cocoa reference docs to
> RubyCocoa style RDoc source/comments.
> This is working out rather well :)
>
> The only problem I have run into is that I need extra sections like
> the constants one, but for Notifications and possibly others too.

I'm naive about Cocoa, but I just wanted to make sure you're aware of
the "section" directive in RDoc:

# ------------------------
# :section: accessor methods
#
# This section contains methods to access variables
#
# ------------------------
def foo=(x); ...; end

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Eloy Duran

1/16/2007 11:57:00 PM

0

Aha! That my dear sir is exactly what I missed!
Thank you very much.

Cheers,
Eloy

On 1/16/07, Joel VanderWerf <vjoel@path.berkeley.edu> wrote:
> Eloy Duran wrote:
> > Hello peeps!
> >
> > I'm in the process of converting Apple's Cocoa reference docs to
> > RubyCocoa style RDoc source/comments.
> > This is working out rather well :)
> >
> > The only problem I have run into is that I need extra sections like
> > the constants one, but for Notifications and possibly others too.
>
> I'm naive about Cocoa, but I just wanted to make sure you're aware of
> the "section" directive in RDoc:
>
> # ------------------------
> # :section: accessor methods
> #
> # This section contains methods to access variables
> #
> # ------------------------
> def foo=(x); ...; end
>
> --
> vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
>
>