librelist archives

« back to archive

Cross-referencing C++ members in a Sphinx Project

Cross-referencing C++ members in a Sphinx Project

From:
Patrick Cieplak
Date:
2012-09-27 @ 17:02
Greetings,

I have just started using Breathe alongside Sphinx to document a C++ 
project. 

I am wondering if there is a way to cross-reference a particular class 
member from within reStructuredText using a :ref: directive through some 
other mechanism.

Thank you very much,

Patrick

Re: [breathe] Cross-referencing C++ members in a Sphinx Project

From:
Michael Jones
Date:
2012-09-30 @ 08:36
Hi,

I'm sorry for the slow response.  I'm glad to hear you're giving Breathe a go.

I'm afraid that there isn't a way of referencing something in the
output yet but it is a very reasonable request and hopefully shouldn't
be too hard to do.  I can try to take a look this week.  Something
like:

      :doxygenref:`this is my function <project:functionName>`

And it would create a link with the text "this is my function" to
where ever the functionName documentation has been generated?

I'll try to figure something out.

Michael


On Fri, Sep 28, 2012 at 5:02 AM, Patrick Cieplak
<patrick_cieplak@freddiemac.com> wrote:
>
> Greetings,
>
> I have just started using Breathe alongside Sphinx to document a C++
> project.
>
> I am wondering if there is a way to cross-reference a particular class
> member from within reStructuredText using a :ref: directive through some
> other mechanism.
>
> Thank you very much,
>
> Patrick

Re: [breathe] Cross-referencing C++ members in a Sphinx Project

From:
Patrick Cieplak
Date:
2012-10-01 @ 13:48
Hi Michael,

Thank you for your help. So far we have been able to reference functions 
in our project with the following syntax:

        :cpp:func:`myFunction()`

It doesn't seem to be able to handle namespaces at the moment.  Important 
to note, myFunction is not explicitly rendered using a directive, but is 
rather rendered because it is a member of a class that was rendered using 
an explicit directive.  I spent some brief time browsing and ack-greping 
the source, and am wondering which Breathe component is creating the 
doctree nodes in the CPP domain. Is it in the rendering component?

Thanks again,
Patrick





   Michael Jones <m.pricejones@gmail.com> 
   Sent by: breathe@librelist.com
   09/30/2012 04:36 AM
   Please respond to
breathe@librelist.com


To
breathe@librelist.com
cc

Subject
Re: [breathe] Cross-referencing C++ members in a Sphinx Project






Hi,

I'm sorry for the slow response.  I'm glad to hear you're giving Breathe a 
go.

I'm afraid that there isn't a way of referencing something in the
output yet but it is a very reasonable request and hopefully shouldn't
be too hard to do.  I can try to take a look this week.  Something
like:

      :doxygenref:`this is my function <project:functionName>`

And it would create a link with the text "this is my function" to
where ever the functionName documentation has been generated?

I'll try to figure something out.

Michael


On Fri, Sep 28, 2012 at 5:02 AM, Patrick Cieplak
<patrick_cieplak@freddiemac.com> wrote:
>
> Greetings,
>
> I have just started using Breathe alongside Sphinx to document a C++
> project.
>
> I am wondering if there is a way to cross-reference a particular class
> member from within reStructuredText using a :ref: directive through some
> other mechanism.
>
> Thank you very much,
>
> Patrick

Re: [breathe] Cross-referencing C++ members in a Sphinx Project

From:
Michael Jones
Date:
2012-10-02 @ 07:54
Hi,

That's embarrassing for me!  I forgot I'd implemented that.  The docs are
here which seem to suggest that it should work with namespaces but let me
know if it doesn't:

    http://michaeljones.github.com/breathe/domains.html

The actual work is done in:

    breathe.renderer.rst.doxygen.domain

in the CDomainHandler and the CppDomainHandler.

The functions on those classes are called from:

   breathe.renderer.rst.doxygen.compound

For example:



https://github.com/michaeljones/breathe/blob/master/breathe/renderer/rst/doxygen/compound.py#L233

Hope that makes sense, looks like it needs a bit more work to support more
than just classes and functions but it is a start.  Shout if there are
particular ones you'd like me to try to support, else please feel welcome
to try to add support yourself, I'd be happy to answer any questions.

Michael

On Tue, Oct 2, 2012 at 2:48 AM, Patrick Cieplak <
patrick_cieplak@freddiemac.com> wrote:

>
> Hi Michael,
>
> Thank you for your help. So far we have been able to reference functions
> in our project with the following syntax:
>
>         :cpp:func:`myFunction()`
>
> It doesn't seem to be able to handle namespaces at the moment.  Important
> to note, myFunction is not explicitly rendered using a directive, but is
> rather rendered because it is a member of a class that was rendered using
> an explicit directive.  I spent some brief time browsing and ack-greping
> the source, and am wondering which Breathe component is creating the
> doctree nodes in the CPP domain. Is it in the rendering component?
>
> Thanks again,
> Patrick
>
>
>
>
>     *Michael Jones <m.pricejones@gmail.com>*
>    Sent by: breathe@librelist.com
>
>    09/30/2012 04:36 AM
>     Please respond to
> breathe@librelist.com
>
>   To
> breathe@librelist.com
> cc
>   Subject
> Re: [breathe] Cross-referencing C++ members in a Sphinx Project
>
>
>
>
> Hi,
>
> I'm sorry for the slow response.  I'm glad to hear you're giving Breathe a
> go.
>
> I'm afraid that there isn't a way of referencing something in the
> output yet but it is a very reasonable request and hopefully shouldn't
> be too hard to do.  I can try to take a look this week.  Something
> like:
>
>      :doxygenref:`this is my function <project:functionName>`
>
> And it would create a link with the text "this is my function" to
> where ever the functionName documentation has been generated?
>
> I'll try to figure something out.
>
> Michael
>
>
> On Fri, Sep 28, 2012 at 5:02 AM, Patrick Cieplak
> <patrick_cieplak@freddiemac.com> wrote:
> >
> > Greetings,
> >
> > I have just started using Breathe alongside Sphinx to document a C++
> > project.
> >
> > I am wondering if there is a way to cross-reference a particular class
> > member from within reStructuredText using a :ref: directive through some
> > other mechanism.
> >
> > Thank you very much,
> >
> > Patrick
>
>