Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python-Sphinx: Link to Section in external File

I want to link to a section in an external file, but I can't get it to work. The :ref: does not seem to work globally, or do I use it wrong ?

..
    File: some_file.rst

.. _ref_section:

Some Section
------------

Paragraph, foo bar lorem ipsum.


..
    File: some_other_file.rst

.. seealso:: :ref:`ref_section`

How can I cross-reference to Sections from a different file ?

like image 706
Niklas R Avatar asked Jan 09 '12 19:01

Niklas R


People also ask

How to show all intersphinx links and their targets in Python?

To show all Intersphinx links and their targets of an Intersphinx mapping file, run python-msphinx.ext.intersphinx url-or-path. This is helpful when searching for the root cause of a broken Intersphinx link in a documentation project. The following example prints the Intersphinx mapping of the Python 3 documentation:

How do I get a list of all links in Sphinx?

When you build your documentation, Sphinx will generate an inventory of all explicit and implicit links called objects.inv. You can list all of these targets to explore what is available for you to reference. Where <link> is either a URL or a local path that points to your inventory file (usually in _build/html/objects.inv ).

How do I install Sphinx in Python?

Assuming that you already have Python installed, Sphinx can be installed as follows: The documentation for a project is typically kept in a docs subdirectory. Once you are in that directory, you can create the basic structure for your documentation by running

How do I read the documentation in Sphinx?

On Read the Docs you can use the sphinx.fail_on_warning option. When you build your documentation, Sphinx will generate an inventory of all explicit and implicit links called objects.inv. You can list all of these targets to explore what is available for you to reference.


Video Answer


1 Answers

Have a look at the Inter-Sphinx extension: http://sphinx-doc.org/en/master/usage/extensions/intersphinx.html

like image 92
schlenk Avatar answered Sep 25 '22 11:09

schlenk