Extending RDoc with custom sections?

E

Eloy Duran

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
 
V

Vincent Fourmond

Eloy said:
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&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
 
E

Eloy Duran

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
 
V

Vincent Fourmond

Eloy said:
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
 
E

Eloy Duran

I've quickly skimmed through the information you provide on several places,
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... :)
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
 
J

Joel VanderWerf

Eloy said:
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
 
E

Eloy Duran

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

Cheers,
Eloy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top