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 -r1.76 -r1.77
--- openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 20 Oct 2024 10:09:06 -0000 1.76
+++ openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 20 Oct 2024 15:23:13 -0000 1.77
@@ -394,6 +394,31 @@
return $result
}
+ad_proc -private api_proc_pretty_param_details {-flags:required -default_value} {
+ @return string with details about a parameter
+} {
+ set param_details {}
+ if {"required" in $flags} {
+ lappend param_details required
+ } else {
+ lappend param_details optional
+ }
+ if {"boolean" in $flags} {
+ lappend param_details boolean
+ } elseif {"int" in $flags || "integer" in $flags} {
+ lappend param_details integer
+ }
+ if {"0..1" in $flags} {
+ lappend param_details "accept empty"
+ }
+
+ if { [info exists default_value] && $default_value ne ""} {
+ lappend param_details "defaults to \"[ns_quotehtml $default_value]\"
"
+ }
+ return [expr {[llength $param_details]>0 ? "([join $param_details {, }])" : ""}]
+}
+
+
ad_proc -public api_proc_documentation {
-format
-script:boolean
@@ -554,25 +579,15 @@
if { [llength $switches] > 0 } {
append blocks_out "
\"[ns_quotehtml $default_values($switch)]\"
"
- }
+ ]
append blocks_out \
- "\"$default_values($positional)\"
"
- }
+ set pflags $flags($positional)
+ if {![info exists default_values($positional)]} {
+ lappend pflags required
}
+ set details [api_proc_pretty_param_details \
+ -flags $pflags \
+ {*}[expr {[info exists default_values($positional)]
+ ? [list -default_value $default_values($positional)]
+ : {}}] \
+ ]
append blocks_out \
- "