On Sat, Sep 27, 2014 at 10:38 AM, Sören Gebbert < [email protected]> wrote:
> Hi Pietro, > thanks for the quick answer. > > 2014-09-27 16:28 GMT+02:00 Pietro <[email protected]>: > > Hi Sören, > > > > On Sat, Sep 27, 2014 at 3:23 PM, Sören Gebbert > > <[email protected]> wrote: > >> I would like to directly link to the source code > >> docs, hence referencing temporal framework Python functions and > >> classes in this document. But i don't know how? Are there any code > >> examples howto link to Python library code? > > > > I'm not sure that I understand what you want, but I guess that you can > > use the label and then refer to them: > > I want to reference classes and functions from the temporal framework > source code, since AFAIU is the source code documentation of the > temporal framework also created using sphinx? > For example, this class is located in lib/python/temporal/base.py > > {{{ > class SQLDatabaseInterface(): > def __init_(): > ... > }}} > > Howto reference this class in lib/python/docs/src/temporal.rst so that > i can click on the class name in the HTML docs to jump directly to the > source code documentation? > > {{{ > Bla bla bla :class:`SQLDatabaseInterface` > }}} > > There is :class:`~gunittest.case.TestCase` in gunittest documentation, see Sphinx documentation for details: http://sphinx-doc.org/domains.html#cross-referencing-syntax http://sphinx-doc.org/domains.html#cross-referencing-python-objects http://sphinx-doc.org/markup/inline.html#xref-syntax - You may supply an explicit title and reference target: :role:`title <target>` will refer to *target*, but the link text will be *title*. - If you prefix the content with !, no reference/hyperlink will be created. - If you prefix the content with ~, the link text will only be the last component of the target. For example, :py:meth:`~Queue.Queue.get` will refer to Queue.Queue.get but only display get as the link text. The name enclosed in this markup can include a module name and/or a class name. For example, :py:func:`filter` could refer to a function named filter in the current module, or the built-in function of that name. In contrast, :py:func:`foo.filter` clearly refers to the filter function in the foo module. If you prefix the name with a dot, this order is reversed. For example, in the documentation of Python’s codecs module, :py:func:`open` always refers to the built-in function, while :py:func:`.open` refers to codecs.open(). Note that you can combine the ~ and . prefixes: :py:meth:`~.TarFile.close` will reference the tarfile.TarFile.close() method, but the visible link caption will only be close(). > Best regards > Soeren > _______________________________________________ > grass-dev mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/grass-dev >
_______________________________________________ grass-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-dev
