I got to some solution today, although it is a hack:

1. A function connected to autodoc-process-signature asks for __doc__
of the object it receives; __doc__ is scanned for the :ydefault:`(.?
*)` role. If it is found, it's added to the signature of that
attribute.

2. The :ydefault: role itself is defined to expand to nothing, so that
it doesn't end in both signature and docstring.

It looks like this: 
https://www.yade-dem.org/sphinx/yade.wrapper.html#yade.wrapper.CpmMat
. Sweet.

Cheers, Vaclav

> The classes are exposed from c++ via boost::python. Attribute's
> docstrings are supplied by me. I suppose the help(..) function returns
> raw docstrings, so below is parts of output from help(CpmPhys).
> The :ydefault: roles specifies default value, [m²] is units obviously
> (that could be changed to :yunit:`m²`, if necessary).

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-...@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.

Reply via email to