I am preparing documents for a python package (let's call it pack
). Sometimes I need to refere to a module or class of the package like `pack.My_Class.my_module` using back tick and I want to add a hyper link to the module documentation.
In the output the referenced text become italic and no link is created. I have checked cross reference documents of sphinx and also know how to refer to a section in the rst file.
.. _references:
References
-----------
look at :ref:`text to explain <references>`
Edit:
In index.rst
file :
.. automodule:: pack.examples.scripts.example1
in example1.py
file I have the documents:
"""
This is a test to refere to a function.
:func:`pack.utility.order_parameter`
"""
The files are distributed like this:
pack/
__init__.py
utility.py
examples/
example1.py
docs/
make.bat
makefile
source/
config.py
index.rst
build/
html/
the conf.py
is like this:
import os
import sys
sys.path.insert(0, os.path.abspath('../../pack'))
project = 'pack'
release = '0.1'
extensions = ['sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinx.ext.autodoc',
'sphinx.ext.githubpages',
'sphinx.ext.inheritance_diagram',
'sphinx.ext.coverage',
'sphinx.ext.napoleon',
'sphinx.ext.imgmath',
'sphinx.ext.mathjax',
]
templates_path = ['_templates']
exclude_patterns = ['_build']
master_doc = 'index'
html_theme = 'nature'
html_static_path = ['_static']
latex_elements = {
'papersize': 'letterpaper',
'pointsize': '12pt',
'preamble': r"""
\usepackage{setspace}
"""
}
numfig = True