Sphinx :ivar tag goes looking for cross-references

前端 未结 4 816
粉色の甜心
粉色の甜心 2021-01-07 22:35

I want to document Python object attributes with Sphinx. I understand I should use

:ivar varname: description
:ivar type varname: description
4条回答
  •  暖寄归人
    2021-01-07 23:09

    Here is a workaround provided by @acrisci on github: prefix your variable name with ~.. For example replace

    :ivar float bandwidth: blah
    

    with this:

    :ivar float ~.bandwidth: blah
    

    Source: https://github.com/sphinx-doc/sphinx/issues/2549#issuecomment-488896939

提交回复
热议问题