Create stand-alone documentation from a bundle of source-files. Typical
use of the PlDoc package is to run it as a web-server from the project
in progress, providing search and guaranteed consistency with the loaded
version. Creating stand-alone files as provided by this file can be
useful for printing or distribution.
- To be done
- - Generate a predicate index?
- doc_save(+FileOrDir, +Options)
- Save documentation for FileOrDir to
file(s). Options include
- Currently only supports
- Save output to the given directory. Default is to save
the documentation for a file in the same directory as
the file and for a directory in a subdirectory
- Title is an atom that provides the HTML title of the
main (index) page. Only meaningful when generating
documentation for a directory.
- Root of a manual server used for references to built-in
predicates. Default is
- Filename for directory indices. Default is
- What to do with files in a directory.
only documents files loaded into the Prolog image.
documents all files.
true, recurse into subdirectories.
copy, copy the CSS file to created directories.
inline, include the CSS file into the created
files. Currently, only the default
copy is supported.
The typical use-case is to document the Prolog files that belong
to a project in the current directory. To do this load the
Prolog files and run the goal below. This creates a
doc with an index file
replicates the directory structure of the source directory,
creating an HTML file for each Prolog file and an index file for
each sub-directory. A copy of the required CSS and image
resources is copied to the
?- doc_save(., [recursive(true)]).
- generate(+Spec, +Options) is det[private]
- Generate documentation for the specification created by
- doc_target(+Spec, -Target, +Options) is semidet[private]
- Generate a structure describing what to document in what files.
This structure is a term:
- file(PlFile, DocFile)
- Document PlFile in DocFile
- directory(Dir, IndexFile, Members, Options)
- Document Dir in IndexFile. Members is a list of
- Options that apply only to the main directory.
- file_map(+DocStruct, -List)[private]
- Create a list of
file(PlFile, DocFile) for files that need to
- document_file(+File, -DocFile, +Options) is semidet[private]
- DocFile is the file into which to write the documentation for
File. File must be a canonical Prolog source-file.
- doc_extension(+Format, -Extension) is det[private]
- ensure_slash(+DirName, -WithSlash) is det[private]
- Ensure WithSlash ends with a /.
- ensure_dir(+Directory, +Options) is det[private]
- Create Directory as mkdir -p. May generate file errors.
- prolog_file_in_dir(+Dir, -File, +Options) is nondet[private]
- File is a file in Dir that must be documented. Options:
true, also generate subdirectories
- blocked(+File) is semidet[private]
- True if File is blocked from documentation.
- copy_resources(+Dir, +Options)[private]
The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.
- Generate stand-alone documentation for the package Pack. The
documentation is generated in a directory
doc inside the pack.
The index page consists of the content of
readme.txt in the main directory of the pack and an index of
all files and their public predicates.