Extending RDoc with custom sections?

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 :slight_smile:

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

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 :slight_smile:

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&atid=2474

  and some (little) information about it:

http://vincent.fourmond.neuf.fr/blog/RDoc_hooks

  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.fourmond.neuf.fr/

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 :slight_smile:

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

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 :slight_smile:

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 :slight_smile:
>
> 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&atid=2474

  and some (little) information about it:

http://vincent.fourmond.neuf.fr/blog/RDoc_hooks

  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.fourmond.neuf.fr/

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 :slight_smile:
>
> 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 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 :slight_smile:

  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.fourmond.neuf.fr/

> 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... :slight_smile:

> 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 :slight_smile:

  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 :slight_smile:

Cheers,
Eloy