Documentation Generation LibraryAuthor(s): Manuel Hermenegildo, Jose F. Morales.
This library provides some predicates which generate documentation automatically for a given module or application, using the declarations and assertions used in the module itself as input (see the assertions library). By default, only the exported predicates of the module appear in the documentation. The predicates will be documented in the order in which they appear in the module/1 or module/2 declaration.
The idea of this package is on one hand to reuse the information present in the assertions and on the other to help ensure that code and documentation are kept as coherent as possible. Hopefully, keeping them close together should help in this always difficult task. The resulting documentation is somewhat rigidly structured, but generally sufficient for a reference manual, provided a little effort is put into the assertions and comments. The end product understandably depends heavily on how much work is put into adding additional comments to the source. Some documentation will be generated in any case, but it is recommended that, at the minimum, a module title and a comment for each of the exported predicates be provided.
One of the main output format supported is texinfo (see The GNU Texinfo Documentation System manual for more info), from which printed manuals and several other printing and on-line formats can be easily generated automatically (including info). There is also some limited support for direct output in unix man format. For texinfo, the documentation for a module is a texinfo chapter, suitable for inclusion in a wrapper “main” document file.
A simple example of the use of this library a reference manual is included with the library source code. Other examples can be found in the Ciao documentation directory (i.e., the Ciao manuals themselves).
Usage and interface
- Library usage:
index_comment/2, reset_output_dir_db/0, ensure_output_dir_prepared/2, get_autodoc_opts/3, autodoc_gen_doctree/5, fmt_infodir_entry/3, autodoc_compute_grefs/3, autodoc_translate_doctree/3, autodoc_finish/1, autodoc_gen_alternative/2.
- Application modules:
autodoc_state, autodoc_settings, autodoc_filesystem, autodoc_structure, autodoc_doctree, autodoc_refsdb, autodoc_parse, autodoc_index, autodoc_aux, comments, autodoc_html_assets, autodoc_texinfo.
- System library modules:
format, ttyout, aggregates, read, dict, compiler, assrt_lib, c_itf, messages, pathnames, lists, terms, system_extra, assertions_props, system, paths_extra.
- Internal (engine) modules:
term_basic, arithmetic, atomic_basic, basic_props, basiccontrol, data_facts, exceptions, io_aux, io_basic, prolog_flags, streams_basic, system_info, term_compare, term_typing, hiord_rt, debugger_support.
prelude, nonpure, condcomp, assertions, regtypes, dcg, basicmodes, fsyntax.
- Application modules:
Documentation on exports
Ensure that the output directories for backend Backend are prepared.
FileBase is the module specifier of the source file being documented (without extension, FileExt is the source extension). The output is a file whose contents document the main file, based on any assertions present in that file. The documentation is produced in the format given by Backend (the name of the output file also depends on Backend). The formats supported are given by backend_id/1.
Generates a one line description (ASCII) of the application or library in a file for the directory of emacs info manuals.
Compute the globally resolved references (including bibliography)
Translate the doctree using the specific backend