# Extending RDoc with custom sections?

**URL:** <https://www.ruby-forum.com/t/extending-rdoc-with-custom-sections/81936>\
**Category:** Ruby\
**Created:** [January 16, 2007, 12:44pm UTC](https://www.ruby-forum.com/t/extending-rdoc-with-custom-sections/81936 "2007-01-16T12:44:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![el-oy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/958977/32.png) [@el-oy](https://www.ruby-forum.com/u/el-oy)\
**Post date:** [January 16, 2007, 12:44pm UTC](https://www.ruby-forum.com/t/extending-rdoc-with-custom-sections/81936/1 "2007-01-16T12:44:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![el-oy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/958977/32.png) [@el-oy](https://www.ruby-forum.com/u/el-oy)\
**Post date:** [January 16, 2007, 12:50pm UTC](https://www.ruby-forum.com/t/extending-rdoc-with-custom-sections/81936/2 "2007-01-16T12:50:04Z")

</div>

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](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](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

---

<div class="post-metadata">

**Author:** ![el-oy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/958977/32.png) [@el-oy](https://www.ruby-forum.com/u/el-oy)\
**Post date:** [January 16, 2007, 1:07pm UTC](https://www.ruby-forum.com/t/extending-rdoc-with-custom-sections/81936/3 "2007-01-16T13:07:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![el-oy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/958977/32.png) [@el-oy](https://www.ruby-forum.com/u/el-oy)\
**Post date:** [January 16, 2007, 2:01pm UTC](https://www.ruby-forum.com/t/extending-rdoc-with-custom-sections/81936/4 "2007-01-16T14:01:12Z")

</div>

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 🙂

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

---

<div class="post-metadata">

**Author:** ![el-oy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/958977/32.png) [@el-oy](https://www.ruby-forum.com/u/el-oy)\
**Post date:** [January 16, 2007, 2:18pm UTC](https://www.ruby-forum.com/t/extending-rdoc-with-custom-sections/81936/5 "2007-01-16T14:18:30Z")

</div>

> 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

---

<div class="post-metadata">

**Author:** ![el-oy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/958977/32.png) [@el-oy](https://www.ruby-forum.com/u/el-oy)\
**Post date:** [January 16, 2007, 7:26pm UTC](https://www.ruby-forum.com/t/extending-rdoc-with-custom-sections/81936/6 "2007-01-16T19:26:07Z")

</div>

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 🙂
> 
> 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
```

---

<div class="post-metadata">

**Author:** ![el-oy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/958977/32.png) [@el-oy](https://www.ruby-forum.com/u/el-oy)\
**Post date:** [January 17, 2007, 12:58am UTC](https://www.ruby-forum.com/t/extending-rdoc-with-custom-sections/81936/7 "2007-01-17T00:58:19Z")

</div>

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

Cheers,  
Eloy
