RDOC: several related modules in several C files

Discussion in 'Ruby' started by Victor \Zverok\ Shepelev, Mar 6, 2007.

  1. Hi all!

    I have a pretty large extension I want to document with RDoc.

    The problem is, I have several files:

    htmr_main.cpp:
    ...
    rb_mHtmr = rb_define_module("Htmr");
    ...

    htmr_constants.cpp:
    ==================
    ...
    rb_mHtmrConstants = rb_define_module_under(rb_mHtmr, "Constants");
    ...

    The problem with such organization: RDoc says "Enclosing class/module
    'rb_mHtmr' for module Constants not known".

    I can:
    1. move the line "rb_mHtmr = ..." to htmr_constants.cpp, but rb_mHtmr is
    used not only from this file.
    2. move the line "rb_mHtmrConstants = ..." to htmr_main.cpp, but in this
    case all othre contents of htmr_constants.cpp is ignored by Rdoc.
    3. join all files of the extension into one huge file, but it will be ugly
    :(

    Was I miss something?

    Thanks.

    V.
     
    Victor \Zverok\ Shepelev, Mar 6, 2007
    #1
    1. Advertising

  2. Victor \Zverok\ Shepelev

    Max Lapshin Guest


    > The problem with such organization: RDoc says "Enclosing class/module
    > 'rb_mHtmr' for module Constants not known".


    I've done the following with my extensions:
    while creating documentation, I've concatenated all data in one file and
    rdoc is parsing one file.

    --
    Posted via http://www.ruby-forum.com/.
     
    Max Lapshin, Mar 16, 2007
    #2
    1. Advertising

  3. Victor \Zverok\ Shepelev

    Max Lapshin Guest


    > as in my sources there are many other problems for RDoc, like shortcut
    > macro


    These shortcuts seems to be one of the greatest problem. The only way to
    bypass them is to use some sort of C->xml compilers in RDoc (to make it
    very complicated), or to create some sort of explicit binding C
    functions to ruby methods

    --
    Posted via http://www.ruby-forum.com/.
     
    Max Lapshin, Mar 16, 2007
    #3
  4. Victor \Zverok\ Shepelev

    Max Lapshin Guest


    > BTW, I've found even \t (Tab) symbol in sources confuses RDoc
    >


    Yes, RDoc seems to be a rather confusable thing =)
    I think, that there is no use in trying to make a perfect RDoc for C
    extensions, so You hack is OK. You can also make the following:
    preprecess sources before RDoc-ing them. Thus, all You macroses will be
    expanded to rb_define_method

    --
    Posted via http://www.ruby-forum.com/.
     
    Max Lapshin, Mar 16, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Schwarz
    Replies:
    6
    Views:
    253
    Randy W. Sims
    Jan 1, 2004
  2. Brian Schröder
    Replies:
    5
    Views:
    140
    Dave Thomas
    Sep 18, 2004
  3. Daniel Berger
    Replies:
    1
    Views:
    144
    Dave Thomas
    Nov 2, 2004
  4. Iwan van der Kleyn

    rdoc: how to add readme.rdoc as index.html?

    Iwan van der Kleyn, Apr 26, 2005, in forum: Ruby
    Replies:
    1
    Views:
    234
    Stefan Lang
    Apr 26, 2005
  5. Paul Van Delst

    How to use rdoc parsers outside of rdoc?

    Paul Van Delst, Jul 27, 2006, in forum: Ruby
    Replies:
    0
    Views:
    105
    Paul Van Delst
    Jul 27, 2006
Loading...

Share This Page