3

When using sphinx-apidoc to generate .rst files, the output produce does not contain any labels:

dessn.examples package
======================

.. automodule:: dessn.examples
    :members:
    :undoc-members:
    :show-inheritance:

Subpackages
-----------

.. toctree::

    dessn.examples.discrete
    dessn.examples.simple

What I am trying to do is to link to specific pages from a customised home page, which is not generated using apidoc. However, I cannot find any way to call api-doc and have it generate labels itself, nor can I figure out any proper way of simply linking to the right .rst without a label, and without simply typing out the absolute html file that I know will generate.

I can use the ::include statement, and it works just fine, but I have been completely unable to find a statement which will simply generate a hyperlink to the rst file.

Am I missing something obvious here, or do I have to figure out a way to make api-doc insert labels?

Cheers

Samreay
  • 313
  • 3
  • 11
  • 1
    Perhaps you can use the [`:py:mod:`](http://www.sphinx-doc.org/en/stable/domains.html#cross-referencing-python-objects) cross-reference role. See also http://stackoverflow.com/a/22714510/407651. – mzjn Mar 27 '16 at 16:10
  • That is exactly what I wanted. I was so stuck looking for the word package that the word module went straight over my head. Thank you! – Samreay Mar 28 '16 at 11:55

1 Answers1

6

Following the thread that mzjn linked to, the best solution so far is to first realise a package and a module are equivalent for this question, and that you can use the module python reference, as detailed here on sphinx.

As such, the link to the dessn.examples.simple package can be achieved by simply inserting the code

:py:mod:`dessn.examples.simple`
Samreay
  • 313
  • 3
  • 11