This is an old revision of the document!


Source code documentation with PLDOC

PLDOC is a Javadoc-like source documentation tool for SWI Prolog. Structured comments in the source code are translated into HTML or LaTEX. The first line of the comment needs to start with two percent signs, followed by the predicate including its mode declarations as described in the PLDOC documentation. The following lines describe the predicate and its parameters. comp_temporallySubsumes(?Long, ?Short) is nondet.

%
% Check if the time segment Long contains the segment or time point Short.
%
% @param Long Identifier of the longer time segment
% @param Short Identifier of the contained time segment or time point
% 
  comp_temporallySubsumes(Long, Short) :-
  [...]

For showing the documentation, you can run

doc_server(8080).

in Prolog, which starts the documentation server locally so that you can access it from your browser. Note that the doc server only parses those files correctly that are loaded after the server has been started.

For saving the documentation locally, you can use the doc_save predicate:

use_module(library(doc_files)).
doc_save( '/work/knowrob/trunk/', [css(copy),recursive(true),doc_root('/work/knowrob/doc')]).

Generate documentation for KnowRob packages

The rosprolog-doc script starts Prolog and generates the documentation in the doc subfolder. You can call it using the following command:

rosrun rosprolog rosprolog-doc <pkgname>