Edgewall Software

Changes between Version 18 and Version 19 of TracDev/ApiDocs


Ignore:
Timestamp:
Jul 28, 2015, 5:15:08 PM (9 years ago)
Author:
figaro
Comment:

Cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/ApiDocs

    v18 v19  
    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". How the documentation that has been added to the code can be viewed and generated is explained on this page.
    44
    55== View the documentation
     
    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.//
    3837
    39 For now, the two sets of documentations are complementary. Because epydoc is no longer maintained, the Sphinx documentation will take precedence.
     38In //italic//: corresponds to the latest revision on the branch.
     39
     40The Sphinx documentation will take precedence, because epydoc is no longer maintained. For now, the two sets of documentation are complementary.
    4041
    4142 apidoc :: Semi-automatic API documentation, generated using [http://sphinx.pocoo.org Sphinx]. \\
    42    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. //(introduced in Trac 1.0, 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 there is no full coverage of the API yet. Apidoc has been introduced in Trac 1.0.
    4344
    4445 apiref :: Full API reference, generated using [http://epydoc.sourceforge.net/ epydoc]. \\
     
    5051
    5152Once you have installed `sphinx`, go to your Trac 1.0-stable or trunk checkout and do:
    52 {{{
     53{{{#!sh
    5354$ make apidoc-html
    5455}}}
     
    5657
    5758You can also generate a PDF document using [http://rst2pdf.googlecode.com rst2pdf]:
    58 {{{
     59{{{#!sh
    5960$ make apidoc-pdf
    6061}}}
     
    7273
    7374For example:
    74 {{{
     75{{{#!sh
    7576$ PYTHONPATH=. python doc/utils/checkapidoc.py trac_wiki_api
    7677}}}
    7778will check if all public and documented symbols from source:trunk/trac/wiki/api.py are referenced in source:trunk/doc/api/trac_wiki_api.rst.
    7879
    79 {{{
     80{{{#!sh
    8081$ PYTHONPATH=. python doc/utils/checkapidoc.py trac_wiki_api
    8182Warning: trac.wiki.api doesn't define __all__, using exported symbols.
    8283 * ..   autofunction :: validate_page_name
    8384}}}
     85
    8486Explaining the output:
    8587
    86  `Warning: trac.wiki.api doesn't define __all__, using exported symbols.` means that in the absence of an explicit list of public symbols, we try to guess what needs to be documented by looking at the globals of that module which have a docstring.
     88 * `Warning: trac.wiki.api doesn't define __all__, using exported symbols.` means that in the absence of an explicit list of public symbols, we try to guess what needs to be documented by looking at the globals of that module which have a docstring.
    8789
    88  ` * ..   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].
     90 * ` * ..   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].
    8991
    90 Note that when `__all__` is specified, we also consider that listed symbols which //don't// have yet a docstring should also be documented.
     92Note that when `__all__` is specified, we also consider that listed symbols which //don't// have a docstring yet should also be documented.
    9193
    9294A symbol can be explicitly declared to be unwanted in the Sphinx documentation by listing it in the global `__no_apidoc__` property of its defining module.
    9395
    9496There's also a verbose mode `-v` for showing all the symbols found:
    95 {{{
     97{{{#!sh
    9698$ PYTHONPATH=. python doc/utils/checkapidoc.py trac_wiki_api -v
    9799== Checking trac_wiki_api.rst ...
     
    109111
    110112Once you have installed `epydoc`, go to your Trac trunk checkout and do:
    111 {{{
     113{{{#!sh
    112114$ make apiref
    113115}}}
     
    115117
    116118Note that while installing epydoc with `easy_install` might work on Linux (not tested), on Windows you should rather download and execute the Windows installer.
    117