Edgewall Software

Changes between Version 16 and Version 17 of TracDev/ApiDocs


Ignore:
Timestamp:
Jan 27, 2015, 9:45:09 PM (9 years ago)
Author:
figaro
Comment:

Cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/ApiDocs

    v16 v17  
    11= Trac API Documentation
    22
    3 The code is the authoritative source of  documentation, and most classes and methods have a corresponding Python "doc string".
     3The code is the authoritative source of documentation, and most classes and methods have a corresponding Python "doc string".
    44
    55== View the documentation
    66
    7 Besides the TracBrowser and looking directly at the code, you can also read the generated API documentation, which shows the public API in a nicely organized and rendered way:
     7Besides the TracBrowser and looking directly at the code, you can also read the generated [http://en.wikipedia.org/wiki/Application_programming_interface API] documentation, which shows the public API in a nicely organized and rendered way:
    88
    99{{{#!table style="background: #ffd; margin: 2em;"
     
    1414||||= **Sphinx documentation** (`apidoc`) || \
    1515{{{#!th rowspan=2
    16 Epydoc (`apiref`)
     16**Epydoc** (`apiref`)
    1717}}}
    1818|-
     
    3535|| || || [http://www.edgewall.org/docs/tags-trac-0.11.7/epydoc/trac-module.html 0.11.7] ||
    3636}}}
    37     //(in italic: corresponds to the latest revision on the branch)//
     37    //In italic: corresponds to the latest revision on the branch.//
    3838
    3939 apiref :: Full API reference, generated using [http://epydoc.sourceforge.net/ epydoc]. \\
    40    With epydoc, the entirety of the API is covered, but we have less control over the generated output, as it only shows what's present in the source code. The documentation is a bit more "dry" and feels, well, ... auto-generated.
     40   With epydoc, the entirety of the API is covered, but there is less control over the generated output, as it only shows what is present in the source code. The documentation has a more auto-generated feel.
    4141
    4242 apidoc :: Semi-automatic API documentation, generated using [http://sphinx.pocoo.org Sphinx]. \\
    43    This contrasts with the above, as in Sphinx we have fine-grained control over the generated  documentation and the order in which it appears. We've also written additional explanations and examples not present in the code. Therefore, this documentation "reads" better than the purely auto-generated manual. The downside is that we don't have yet full coverage of the API. //(work in progress)//
     43   Sphinx offers fine-grained control over the generated documentation and the order in which it appears. We've also written additional explanations and examples not present in the code. Therefore, this documentation reads better than the purely auto-generated manual. The downside is that we don't have yet full coverage of the API. //(work in progress)//
    4444
    45 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).
     45For now, the two sets of documentations are complementary. Because epydoc is no longer maintained, the Sphinx documentation will take precedence.
    4646
    47 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 1.0 is, but starting from there, we're actively working on it.
     47Note that starting from Trac 1.0, the quality of the generated documentation is gradually improved, because it was the release where this documentation method was introduced.
    4848
    4949== Generating the documentation
     
    5151=== Epydoc — `make apiref`
    5252
    53 Once you have installed `epydoc`, all you need to do is to go to your Trac trunk checkout and do:
     53Once you have installed `epydoc`, go to your Trac trunk checkout and do:
    5454{{{
    5555$ make apiref
    5656}}}
    57 This will generate the `epydoc` documentation in `./build/doc/epydoc` (start with the `index.html` page).
     57This will generate the `epydoc` documentation in `./build/doc/epydoc`, start with the `index.html` page.
    5858
    5959Note that while installing epydoc with `easy_install` might work on Linux (not tested), on Windows you should rather download and execute the Windows installer.
     
    6565$ make apidoc-html
    6666}}}
    67 This will generate the `Sphinx` documentation in `./build/doc/html` (start with the `index.html` page).
     67This will generate the `Sphinx` documentation in `./build/doc/html`, start with the `index.html` page.
    6868
    6969You can also generate a PDF document using [http://rst2pdf.googlecode.com rst2pdf]:
     
    7575Alternatively you can invoke `make apidoc` to get both.
    7676
    77 Sphinx is a no brainer `easy_install sphinx` installation, which will get you the appropriate dependencies (docutils and jinja2).
     77Sphinx is installed as `easy_install sphinx`, which will get you the appropriate dependencies, such as docutils and jinja2.
    7878
    7979Same goes for `easy_install rst2pdf`.
    8080
    8181==== Verifying the completeness of the documentation -- `checkapidoc.py` #checkapidoc
     82
    8283Note that we also have a help script for checking whether a documented .rst module below source:trunk/doc/api contains all the symbols that need to be documented.
    8384
     
    99100 ` * ..   autofunction :: validate_page_name` corresponds to a function in [source:trunk/trac/wiki/api.py api.py] which has a docstring but is not yet present in [source:trunk/doc/api/trac_wiki_api.rst trac_wiki_api.rst].
    100101
    101 
    102102Note that when `__all__` is specified, we also consider that listed symbols which //don't// have yet a docstring should also be documented.
    103103