On May 19, 2009, at 11:12 PM, Matthew Turk wrote:
> > Hi there, > > Just as an upfront, I'm loving using sphinx to document a project. > I'm writing because I'm stuck at a particular usage pattern we have in > our code, and how to properly document it. We have objects that have > affiliated "derived quantities" -- to get at these one usually > accesses a dictionary, which then can get called with any number of > arguments. For instance, > > my_object.quantities["MaxLocation"]("Density") > > would call the "MaxLocation" quantity (which is actually an object > with a __call__ method) and return the results. What I'd like to do > is to supply the class and the method and have it appear in the > documentation as: > > my_object.quantities["MaxLocation"] > [docstring] > > identically to how the autodoc extension would work -- rather than > autodocing the underlying class itself, which is not meant to be > accessed directly. Is there a way to supply an override to the > displayed name (in addition to the signature) of an autodoc-processed > object? If not, any hints on where to start in adding this > functionality? I've had good luck generating .rst files programmatically based on data structures like that by running a separate program outside of sphinx. For example, we have a large set of system events in our application. I generate the complete table of all event ids with their associated arguments using a little Python script prior to running sphinx-build. Then I either reference the files from a toctree directive or include them (depending on what I'm generating). It's not as fancy as overriding built-in behavior of sphinx, but it's easy to understand and gets the job done. Doug --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---