开发者

Including source in Sphinx documentation

开发者 https://www.devze.com 2023-02-16 22:57 出处:网络
I am trying to use Sphinx to document a Python project of mine, but I am struggl开发者_StackOverflow中文版ing with the differences between this tool and the usual tools like JavaDoc which are meant to

I am trying to use Sphinx to document a Python project of mine, but I am struggl开发者_StackOverflow中文版ing with the differences between this tool and the usual tools like JavaDoc which are meant to document an API. Of course I see that Sphinx has many more uses than documenting an API, but it seems to be lacking in the simpler task.

I have managed to find out how to let Sphinx know about your package structure, so that you do not have to manually replicate it into ReST files. My next problem is:

Is it possible to include a link to the source for all classes with Sphinx?

Of course the source should be nicely formatted, but since Sphinx uses pygments I don't think that is a problem.


Take a look at sphinx.ext.viewcode.


Include a extension in conf.py.

extensions = ['sphinx.ext.viewcode']
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号