On 30/01/2011 11:07, werner wrote:
On 29/01/2011 13:43, werner wrote:
I am having my first go at trying to document an application with Sphinx, the application is a framework I try to learn which has no searchable documentation, so I thought I might as well learn how to document it with Sphinx.

I am running into a problem that super classes contained in top level .py files (the ones at the package folder) don't get linked correctly.

For example:

foo.py contains class foo and foo.py is in package x

In the code some other class inherits from class foo by doing

from x.foo import foo

class anotherClass(foo):

Now when documenting anotherClass I get for the super class "x.foo.foo" but when documenting foo I get "foo.foo" i.e. without the top level package.

I hope I am explaining this well enough.

I guess I need to somehow tell Sphinx that class x.foo.foo is documented as class foo.foo to make sure that e.g. Inheritance diagrams can link to the correct class documentation etc.

Can someone give me some hints on what I need to do.
Werner

Made a bit of progress but can't quit figure it out, added a :module:: for each class helped, but caused other links not to work.

Maybe an image might explain this all much better. Anything prefixed with "dabo." is not clickable in the following diagram, and the definition for e.g. dabo.dObject.dObject is:

Inheritance diagram for: *dApp*

Inheritance diagram of dApp


Then re-read the currentmodule/module stuff again and changed e.g. dabo.dObject.dObject which was not linked (i.e. not clickable) to this:

.. module:: dabo.dObject
.. currentmodule:: dObject

I.e. added "dabo." to the module definition. Great now it is linked, BUT, now all the others which worked before e.g. dApp.dApp and dApp.TempFileHolder etc are no longer linked.

The .rst files are generated and not hand coded, and the base (super) classes are queried with "sups = list(obj.__bases__)" and they sometimes have the "dabo." package name prefixed and sometimes not, I think it depends on the way one does the import.

Any tip on how I can have both everything linked?

Werner

P.S.
Python 2.6.5
Sphinx 1.0.4

P.S. 2 I also tried:
.. module:: dabo.dObject
.. currentmodule:: dabo.dObject

I can't make it work that both "dabo.dObject.dObject" and "dObject.dObject" links in e.g. Inheritance diagrams work.

The package structure is:
dabo
- biz
- lib
etc

all the modules in the dabo package I define it like this:
.. module:: dObject
.. currentmodule:: dObject

Anything in sub-packages, e.g. biz is defined like this:
.. module:: dabo.biz.RemoteBizobj
.. currentmodule:: biz.RemoteBizobj

Is above correct?  Or is this problem caused by something else I am doing?

Werner

--
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

<<image/png>>

Reply via email to