Edgewall Software

Version 3 (modified by Christian Boos, 12 years ago) ( diff )

added links to generated apirefs and apidoc for trunk

Trac API Documentation

The code is the authoritative source of documentation, and most classes and methods have a corresponding Python "doc string".

We propose two ways for taking benefit from this embedded documentation in order to generate API documentation references.

  • apiref — Full API reference using epydoc
  • apidoc — Semi-automatic API documentation using Sphinx

With epydoc, the entirety of the API is covered, but we have less control over the generated output and the documentation is a bit more "dry" and feels, well, … auto-generated.

This contrasts with Sphinx, were we have fine-grained control over the documentation and the order in which it appears. Therefore, this documentation "reads" better. The downside is that we don't have yet full coverage of the API. (work in progress)

For now, the two sets of documentations are complementary. One day the Sphinx documentation will be complete and sufficient, at which point we'll probably drop the epydoc part (besides, epydoc itself doesn't seem to be maintained anymore).

View the documentation

Note that as Trac 0.11 and 0.12 were not really prepared for being processed, the quality of the generated documentation is all but perfect. It's not that the one for 0.13dev is, but there we're working on it. The 0.12-stable link and the 0.13dev links above should correspond to the latest version (not yet updated automatically - this is coming next).

Generating the documentation

Epydoc — make apiref

Once you have installed epydoc, all you need to do is to go to your Trac trunk checkout and do:

$ make apiref

This will generate the epydoc documentation in ./build/doc/epydoc (start with the index.html page).

Note that while installing epydoc with easy_install might work on Linux (not tested), on Windows you should rather download and execute the Windows installer.

Sphinx — make apidoc

Once you have installed sphinx, go to your Trac trunk checkout and do:

$ make apidoc

This will generate the Sphinx documentation in ./build/doc/html (start with the index.html page).

Alternatively, you can also generate a PDF document using rst2pdf:

$ make apidoc sphinxformat=pdf

This will generate the ./build/doc/pdf/trac_dev.pdf file.

Sphinx is a no brainer easy_install sphinx installation, which will get you the appropriate dependencies (docutils and jinja2).

Same goes for easy_install rst2pdf.

See also: #8695

Note: See TracWiki for help on using the wiki.