Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't use :ref: with a Label using Sphinx doc

I have a problem with using Sphinx-doc's :ref: role, I put a label above a paragraph and then I try to link to that label from another doc but inside the same project.

The label I use in one document:

.. _hal_1k_1p:

And the ref I try to use to link to that label:

:ref:`Link title hal_1k_1p`

But I only get this error message when building the doc:

WARNING: undefined label: link title hal_1k_1p (if the link has no caption the label must precede a section header)

What am I doing wrong?

like image 767
Raiu Avatar asked Sep 02 '15 05:09

Raiu


1 Answers

Okay, looking at :ref: you need to have this:

:ref:`Link title <ha1_1k_1p>` 

to link to that label.

Ensure you have angle brackets surrounding your label like so: <label>

like image 190
user1411260 Avatar answered Nov 23 '22 00:11

user1411260