- Publicity: Public Only All
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.22 2024/09/11 06:15:48 gustafn Exp $
Procedures in this file
- doc::parse_comment_text (private)
- doc::parse_file (private)
- doc::parse_namespace (private)
- doc::parse_tcl_library (private)
- doc::set_proc_name_source_text_comment_text (private)
- doc::sort_see (private)
- doc::util::bracket_space (private)
- doc::util::dbl_colon_fix (private)
- doc::util::escape_square_brackets (private)
- doc::util::find_marker_indices (private)
- doc::util::make_text_listable (private)
- doc::util::sort_see (private)
- doc::util::text_divider (private)
- template::util::alphabetized_index (private)
- template::util::comment_text_normalize (private)
- template::util::proc_element_compare (private)
- template::util::quote_space (private)
- template::util::write_from_template (private)
Detailed information
doc::parse_comment_text (private)
doc::parse_comment_text proc_block
called by parse_namespace
- Parameters:
- proc_block (required)
- Partial Call Graph (max 5 caller/called nodes):
- 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:
Valid directives in a procedure doc include:
- 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
- @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 (required)
- Partial Call Graph (max 5 caller/called nodes):
- 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 (required)
- namespace text body
- Author:
- simon
- Partial Call Graph (max 5 caller/called nodes):
- 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 (required)
- 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):
- 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 (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
doc::sort_see (private)
doc::sort_see list_ref directive_comments
procedure to deal with @see comments
- Parameters:
- list_ref (required)
- directive_comments (required)
- Partial Call Graph (max 5 caller/called nodes):
- 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 (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
doc::util::dbl_colon_fix (private)
doc::util::dbl_colon_fix text
- Parameters:
- text (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
doc::util::escape_square_brackets (private)
doc::util::escape_square_brackets text
escapes out all square brackets
- Parameters:
- text (required)
- Partial Call Graph (max 5 caller/called nodes):
- 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 (required)
- body of text to be searched through
- marker (required)
- 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:
- namespace doc
- doc::parse_file
- doc::parse_namespace
- doc::util::text_divider
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
doc::util::make_text_listable (private)
doc::util::make_text_listable text_ref
- Parameters:
- text_ref (required)
- Partial Call Graph (max 5 caller/called nodes):
- 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 (required)
- the first of the two list elements to be compared
- element2 (required)
- {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):
- 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 (required)
- name of string variable (not the string value itself)
- marker (required)
- the string indicating text division
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::util::alphabetized_index (private)
template::util::alphabetized_index list entry
takes an alphabetized list and an entry
- Parameters:
- list (required)
- {let's see how this parses out} the alphabetized list
- entry (required)
- 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):
- 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 (required)
- Returns:
- text
- Partial Call Graph (max 5 caller/called nodes):
- 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 (required)
- element2 (required)
- Partial Call Graph (max 5 caller/called nodes):
- 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 (required)
- 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):
- 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 (required)
- the name of the template to be used in making the file
- file_name (required)
- the name of the file to be created
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.