| 57 | |
| 58 | ==== Verifying the completeness of the documentation -- `checkapidoc.py` #checkapidoc |
| 59 | Note 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. |
| 60 | |
| 61 | For example: |
| 62 | {{{ |
| 63 | $ PYTHONPATH=. python doc/utils/checkapidoc.py trac_wiki_api |
| 64 | }}} |
| 65 | will 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. |
| 66 | |
| 67 | {{{ |
| 68 | $ PYTHONPATH=. python doc/utils/checkapidoc.py trac_wiki_api |
| 69 | Warning: trac.wiki.api doesn't define __all__, using exported symbols. |
| 70 | * .. autofunction :: validate_page_name |
| 71 | }}} |
| 72 | Explaining the output: |
| 73 | |
| 74 | `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. |
| 75 | |
| 76 | ` * .. 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]. |
| 77 | |
| 78 | |
| 79 | Note that when `__all__` is specified, we also consider that listed symbols which //don't// have yet a docstring should also be documented. |
| 80 | |
| 81 | A 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. |
| 82 | |
| 83 | There's also a verbose mode `-v` for showing all the symbols found: |
| 84 | {{{ |
| 85 | $ PYTHONPATH=. python doc/utils/checkapidoc.py trac_wiki_api -v |
| 86 | == Checking trac_wiki_api.rst ... |
| 87 | Warning: trac.wiki.api doesn't define __all__, using exported symbols. |
| 88 | - OK autoclass :: IWikiChangeListener |
| 89 | - OK autoclass :: IWikiMacroProvider |
| 90 | - OK autoclass :: IWikiPageManipulator |
| 91 | - OK autoclass :: IWikiSyntaxProvider |
| 92 | - OK autoclass :: WikiSystem |
| 93 | - OK autofunction :: parse_args |
| 94 | * .. autofunction :: validate_page_name |
| 95 | }}} |