2011-05-25 22 views
8

我想用獅身人面像來記錄一個項目,但我不知道如何使用 intersphinx。我使用這一行:如何將標準庫文檔中的一個任意方法的intersphinx鏈接?

:py:meth:`math.sin` 

添加鏈接,但在輸出中,它顯示爲粗體而不是鏈接。 雖然該行不行,下面的兩個操作:

:py:meth:`dict.items` 
:py:class:`zipfile.ZipFile` 

我在conf.py文件intersphinx_mapping值:

intersphinx_mapping = {'python':('http://docs.python.org/2.7', None)} 

回答

4

您已經閱讀了intersphinx的文檔?

編輯

得到它使用這個工作:

*** 
TRY 
*** 

My try 
====== 

sin 
:py:func:`math.cos` 

pop 
:py:meth:`dict.pop` 

dict 
:py:meth:`dict.items` 

zipfile 
:py:class:`zipfile.ZipFile` 

閱讀關於構建這裏crossreference

+1

我已閱讀intersphinx的文檔,但我沒有看到任何可以幫助我的內容...我已經編輯了更多詳細信息。 – 2011-05-25 19:55:18

+0

是的,我遵循該頁面上的所有方向。 – 2011-05-25 20:06:40

+0

對我來說真的不起作用,發現這個有趣的帖子,我現在正在閱讀http://comments.gmane.org/gmane.comp.python.sphinx.devel/4283 – 2011-05-25 20:16:52

8

:py:meth::py:func:。基本上可以使用 任何有效的domain

+0

認爲我們同時使用相同的鏈接解決了它,有趣的練習;-) – 2011-05-25 20:36:21

+1

是的,我注意到Sphinx文檔的某些部分非常糟糕。 – 2011-05-25 20:41:49

+0

':py:func:'的作品,但應該注意[intersphinx](http://sphinx-doc.org/latest/ext/intersphinx.html)必須先設置! – 2013-07-13 03:00:18

相關問題