Documentation Abstract Syntax Tree
Author(s): Manuel Hermenegildo (original version), Jose F. Morales.This module defines the intermediate tree representation doctree/1 for documentation and its related operations.
Usage and interface
- Library usage:
:- use_module(library(autodoc_doctree)). - Exports:
- Predicates:
cmd_type/1, doctree_is_empty/1, is_nonempty_doctree/1, empty_doctree/1, doctree_insert_end/3, doctree_insert_before_section/3, doctree_concat/3, doclink_at/2, doclink_is_local/1, section_prop/2, section_select_prop/3, doctree_save/2, doctree_restore/2, doctree_simplify/2, doctree_putvars/5, doctree_scan_and_save_refs/2, doctree_prepare_docst_translate_and_write/3, doctree_to_rawtext/3, doctree_translate_and_write/3, escape_string/4, is_version/1, version_patch/2, version_date/2, version_numstr/2, version_string/2, insert_show_toc/3. - Regular Types:
doctree/1, doclink/1, doclabel/1, doctokens/1. - Multifiles:
autodoc_rw_command_hook/4, autodoc_escape_string_hook/5.
- Predicates:
- Imports:
- Application modules:
lpdocsrc(src(autodoc_state)), lpdocsrc(src(autodoc_refsdb)), lpdocsrc(src(autodoc_index)), lpdocsrc(src(autodoc_structure)), lpdocsrc(src(autodoc_filesystem)), lpdocsrc(src(autodoc_settings)), lpdocsrc(src(comments)), lpdocsrc(src(autodoc_texinfo)), lpdocsrc(src(autodoc_man)), lpdocsrc(src(autodoc_html)). - System library modules:
write, operators, format, lists, system_extra, read, terms, make/make_rt. - 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. - Packages:
prelude, nonpure, dcg, assertions, regtypes, basicmodes, fsyntax.
- Application modules:
Documentation on exports
Usage:doctree_insert_end(A0,Elem,A)
Insert Elem in A0 at the end, obtaining A
Usage:doctree_insert_before_section(A0,Elem,A)
Insert Elem in A0 before the first section, obtaining A
Usage:
- Call and exit should be compatible with:
(atm/1)Arg1 is an atom.
(doctree/1)Intermediate tree representation for documentation - The following properties should hold at call time:
(nonvar/1)Arg1 is currently a term which is not a free variable.
(nonvar/1)Arg2 is currently a term which is not a free variable.
Usage:doctree_putvars(R0,DocSt,PDict,VarDict,R)
Traverse R0 and replace each var(Name) doctree item with a fresh variable B. For each replacement, the term B=Var is introduced in VarDict, where Var is the associated value to Name in the dictionary PDict.
- The following properties should hold at call time:
(doctree/1)Intermediate tree representation for documentation
(docstate/1)docstate(DocSt) - The following properties should hold upon exit:
(doctree/1)Intermediate tree representation for documentation
Usage:doctree_scan_and_save_refs(R,DocSt)
Scan and save the references of the doctree
- The following properties should hold at call time:
(doctree/1)Intermediate tree representation for documentation
(docstate/1)docstate(DocSt)
Usage:doctree_to_rawtext(X,DocSt,Y)
Y is a simplified raw text representation of the X
- Call and exit should be compatible with:
(doctree/1)Intermediate tree representation for documentation
(docstate/1)docstate(DocSt)
(string/1)Y is a string (a list of character codes).
Usage:
Escapes needed characters in input string as needed for the target format.
- The following properties should hold upon exit:
(atom/1)Arg1 is currently instantiated to an atom.
(string/1)Arg2 is a string (a list of character codes).
(docstate/1)docstate(Arg3)
(string/1)Arg4 is a string (a list of character codes).
Usage:version_numstr(Version,Str)
Obtain the string Str representation of version Version (except date)
Usage:version_string(Version,Str)
Obtain the string Str representation of version Version (including date)
Usage:insert_show_toc(R0,DocSt,R)
Insert the command to show the table of contents in a given doctree/1. The right place may be different depending on the chosen backend.
Documentation on multifiles