doc-tcl-procs.tcl

Documentation procedures for the ArsDigita Templating System

Location:
packages/acs-templating/tcl/doc-tcl-procs.tcl
Author:
Simon Huynh <shuynh@arsdigita.com>
CVS Identification:
$Id: doc-tcl-procs.tcl,v 1.20.2.3 2021/02/01 10:54:23 gustafn Exp $

Procedures in this file

Detailed information

doc::parse_comment_text (private)

 doc::parse_comment_text proc_block

called by parse_namespace

Parameters:
proc_block

Partial Call Graph (max 5 caller/called nodes):
%3 doc::parse_namespace doc::parse_namespace (private) doc::parse_comment_text doc::parse_comment_text doc::parse_namespace->doc::parse_comment_text doc::set_proc_name_source_text_comment_text doc::set_proc_name_source_text_comment_text (private) doc::parse_comment_text->doc::set_proc_name_source_text_comment_text doc::sort_see doc::sort_see (private) doc::parse_comment_text->doc::sort_see doc::util::make_text_listable doc::util::make_text_listable (private) doc::parse_comment_text->doc::util::make_text_listable template::parse_directives template::parse_directives (public) doc::parse_comment_text->template::parse_directives template::util::quote_space template::util::quote_space (private) doc::parse_comment_text->template::util::quote_space

Testcases:
No testcase defined.

doc::parse_file (private)

 doc::parse_file path

Parse API documentation from a Tcl page API documentation is parsed as follows:

  • Document is scanned until a @namespace directive is encountered. The remainder of the file is scanned for @private or @public directives.
  • When one of these directives is encountered, the file is scanned up to a proc declaration and the text in between is parsed as documentation for a single procedure.
  • The text between the initial @private or @public directive and the next directive is considered a general comment on the procedure
Valid directives in a procedure doc include:
  • @author
  • @param (for hard parameters)
  • @see (should have the form namespace::procedure. A reference to an entire namespace should be namespace::. By convention the API for each namespace should be in a file of the same name, so that a link can be generated automatically).
  • @option (for switches such as -foo)
  • @return

Reads the text for a file and scans for a namespace directive. When one is encountered, reads until the next namespace or EOF and calls doc::parse_namespace on the accumulated lines to get procedure documentation.

creates a multirow variable in the variable name designated by result_ref with columns namespace_name, proc_name, public_private, author, param, option, see, return and source_text

Note that this format is suitable for passing to array set for creating a lookup on namespace name.

Parameters:
path

Partial Call Graph (max 5 caller/called nodes):
%3 doc::parse_tcl_library doc::parse_tcl_library (private) doc::parse_file doc::parse_file doc::parse_tcl_library->doc::parse_file doc::parse_namespace doc::parse_namespace (private) doc::parse_file->doc::parse_namespace doc::util::text_divider doc::util::text_divider (private) doc::parse_file->doc::util::text_divider template::util::read_file template::util::read_file (public) doc::parse_file->template::util::read_file

Testcases:
No testcase defined.

doc::parse_namespace (private)

 doc::parse_namespace text_lines

text between two namespace markers in a Tcl library file and parses out procedure source and comments

Parameters:
text_lines - namespace text body
Author:
simon

Partial Call Graph (max 5 caller/called nodes):
%3 doc::parse_file doc::parse_file (private) doc::parse_namespace doc::parse_namespace doc::parse_file->doc::parse_namespace doc::parse_comment_text doc::parse_comment_text (private) doc::parse_namespace->doc::parse_comment_text doc::sort_see doc::sort_see (private) doc::parse_namespace->doc::sort_see doc::util::text_divider doc::util::text_divider (private) doc::parse_namespace->doc::util::text_divider template::parse_directives template::parse_directives (public) doc::parse_namespace->template::parse_directives template::util::alphabetized_index template::util::alphabetized_index (private) doc::parse_namespace->template::util::alphabetized_index

Testcases:
No testcase defined.

doc::parse_tcl_library (private)

 doc::parse_tcl_library dir_list

takes the absolute path of the Tcl library directory and parses through it

Parameters:
dir_list
Returns:
a long lists of lists of lists, each list element contains a three-element list of the format - { {info} {public procedures listing } {private procedures listing}}
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 doc::parse_file doc::parse_file (private) doc::parse_tcl_library doc::parse_tcl_library doc::parse_tcl_library->doc::parse_file

Testcases:
No testcase defined.

doc::set_proc_name_source_text_comment_text (private)

 doc::set_proc_name_source_text_comment_text proc_block

called by parse_comment_text

Parameters:
proc_block

Partial Call Graph (max 5 caller/called nodes):
%3 doc::parse_comment_text doc::parse_comment_text (private) doc::set_proc_name_source_text_comment_text doc::set_proc_name_source_text_comment_text doc::parse_comment_text->doc::set_proc_name_source_text_comment_text doc::util::text_divider doc::util::text_divider (private) doc::set_proc_name_source_text_comment_text->doc::util::text_divider template::util::comment_text_normalize template::util::comment_text_normalize (private) doc::set_proc_name_source_text_comment_text->template::util::comment_text_normalize

Testcases:
No testcase defined.

doc::sort_see (private)

 doc::sort_see list_ref directive_comments

procedure to deal with @see comments

Parameters:
list_ref
directive_comments

Partial Call Graph (max 5 caller/called nodes):
%3 doc::parse_comment_text doc::parse_comment_text (private) doc::sort_see doc::sort_see doc::parse_comment_text->doc::sort_see doc::parse_namespace doc::parse_namespace (private) doc::parse_namespace->doc::sort_see doc::util::dbl_colon_fix doc::util::dbl_colon_fix (private) doc::sort_see->doc::util::dbl_colon_fix doc::util::text_divider doc::util::text_divider (private) doc::sort_see->doc::util::text_divider

Testcases:
No testcase defined.

doc::util::bracket_space (private)

 doc::util::bracket_space text

puts a space after all closing curly brackets, does not add a space when brackets are already followed by a space

Parameters:
text

Partial Call Graph (max 5 caller/called nodes):
%3 doc::util::make_text_listable doc::util::make_text_listable (private) doc::util::bracket_space doc::util::bracket_space doc::util::make_text_listable->doc::util::bracket_space

Testcases:
No testcase defined.

doc::util::dbl_colon_fix (private)

 doc::util::dbl_colon_fix text
Parameters:
text

Partial Call Graph (max 5 caller/called nodes):
%3 doc::sort_see doc::sort_see (private) doc::util::dbl_colon_fix doc::util::dbl_colon_fix doc::sort_see->doc::util::dbl_colon_fix _ _ (public) doc::util::dbl_colon_fix->_

Testcases:
No testcase defined.

doc::util::escape_square_brackets (private)

 doc::util::escape_square_brackets text

escapes out all square brackets

Parameters:
text

Partial Call Graph (max 5 caller/called nodes):
%3 doc::util::make_text_listable doc::util::make_text_listable (private) doc::util::escape_square_brackets doc::util::escape_square_brackets doc::util::make_text_listable->doc::util::escape_square_brackets

Testcases:
No testcase defined.

doc::util::find_marker_indices (private)

 doc::util::find_marker_indices text marker

given a body of text and a text marker, returns a list of position indices for each occurrence of the text marker

Parameters:
text - body of text to be searched through
marker - the text-divider mark
Returns:
list of indices of the position immediately preceding each occurrence of the text marker; if there are no occurrences of the text marker, returns a zero-element list
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 doc::util::text_divider doc::util::text_divider (private) doc::util::find_marker_indices doc::util::find_marker_indices doc::util::text_divider->doc::util::find_marker_indices

Testcases:
No testcase defined.

doc::util::make_text_listable (private)

 doc::util::make_text_listable text_ref
Parameters:
text_ref

Partial Call Graph (max 5 caller/called nodes):
%3 doc::parse_comment_text doc::parse_comment_text (private) doc::util::make_text_listable doc::util::make_text_listable doc::parse_comment_text->doc::util::make_text_listable doc::util::bracket_space doc::util::bracket_space (private) doc::util::make_text_listable->doc::util::bracket_space doc::util::escape_square_brackets doc::util::escape_square_brackets (private) doc::util::make_text_listable->doc::util::escape_square_brackets template::util::quote_space template::util::quote_space (private) doc::util::make_text_listable->template::util::quote_space

Testcases:
No testcase defined.

doc::util::sort_see (private)

 doc::util::sort_see element1 element2

used to sort the see list, which has structure [name {name} type {type} url {url}]

Parameters:
element1 - the first of the two list elements to be compared
element2 - {default actually, no default value for this because it is required} the second of the two elements to be compared

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

doc::util::text_divider (private)

 doc::util::text_divider text_ref marker

divides a string variable into a list of strings, all but the first element beginning with the indicated text marker; the first element of the created list contains all of the string preceding the first occurrence of the text marker

Parameters:
text_ref - name of string variable (not the string value itself)
marker - the string indicating text division
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 doc::parse_file doc::parse_file (private) doc::util::text_divider doc::util::text_divider doc::parse_file->doc::util::text_divider doc::parse_namespace doc::parse_namespace (private) doc::parse_namespace->doc::util::text_divider doc::set_proc_name_source_text_comment_text doc::set_proc_name_source_text_comment_text (private) doc::set_proc_name_source_text_comment_text->doc::util::text_divider doc::sort_see doc::sort_see (private) doc::sort_see->doc::util::text_divider doc::util::find_marker_indices doc::util::find_marker_indices (private) doc::util::text_divider->doc::util::find_marker_indices

Testcases:
No testcase defined.

template::util::alphabetized_index (private)

 template::util::alphabetized_index list entry

takes an alphabetized list and an entry

Parameters:
list - {let's see how this parses out} the alphabetized list
entry - req the value to be inserted
Returns:
either the proper list index for an alphabetized insertion or -1 if the entry is already in the list

Partial Call Graph (max 5 caller/called nodes):
%3 doc::parse_namespace doc::parse_namespace (private) template::util::alphabetized_index template::util::alphabetized_index doc::parse_namespace->template::util::alphabetized_index

Testcases:
No testcase defined.

template::util::comment_text_normalize (private)

 template::util::comment_text_normalize text

escapes quotes and removes comment tags from a body of commented text

Parameters:
text
Returns:
text

Partial Call Graph (max 5 caller/called nodes):
%3 doc::parse_namespace doc::parse_namespace (private) template::util::comment_text_normalize template::util::comment_text_normalize doc::parse_namespace->template::util::comment_text_normalize doc::set_proc_name_source_text_comment_text doc::set_proc_name_source_text_comment_text (private) doc::set_proc_name_source_text_comment_text->template::util::comment_text_normalize

Testcases:
No testcase defined.

template::util::proc_element_compare (private)

 template::util::proc_element_compare element1 element2

used to compare two different elements in a list of parsed data for public or private procs

Parameters:
element1
element2

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

template::util::quote_space (private)

 template::util::quote_space text

just takes a body of text and puts a space behind every double quote; this is done so that the text body can be treated as a list without causing problems resulting from list elements being separated by characters other than a space

Parameters:
text - req/none the body of text to be worked on
Returns:
same text but with a space behind each quote; double quotes that are already trailed by a space are unaffected

Partial Call Graph (max 5 caller/called nodes):
%3 doc::parse_comment_text doc::parse_comment_text (private) template::util::quote_space template::util::quote_space doc::parse_comment_text->template::util::quote_space doc::parse_namespace doc::parse_namespace (private) doc::parse_namespace->template::util::quote_space doc::util::make_text_listable doc::util::make_text_listable (private) doc::util::make_text_listable->template::util::quote_space

Testcases:
No testcase defined.

template::util::write_from_template (private)

 template::util::write_from_template template file_name

takes a .adp template name and the name of the file to be written and creates the file; also puts out a notice before

Parameters:
template - the name of the template to be used in making the file
file_name - the name of the file to be created

Partial Call Graph (max 5 caller/called nodes):
%3 template::adp_compile template::adp_compile (public) template::adp_eval template::adp_eval (public) template::util::read_file template::util::read_file (public) template::util::write_from_template template::util::write_from_template template::util::write_from_template->template::adp_compile template::util::write_from_template->template::adp_eval template::util::write_from_template->template::util::read_file

Testcases:
No testcase defined.
[ show source ]