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