| |
170 |
170 |
return $html |
| |
171 |
171 |
} |
| |
172 |
172 |
|
| |
173 |
173 |
:public object method method_link {{-label ""} obj kind method} { |
| |
174 |
174 |
# |
| |
175 |
175 |
# Return a link for the method if possible. If no proc-doc is |
| |
176 |
176 |
# available, return just plain text. |
| |
177 |
177 |
# |
| |
178 |
178 |
set kind [string trimright $kind s] |
| |
179 |
179 |
set proc_index [::xo::api proc_index "" $obj $kind $method] |
| |
180 |
180 |
if {$label eq ""} { |
| |
181 |
181 |
set label $method |
| |
182 |
182 |
} |
| |
183 |
183 |
if {[nsv_exists api_proc_doc $proc_index]} { |
| |
184 |
184 |
return "<a href='/api-doc/proc-view?proc=[ns_urlencode $proc_index]'>$label</a>" |
| |
185 |
185 |
} else { |
| |
186 |
186 |
if {[::apidoc::get_object_property $obj $kind $method] eq ""} { |
| |
187 |
187 |
# |
| |
188 |
188 |
# Try to handle aliases via the alias definition |
| |
189 |
189 |
# |
| |
190 |
|
set definition [ns_cache info {*}[expr {$kind eq "proc" ? "object" : ""}] method definition $method] |
| |
|
190 |
set definition [$obj info {*}[expr {$kind eq "proc" ? "object" : ""}] method definition $method] |
| |
191 |
191 |
if {[lindex $definition end-2] eq "alias"} { |
| |
192 |
192 |
return "<a href='/api-doc/proc-view?proc=[ns_urlencode [lindex $definition end]]'>$label</a>" |
| |
193 |
193 |
} |
| |
194 |
194 |
# |
| |
195 |
195 |
# Must be something implemented in C |
| |
196 |
196 |
# |
| |
197 |
197 |
return $method<SUP>C</SUP> |
| |
198 |
198 |
} else { |
| |
199 |
199 |
return $method |
| |
200 |
200 |
} |
| |
201 |
201 |
} |
| |
202 |
202 |
} |
| |
203 |
203 |
|
| |
204 |
204 |
:public object method scope_eval {scope args} { |
| |
205 |
205 |
# |
| |
206 |
206 |
# When the scope is not empty, evaluate the command in the |
| |
207 |
207 |
# specified scope (thread) |
| |
208 |
208 |
# |
| |
209 |
209 |
if {$scope eq ""} { |
| |
210 |
210 |
{*}$args |