Index: openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl,v diff -u -N -r1.72.2.28 -r1.72.2.29 --- openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 22 Feb 2021 16:56:53 -0000 1.72.2.28 +++ openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 27 Feb 2021 22:25:31 -0000 1.72.2.29 @@ -360,6 +360,33 @@ return $out } + +ad_proc -private api_proc_format_switch {xotclArgs flags switch} { + if {$xotclArgs} { + if {"boolean" in $flags} { + set value "on|off " + } elseif {"switch" in $flags} { + set value "" + } else { + set value "$switch " + } + if {"required" in $flags} { + set result "-$switch $value" + } else { + set result "\[ -$switch $value\]" + } + } else { + if {"boolean" in $flags} { + set result "\[ -$switch \]" + } elseif {"required" in $flags} { + set result "-$switch $switch" + } else { + set result "\[ -$switch $switch \]" + } + } + return $result +} + ad_proc -public api_proc_documentation { -format -script:boolean @@ -397,7 +424,8 @@ array set doc_elements { flags "" default_values "" - switches "" + switches0 "" + switches1 "" positionals "" varargs_p 0 script "" @@ -459,29 +487,8 @@ } lappend command_line $pretty_proc_name - foreach switch $doc_elements(switches) { - if {$xotclArgs} { - if {"boolean" in $flags($switch)} { - set value "on|off " - } elseif {"switch" in $flags($switch)} { - set value "" - } else { - set value "$switch " - } - if {"required" in $flags($switch)} { - lappend command_line "-$switch $value" - } else { - lappend command_line "\[ -$switch $value\]" - } - } else { - if {"boolean" in $flags($switch)} { - lappend command_line "\[ -$switch \]" - } elseif {"required" in $flags($switch)} { - lappend command_line "-$switch $switch" - } else { - lappend command_line "\[ -$switch $switch \]" - } - } + foreach switch $doc_elements(switches0) { + lappend command_line [api_proc_format_switch $xotclArgs $flags($switch) $switch] } set counter 0 @@ -495,6 +502,10 @@ if { $doc_elements(varargs_p) } { lappend command_line "\[ args... \]" } + foreach switch $doc_elements(switches1) { + lappend command_line [api_proc_format_switch $xotclArgs $flags($switch) $switch] + } + append out [util_wrap_list $command_line] set intro_out "" @@ -527,9 +538,10 @@ } } - if { [llength $doc_elements(switches)] > 0 } { + set switches [concat $doc_elements(switches0) $doc_elements(switches1)] + if { [llength $switches] > 0 } { append blocks_out "
Switches:
\n" - foreach switch $doc_elements(switches) { + foreach switch $switches { append blocks_out "
-$switch" if {"boolean" in $flags($switch)} { append blocks_out " (boolean)"