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.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.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
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 dAppThen 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:: dObjectI.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 -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-dev@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
<<inline: inheritance-8bfb352d876ff30ad8025b34ff9cc6b08de83104.png>>