In Sphinx, how to include docstrings/comments located in a module, but outside of class and methods

你。 提交于 2019-12-05 10:33:40

Thanks to jonsharpe for his comment, and leading me to the proper way of doing this.

For future reference by others, I basically moved the docstrings to the start of the file:

"""
Miscellaneous methods that help in <<blah blah>>
Does not require explicit instantiation.

The following actions can be performed:
===============   ===============
Action            Method
===============   ===============
Get a             :meth:`methoda`
Get b             :meth:`methodb`
"""

import os
import json

def methoda(data):
    "Gets A ..."
    ...

def methodb(data):
    "Gets B ..."
    ...

And that's it! Everything works.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!