[RDOC] Creating my own section in a page

Hi all,

I've got a C extension that I want to rdocify. It works well enough,
but I have a couple of constants I want included in the documentation.

I see that rdoc generates "Methods", "Public Class Methods", etc, for
the class. But, I want to add a "Constants" section on that page and
explicitly document a couple of constants.

Is this possible? How should I comment it in the C code?

Regards,

Dan

Not right now (although you could just list them in the file-level heading). I _could_ handle the various rb_xxx_const methods, but I'm not sure I'd know where to look for the associated comment.

Cheers

Dave

···

On Oct 30, 2004, at 16:33, Daniel Berger wrote:

I see that rdoc generates "Methods", "Public Class Methods", etc, for
the class. But, I want to add a "Constants" section on that page and
explicitly document a couple of constants.

Is this possible? How should I comment it in the C code?

Dave Thomas <dave@pragprog.com> wrote in message news:<C9299202-2AFD-11D9-A41D-000A95676A62@pragprog.com>...

···

On Oct 30, 2004, at 16:33, Daniel Berger wrote:

> I see that rdoc generates "Methods", "Public Class Methods", etc, for
> the class. But, I want to add a "Constants" section on that page and
> explicitly document a couple of constants.
>
> Is this possible? How should I comment it in the C code?

Not right now (although you could just list them in the file-level
heading). I _could_ handle the various rb_xxx_const methods, but I'm
not sure I'd know where to look for the associated comment.

Cheers

Dave

How about a Document-constant: directive? Another alternative is to
use any comment to the right of rb_define_const, e.g.

rb_define_const(klass,"FOO",50); /* The FOO constant is blah, blah */

Or both. :slight_smile:

Regards,

Dan