Index: openacs.org-dev/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl,v diff -u -r1.1.1.1 -r1.1.1.2 --- openacs.org-dev/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 9 Jul 2002 17:34:56 -0000 1.1.1.1 +++ openacs.org-dev/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 8 Oct 2002 15:46:41 -0000 1.1.1.2 @@ -80,7 +80,19 @@ } return [list] } - + +ad_proc -private api_format_see_list { sees } { + Generate an HTML list of referenced procs and pages. +} { + append out "
See Also:\n\n" + + return $out +} + ad_proc -private api_format_author_list { authors } { Generates an HTML-formatted list of authors (including <dt> and @@ -136,10 +148,15 @@ if { [info exists doc_elements(cvs-id)] } { append out "
CVS ID:\n
[ns_quotehtml [lindex $doc_elements(cvs-id) 0]]\n" } + if { [info exists doc_elements(see)] } { + append out [api_format_see_list $doc_elements(see)] + } return $out } + + ad_proc -public api_script_documentation { { -format text/html } path @@ -240,6 +257,16 @@ return $author_string } +ad_proc -private api_format_see { see } { + regsub -all {proc *} $see {} see + set see [string trim $see] + if {[nsv_exists api_proc_doc $see]} { + return "$see" + } else { + return $see + } +} + ad_proc -public api_library_documentation { { -format text/html } path @@ -449,7 +476,7 @@ } if { [llength $doc_elements(switches)] > 0 } { - append out "

Switches:
\n" + append out "
Switches:
\n" foreach switch $doc_elements(switches) { append out "-$switch" if { [lsearch $flags($switch) "boolean"] >= 0 } { @@ -476,7 +503,7 @@ } if { [llength $doc_elements(positionals)] > 0 } { - append out "

Parameters:
\n" + append out "
Parameters:
\n" foreach positional $doc_elements(positionals) { append out "$positional" if { [info exists default_values($positional)] } { @@ -494,6 +521,23 @@ append out "
\n" } + + # @option is used in template:: and cms:: (and maybe should be used in some other + # things like ad_form which have internal arg parsers. although an option + # and a switch are the same thing, just one is parsed in the proc itself rather than + # by ad_proc. + + if { [info exists doc_elements(option)] } { + append out "Options:
" + foreach param $doc_elements(option) { + if { [regexp {^([^ \t]+)[ \t](.+)$} $param "" name value] } { + append out "
-$name
$value
" + } + } + append out "
" + } + + if { [info exists doc_elements(return)] } { append out "
Returns:
[join $doc_elements(return) "
"]
\n" } @@ -505,7 +549,7 @@ append out [api_format_common_elements doc_elements] if { $source_p } { - append out "

Source code:
+ append out "
Source code:
[ns_quotehtml [info body $proc_name]]
 

\n" }