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 D. wrote:

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

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

Eloy D. 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

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

Eloy D. 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

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

Cheers,
Eloy