我一直在試圖記錄我的基於MongoEngine的應用程序,但我在記錄我的文檔類的屬性時遇到問題。獅身人面像類屬性文檔
我已經採取了正確的語法,這樣做是:
class Asset(Document):
#: This is the URI of the document
uri = StringField()
我已經試過記錄我發現,甚至補充說,是不是MongoEngine屬性這些屬性的各種方式字段只是爲了確保這不是問題:
class Asset(Document):
"""
The representation of a file uploaded into the data store.
"""
#: This is a test attribute.
foo = 'bar'
"""baz?"""
#: This is a URI.
uri = StringField(required=True)
"""This is a URI """
我已經試過各種指令在相應的.rst文件中的各種組合。目前,它看起來像這樣:
.. currentmodule:: mymodule.asset
.. autoclass:: Asset
.. autoattribute:: Asset.foo
.. autoattribute:: Asset.uri
輸出不是很滿意:foo的屬性沒有顯示在所有文件和URI領域擁有MongoEngine的「Unicode字符串場。」 (StringField類的文檔)作爲文檔。此外,屬性文檔不會放在類下「(與automodule +:成員: - 使用它們的MongoEngine描述輸出所有字段)
我錯過了Sphinx Extension嗎?或者我搞砸了語法?
嗨,這是問題的一部分,我已經添加了一個自己的答案[這裏](http://stackoverflow.com/a/23086206/660848)修復了這個問題,並且還提出了「sphinx.ext .viewcode「擴展工作。萬歲! :) – wonderb0lt