Andrea
Andrea

Reputation: 20493

Including source in Sphinx documentation

I am trying to use Sphinx to document a Python project of mine, but I am struggling 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.

Upvotes: 2

Views: 1957

Answers (2)

mzjn
mzjn

Reputation: 51012

Take a look at sphinx.ext.viewcode.

Upvotes: 5

Denys Nunes
Denys Nunes

Reputation: 11

Include a extension in conf.py.

extensions = ['sphinx.ext.viewcode']

Upvotes: 0

Related Questions