Feature #1068

Cross link Sphinx and Doxygen docs

Added by Deil Christoph over 10 years ago. Updated over 9 years ago.

Status:ClosedStart date:01/09/2014
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:3rd coding sprint
Duration:

Description

Most of the times a class or method is mentioned in the user manual Sphinx docs it should actually be a link to the API doxygen docs.
Maybe we also want the other way around, i.e. link form Doxygen to Sphinx in a few places, but that is far less important.

I haven’t done this before, but a quick Google search suggests it should be easy:
http://pythonhosted.org/sphinxcontrib-doxylink/
http://stackoverflow.com/questions/11246637/using-sphinx-apidoc-to-generate-documentation-from-c-code
http://michaeljones.github.io/breathe/

Here’s an example of a project that does this:
http://image.diku.dk/shark/sphinx_pages/build/html/rest_sources/tutorials/first_steps/hello_shark.html
they even describe how it works:
http://image.diku.dk/shark/sphinx_pages/build/html/rest_sources/tutorials/for_developers/managing_the_documentation.html

I’ll have a look and try and implement it for GammaLib when I get a chance.


Recurrence

No recurrence.

History

#1 Updated by Deil Christoph over 10 years ago

Here’s a working prototype how to link from Sphinx to Doxygen using https://pypi.python.org/pypi/sphinxcontrib-doxylink :
https://github.com/cdeil/gammalib/compare/issue_1068
It’s just for illustration and uses hardcoded PATHs, don’t merge it.

Jürgen, can you implement this properly into the GammaLib autotools build?
Here’s an example how to do it:
https://github.com/chrisvana/shark_copy/blob/master/doc/sphinx_pages/conf.py.in#L19

I haven’t looked at how to link from Doxygen to Sphinx, I suggest we don’t implement this for now and wait if the need comes up.

#2 Updated by Deil Christoph over 10 years ago

  • Status changed from New to In Progress
  • Assigned To changed from Deil Christoph to Knödlseder Jürgen
  • Target version changed from 2nd coding sprint to 00-08-00

#3 Updated by Deil Christoph over 10 years ago

Once this is integrated into the GammaLib build system there’s two more things to do:

  • Figure out why these errors occur when `doxylink` parses the tag file:
    https://gist.github.com/cdeil/8416583
  • Go through the RST docs and add :doxy: directives for all the GammaLib classes / functions.

I could quickly do this, so please re-assign to me if you want me to.

#4 Updated by Knödlseder Jürgen over 10 years ago

  • Target version changed from 00-08-00 to 2nd coding sprint

#5 Updated by Knödlseder Jürgen over 10 years ago

Following actions are needed:
  • change conf.py to conf.py.in to make the script configurable
  • check whether the special Sphinx python package exists on the system (in configure.ac)
  • modify conf.py.in to add automake options / directives
  • add generation of this file to configure.ac

#6 Updated by Deil Christoph almost 10 years ago

Turns out no changes to the build system are needed.

Could you please review this:
https://github.com/cdeil/gammalib/compare/issue_1068

I plan to continue working on the docs in the next few days, but maybe it would make sense to merge this now and continue in a new branch?

#7 Updated by Knödlseder Jürgen almost 10 years ago

  • Status changed from In Progress to Resolved
  • Target version changed from 2nd coding sprint to 3rd coding sprint
  • % Done changed from 0 to 100

I merged in the change. So I close the issue.

#8 Updated by Knödlseder Jürgen almost 10 years ago

  • Status changed from Resolved to In Progress
  • % Done changed from 100 to 80

Not yet finished, reopen.

#9 Updated by Deil Christoph almost 10 years ago

There’s two remaining small issues ... I’ve emailed the sphinxcontrib-doxylink author yesterday ... simplest to just paste the email here than to re-describe the issue:

On 08 Jul 2014, at 14:16, Christoph Deil <> wrote:

Dear Matt,

thanks for creating sphinxcontrib-doxylink!!!

I am currently adding it to GammaLib [1] and I’m getting a few parser errors [2].
The tag file is here: [3].

Please let me know if you need any other info or if the error is in our code or Doxygen file.

Cheers, Christoph

[1] http://gammalib.sourceforge.net/
[2] https://gist.github.com/cdeil/70fcaa3c0127305bac5a
[3] https://gist.githubusercontent.com/cdeil/3da996b6848f4c825dfc/raw/GammaLib.tag

Hello again,

another issue I noticed is that linking to some methods doesn’t work (whereas most methods work fine).

E.g. I wanted to link via :doxy:`GObservation::model` to this method:
http://gammalib.sourceforge.net/doxygen/classGObservation.html#a80484fbd8d218c0dc5264e600851de09

but I get this error:
/Users/deil/code/gammalib/doc/source/user_manual/modules/model.rst:27: WARNING: Could not find match for `GObservation::model` in `doc/html/doxygen/GammaLib.tag` tag file

I think this is the relevant entry in the GammaLib.tag file so it should work?

&lt;member kind="function" virtualness="virtual"&gt;
&lt;type&gt;virtual double&lt;/type&gt;
&lt;name&gt;model&lt;/name&gt;
&lt;anchorfile&gt;classGObservation.html&lt;/anchorfile&gt;
&lt;anchor&gt;a80484fbd8d218c0dc5264e600851de09&lt;/anchor&gt;
&lt;arglist&gt;(const GModels &amp;models, const GEvent &amp;event, GVector *gradient=NULL) const &lt;/arglist&gt;
&lt;/member&gt;

Cheers,
Christoph

#10 Updated by Deil Christoph almost 10 years ago

At the moment the online docs have broken links that look like

:doxy:`GOptimizerFunction`

all over the place because `sphinxcontrib.doxylink` is not installed on the machine that runs `make doc`.

See e.g. here:
http://gammalib.sourceforge.net/user_manual/modules/opt.html

#11 Updated by Knödlseder Jürgen almost 10 years ago

This needs installation of https://pypi.python.org/pypi/sphinxcontrib-doxylink on the server that is used to build the documentation. Seems not trivial for the moment, but can certainly be solved.

#12 Updated by Knödlseder Jürgen over 9 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 80 to 100

I moved the documentation generation to a newer server, and this works now properly.

Also available in: Atom PDF