-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 23.08.2010 08:44, schrieb nagylzs:
> 
> In my ~/shopzeus/db/pivot/convert.py file, in the run() method of my
> Data2Facts class, I can write this into the docstring:
> 
> 
> class Data2Facts(threading.Thread):
>     # code here...
>     def prepare(self,*args):
>         # code here...
>     # more code here
>     def run(self):
>         """
>         Start data conversion.
> 
>         You need to call :meth:`prepare`  before starting the
> conversion with :meth:`run`.
>         """
>         # more code here...
> 
> This works perfectly. It places cross links in the HTML documentation.
> 
> I have another file where I'm writting a tutorial for the whole
> package. From the tutorial, I would like to make references to the
> API.
> 
> I can do this:
> 
> 
> The :meth:`shopzeus.db.pivot.convert.Data2Facts.prepare` method is
> used for perparing conversion from tabluar format into multi-
> dimensional format.
> 
> However, I do not want to write "shopzeus.db.pivot.convert." every
> time. I want to make this my current module for cross-referencing. I
> have already tried this:
> 
> .. :currentmodule:: shopzeus.db.pivot.convert
> 
> The :meth:`Data2Facts.prepare` method is used for perparing conversion
> from tabluar format into multi-dimensional format.
> 
> But it does not work! In the rendered HTML it is displayed in bold,
> but there is no link. The sphinx build command does not give me any
> warnings about invalid references. What am I doing wrong?

If you entered the directive as above, the colon before "currentmodule"
is wrong.  It makes the parser see the line a reST comment (everything
starting with two dots that is not explicit syntax is a comment).

BTW, with Sphinx 1.x you can also do

:meth:`.Data2Facts.prepare`

without declaring the current module; the leading dot will cause a fuzzy
search within all potential identifiers.  You will get a warning if more
than one match is found.

Georg

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)

iEYEARECAAYFAkxyXL0ACgkQN9GcIYhpnLAdDwCgj2+PFczD+jFKQ5o0Og0Gwon0
cdkAnAseyHxQJ6UrxaQD89DiUdQ6E0YN
=jFC2
-----END PGP SIGNATURE-----

-- 
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