:- module(_, [], [regtypes, assertions, fsyntax]).

:- doc(title, "Admissible values for the documentation configuration options").

:- doc(module, "This module defines the regular types that define the
   admissible values for the @ref{Documentation configuration
   options}. See also See @ref{Writing documentation} for an
   introduction.").

:- doc(section, "Paths").

:- export(dirpath/1).
:- doc(dirpath/1, "An atom describing a path to a
   directory. Should be a full, explicit path (i.e., not containing
   environment variables).").

:- regtype dirpath(P) # "@var{P} is a full path to a directory.".

dirpath(P) :- atm(P).

:- export(filename/1).
:- regtype filename(P) # "@var{P} is a full path to a file.".

filename(P) :- atm(P).

:- doc(section, "Options for documentation generation").

:- export(supported_option/1).
:- regtype supported_option/1 # "Documentation generation options.".

:- doc(supported_option/1, "In general, selecting none of these
   options generates the most verbose manuals, i.e., each option
   generally supresses the production of a certain kind of output (on
   the other hand, @tt{'verbose'} selects verbose output from
   @apl{ciaoc} when processing the file).

   Possible options: @includedef{supported_option/1}").

supported_option := verbose.
supported_option := no_bugs.
supported_option := no_authors.
supported_option := no_stability.
supported_option := no_version.
supported_option := versioned_output.
supported_option := no_lpdocack.
supported_option := no_changelog.
supported_option := no_patches.
supported_option := autogen_warning.
supported_option := modes.
supported_option := head_props.
supported_option := literal_props.
supported_option := no_propnames.
supported_option := no_undefined.
supported_option := no_propsepln.
supported_option := no_biblio.
supported_option := no_sysmods.
supported_option := no_engmods.
supported_option := no_packages.
supported_option := no_isoline.
supported_option := propmods.
supported_option := no_propuses.
supported_option := shorttoc.
supported_option := regtype_props.
supported_option := onesided.
supported_option := no_math.
supported_option := tests.
supported_option := no_examples.
supported_option := status.

% TODO: add support for documenting individual clauses so that this
%   predicate is not needed

:- export(option_comment/2).
:- pred option_comment(Option,Text) 
    => supported_option * string
    # "@var{Option} is a documentation option which is
      supported. These options can be applied to the main file or
      to the components.  @var{Text} describes the effect of
      selecting that option.".

:- doc(option_comment(Option,Text), "The currently supported options
   are: @includedef{option_comment/2}").

option_comment(verbose, "Verbose output (good for debugging).").
option_comment(no_bugs, "Do not include information on bugs.").
option_comment(no_authors, "Do not include author names.").
option_comment(no_stability, "Do not include stability comment.").
option_comment(no_version, "Do not include version information.").
option_comment(versioned_output, "Include version in the output name.").
option_comment(no_lpdocack, "Do not include an ack of LPdoc in output.").
option_comment(no_changelog, "Do not include change log.").
option_comment(no_patches, "Do not include comments for patches.").
option_comment(autogen_warning, "Include autogenerated warning (only ascii backend).").
%% @tt{modes} and @tt{headprops} are used by normalizer!
option_comment(modes,
     "Do not translate modes and their arguments (except for properties)").
option_comment(head_props, "Do not move head properties to body.").

option_comment(literal_props,"Do not use text to document properties.").
option_comment(no_propnames, "Do not include property names in prop text.").
option_comment(no_undefined, "Do not signal undefined properties in text.").
option_comment(no_propsepln, "Do not put each property in a separate line.").

option_comment(no_biblio, 
    "Do not include a bibliographical 'References' appendix.").
option_comment(no_sysmods, "Do not include system modules in the import list.").
option_comment(no_engmods, 
    "Do not include system engine modules in the import list.").
option_comment(no_packages, "Do not include packages in the import list.").
option_comment(no_isoline, 
    "Do not include *textual* description that a given usage conforms to the"||
    " ISO standard.").
option_comment(propmods, "Include module name to which props belong.").
option_comment(no_propuses, 
    "Do not include property uses (from assertions) in indices.").
option_comment(shorttoc, 
    "Produce shorter table of contents (no entries for individual defs of"||
    " preds, props, etc.).").
option_comment(regtype_props,"Include in the doc for regtypes the global prop"||
    " stating that they are indeed regtypes.").
option_comment(onesided, "For printing on one side (default is two).").
option_comment(no_math, "Disable mathematical environments.").
option_comment(tests,
    "Include test assertions in doc for preds (default: only tests that have 'example' in comp field).").
option_comment(no_examples,
    "Document no test assertions, i.e., also not those that have 'example' as a comp property.").
option_comment(status,
    "Document also the status of assertions (default is no status, more appropriate for manuals).").

:- doc(section, "Supported formats").

:- export(supported_format/1).
:- regtype supported_format/1 # "Available formats".

:- doc(supported_format/1, "The available formats are:
   @includedef{supported_format/1}").

supported_format := texi.
supported_format := dvi.
supported_format := ps.
supported_format := pdf.
supported_format := ascii.
supported_format := manl.
supported_format := info.
supported_format := html.

:- doc(section, "Indices").

:- export(supported_index/1).
:- regtype supported_index/1 # "Supported indexes".

:- doc(supported_index/1, "Supported indexes:
   @includedef{supported_index/1}").

supported_index := concept.
supported_index := lib.
supported_index := apl.
supported_index := pred.
supported_index := prop.
supported_index := regtype.
supported_index := decl.
supported_index := op.
supported_index := modedef.
supported_index := file.
supported_index := global.
supported_index := all.

% TODO: add support for documenting individual clauses so that this
%   predicate is not needed

% TODO: must be synchronized with typeindex/5, description is not
%   necessarily the title!

:- export(index_comment/2).
:- pred index_comment(Index,Text) => atom * string
   # "@var{Type} is a type of index which is
      supported. @var{Text} describes the index contents.".

:- doc(index_comment(Index,Text), "The currently supported indices
   are: @includedef{index_comment/2}").

index_comment(lib, "Library/module index").
index_comment(apl, "Application index").
index_comment(pred, "Predicate/method index").
index_comment(prop, "Property index").
index_comment(regtype, "Regular type index").
index_comment(decl, "Declaration index").
index_comment(op, "Operator index").
index_comment(modedef, "Mode index").
index_comment(file, "File/directory index").
index_comment(concept, "Concept index").
index_comment(author, "Author index").
index_comment(global, "Global index").
index_comment(all, "All supported indices").

:- doc(section, "Types of paper").

:- export(supported_papertype/1).
:- regtype supported_papertype/1 # "Possible papertypes".
:- doc(supported_papertype/1, "Possible papertypes: @includedef{supported_papertype/1}").

supported_papertype := letterpaper.
supported_papertype := smallbook.
supported_papertype := afourpaper.
supported_papertype := afourlatex.
supported_papertype := afourwide.
supported_papertype := afourthesis.

:- doc(section, "Other properties").

:- export(yesno/1).
:- regtype yesno/1 # "Enumerated type for yes/no".
:- doc(yesno/1, "Enumerated type: @includedef{yesno/1}").

yesno := yes|no.


% TODO: MH Same as in autodoc_messages.... 
:- doc(verbosity_t/1, "Defines the levels of verbosity for the
   messages produced by the message priting
   predicates. @includedef{verbosity_t/1}").
:- export(verbosity_t/1).
:- regtype verbosity_t(L) # "@var{L} is a verbosity level.".

verbosity_t := quiet|progress|full.


:- doc(warning_level_t/1, "Defines which levels of warning will be
   printed by the message priting
   predicates. @includedef{warning_level_t/1}").
:- export(warning_level_t/1).
:- regtype warning_level_t(L) # "@var{L} is a warning level.".

warning_level_t := none|normal|all.


