a notation or direction at one place (as in a document or file) to pertinent information at another place
Questions tagged [cross-reference]
365 questions
243
votes
5 answers
What do the &,<<, * mean in this database.yml file?
Up until now I have only used database.yml with each parameter called out explicitly, in the file below it uses some characters I do not understand. What does each line and symbol(&, *, <<) mean? How do I read this file?
development: &default
…

OpenCoderX
- 6,180
- 7
- 34
- 61
145
votes
6 answers
Adding a cross-reference to a subheading or anchor in another page
How to insert a cross-reference in a reST/Sphinx page to either a sub-header or anchor in another page in the same documentation set?

Sue Walsh
- 1,453
- 2
- 10
- 6
133
votes
3 answers
Link to class method in Python docstring
I want to add a link to a method in my class from within the docstring of another method of the same class. I want the link to work in Sphinx and preferentially also in Spyder and other Python IDEs.
I tried several options and found only one that…

saroele
- 9,481
- 10
- 29
- 39
129
votes
5 answers
Is there YAML syntax for sharing part of a list or map?
So, I know I can do something like this:
sitelist: &sites
- www.foo.com
- www.bar.com
anotherlist: *sites
And have sitelist and anotherlist both contain www.foo.com and www.bar.com. However, what I really want is for anotherlist to also…

Ben
- 68,572
- 20
- 126
- 174
128
votes
7 answers
How do I make a reference to a figure in markdown using pandoc?
I'm currently writing a document in markdown and I'd like to make a reference to an image from my text.
this is my text, I want a reference to my image1 [here]. blablabla

I want to do that reference because after…

Romain Piel
- 11,017
- 15
- 71
- 106
68
votes
4 answers
knitr/rmarkdown/Latex: How to cross-reference figures and tables?
I'm trying to cross-reference figures and tables in a PDF produced with knitr/rmarkdown. There are some questions on SO and tex.stackexchange (here and here, for example), that suggest the way to do this inline is to add \ref{fig:my_fig}, where…

eipi10
- 91,525
- 24
- 209
- 285
36
votes
1 answer
Retaining inline code inside references in Sphinx
In Sphinx, if I have the following heading declaration:
.. _somestuff:
``this is code``, this is not!
==============================
It renders, like this:
this is code, this is not!
Which is good, but, if I use the reference, e.g:
Have a look…

tjm
- 7,500
- 2
- 32
- 53
27
votes
4 answers
Simple cross import in python
I want to separate code in different class and put them to different files. However those class are dependent on each other.
main.py:
from lib import A, B
def main():
a = A()
b = B()
a.hello()
b.hello()
if __name__ == '__main__':
…

ts_pati
- 532
- 1
- 5
- 9
21
votes
2 answers
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…

Raiu
- 315
- 1
- 2
- 6
18
votes
5 answers
XML - Referencing Other XML Files
I'm new to XML, so this may be a fairly easy question to answer. I was wondering if there is a standard way of referencing external XML files from within other XML files. Let me give an example. Say you have a file which defines a single object…
Scott
17
votes
4 answers
Referencing long names with Python Sphinx
I'm working on documentation for my Python module (using Sphinx and reST), and I'm finding that when cross-referencing other Python objects (modules, classes, functions, etc) the full object name ends up being incredibly long. Often it is longer…

furtypajohn
- 287
- 4
- 9
16
votes
3 answers
How to avoid circular dependency caused by type hinting of pointer attributes in python
Consider the two modules (in the same folder):
firstly, person.py
from typing import List
from .pet import Pet
class Person:
def __init__(self, name: str):
self.name = name
self.pets: List[Pet] = []
def…

levraininjaneer
- 1,157
- 2
- 18
- 38
12
votes
3 answers
What's the difference in behaviour between :func: and :meth: roles in Python Sphinx?
The Sphinx documentation at http://www.sphinx-doc.org/en/stable/domains.html#cross-referencing-python-objects says,
:py:func: Reference a Python function; dotted names may be used. The role text needs not include trailing parentheses to enhance…

Lone Learner
- 18,088
- 20
- 102
- 200
12
votes
6 answers
Excel structured reference table syntax
I try to avoid using Excel too much, but when I do I like using structured references as they seem a lot cleaner to write.
If I create a table called "table1" with columns "col1" and "col2" how would I reference the first row in "col1" using a…

Michael
- 155
- 1
- 2
- 10
11
votes
1 answer
Cross-referencing functions from other submodule in Documenter.jl
Given a module hierarchy like
module A
module B; function foo end; end
module C
"""
bar(x)
Like [`foo`](@ref), but more `bar`.
"""
function bar end
end
end
How could I cross-reference foo…

Fengyang Wang
- 11,901
- 2
- 38
- 67