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.78 -r1.79
--- openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 21 Oct 2024 08:11:40 -0000 1.78
+++ openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 22 Oct 2024 09:03:42 -0000 1.79
@@ -43,16 +43,6 @@
set tcl_api_html_index "https://www.tcl-lang.org/man/tcl$::tcl_version/TclCmd/contents.htm"
- # set style {
- # .code .comment {color: #006600; font-weight: normal; font-style: italic;}
- # .code .keyword {color: #0000AA; font-weight: bold; font-style: normal;}
- # .code .string {color: #990000; font-weight: normal; font-style: italic;}
- # .code .var {color: #660066; font-weight: normal; font-style: normal;}
- # .code .proc {color: #0000CC; font-weight: normal; font-style: normal;}
- # .code .object {color: #000066; font-weight: bold; font-style: normal;}
- # .code .helper {color: #0000CC; font-weight: bold; font-style: normal;}
- # pre.code a {text-decoration: none;}
- # }
set style {
.code .comment {color: #717ab3; font-weight: normal; font-style: italic;}
.code .keyword {color: #7f0055; font-weight: normal; font-style: normal;}
@@ -407,6 +397,8 @@
lappend param_details boolean
} elseif {"int" in $flags || "integer" in $flags} {
lappend param_details integer
+ } elseif {"object" in $flags} {
+ lappend param_details object
}
if {"0..1" in $flags} {
lappend param_details "accept empty"
@@ -513,6 +505,10 @@
} else {
set pretty_proc_name [subst {<instance of [::xo::api object_link $scope $cl]> $method}]
}
+ #
+ # Make sure we have the newest update in the nsv
+ #
+ ::xo::api update_object_doc $scope $cl ""
} else {
set xotclArgs 0
if {[namespace which ::xo::api] ne "" && [::xo::api isclass "" [lindex $proc_name 1]]} {
@@ -579,6 +575,7 @@
if { [llength $switches] > 0 } {
append blocks_out "
Switches:\n"
foreach switch $switches {
+ #ns_log notice "==== switch '$switch': flags <$flags($switch)>"
set details [api_proc_pretty_param_details \
-flags $flags($switch) \
{*}[expr {[info exists default_values($switch)]
@@ -598,6 +595,7 @@
if { [llength $doc_elements(positionals)] > 0 } {
append blocks_out "- Parameters:
\n"
foreach positional $doc_elements(positionals) {
+ #ns_log notice "==== parameter '$positional': info exists flags($positional): [info exists flags($positional)]"
set pflags [expr {[info exists flags($positional)] ? $flags($positional) : {}}]
if {![info exists default_values($positional)]} {
lappend pflags required
Index: openacs-4/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl,v
diff -u -r1.68 -r1.69
--- openacs-4/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl 11 Sep 2024 06:15:47 -0000 1.68
+++ openacs-4/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl 22 Oct 2024 09:03:42 -0000 1.69
@@ -6,6 +6,57 @@
nsv_array set proc_doc [list]
nsv_array set proc_source_file [list]
+if {[info commands ::nx::Class] ne ""} {
+ nx::Class create xo::DocHelper {
+ #
+ # Helper class to determine the sourcefile, where some "public",
+ # "private", or plain "methods" is defined. The mixin is just
+ # active during initial bootstrap of the server. The definition
+ # assumes, that all definitions for a class are from the same
+ # file.
+ #
+ :method register_filename {} {
+ nsv_set proc_source_file " Class [self]" [info script]
+ #ns_log notice "INIT registered epoch [ns_ictl epoch] [self] script [info script]"
+ }
+ :public method method {args} {
+ :register_filename
+ return [next]
+ }
+ :public method public {what name args} {
+ :register_filename
+ return [next]
+ }
+ :public method private {what name args} {
+ :register_filename
+ return [next]
+ }
+ #
+ # Alternate approach, would require a small change in NX.
+ #
+ # :public method create {name args} {
+ # #ns_log notice "INIT create [self] $name (epoch [ns_ictl epoch])"
+ # set r [next]
+ # if {[self] eq "::nx::Class" && [ns_ictl epoch] < 2} {
+ # set key " Class $name"
+ # nsv_set proc_source_file $key [info script]
+ # ns_log notice "INIT nsv_set proc_source_file $key [info script]"
+ # #
+ # # Problem with
+ # # ::nx::Class create ::acs::SiteNode {
+ # # ... :create site_node
+ # # }
+ # }
+ # return $r
+ # }
+ }
+ if {[ns_ictl epoch] == 0} {
+ nx::Class mixins add xo::DocHelper
+ #ns_log notice "REGISTER xo::DocHelper INIT epoch [ns_ictl epoch]"
+ }
+} else {
+ ns_log error "no NSD/NX available. Installation is apprently incomplete or misconfigured"
+}
#
# Safety belt for ::acs::useNsfProc for upgrade phase to oacs-5-9
Index: openacs-4/packages/acs-bootstrap-installer/tcl/procdoc-init.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/tcl/procdoc-init.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-bootstrap-installer/tcl/procdoc-init.tcl 22 Oct 2024 09:03:42 -0000 1.1
@@ -0,0 +1,13 @@
+if {[info commands ::xo::api] ne ""} {
+ ns_log notice "updating online documentation using xo::api"
+ ::xo::api update_nx_docs
+ ns_log notice "updating online documentation using xo::api DONE"
+} else {
+ ns_log warning "INIT: no xo::api available"
+}
+
+# Local variables:
+# mode: tcl
+# tcl-indent-level: 4
+# indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/xotcl-core/tcl/03-doc-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/03-doc-procs.tcl,v
diff -u -r1.24 -r1.25
--- openacs-4/packages/xotcl-core/tcl/03-doc-procs.tcl 11 Sep 2024 06:15:56 -0000 1.24
+++ openacs-4/packages/xotcl-core/tcl/03-doc-procs.tcl 22 Oct 2024 09:03:42 -0000 1.25
@@ -213,16 +213,31 @@
return $scope
}
- :public object method script_name {scope} {
+ :public object method script_name {-obj scope} {
+ #
+ # Determine name of the current "script" as displayed by "Defined
+ # in" in the API browser. Define different sources available in
+ # different situatons.
+ #
+ # @param obj class name for identifying the source file name
+ # @param scope either empty or thread name
+ # @return path starting with the "packages" directory
+ #
set script [info script]
- if {$script eq "" && [info exists ::xotcl::currentScript]} {
- set script $::xotcl::currentScript
+ if {$script eq "" || [file tail $script] eq "procdoc-init.tcl"} {
+ set script ""
+ if {$script eq "" && [info exists obj] && [nsv_get proc_source_file " Class $obj" script]} {
+ #ns_log notice "INIT script_name from proc_source_file => <$script>"
+ }
+ if {$script eq "" && [info exists ::xotcl::currentScript]} {
+ set script $::xotcl::currentScript
+ }
+ set root_dir $::acs::rootdir
+ set root_length [string length $root_dir]
+ if { $root_dir eq [string range $script 0 $root_length-1]} {
+ set script [string range $script $root_length+1 end]
+ }
}
- set root_dir $::acs::rootdir
- set root_length [string length $root_dir]
- if { $root_dir eq [string range $script 0 $root_length-1]} {
- set script [string range $script $root_length+1 end]
- }
return $script
}
@@ -340,7 +355,7 @@
varargs_p false \
deprecated_p false \
warn_p false \
- script [::xo::api script_name $scope] \
+ script [::xo::api script_name -obj $obj $scope] \
]
set doc [dict replace $doc {*}[array get doc_elements]]
@@ -443,7 +458,7 @@
varargs_p $varargs_p \
deprecated_p $deprecated \
warn_p false \
- script [::xo::api script_name $scope] \
+ script [::xo::api script_name -obj $obj $scope] \
main "" \
flags "" \
switches0 "" \
@@ -479,11 +494,13 @@
}
if {$isFlag} {
dict lappend doc switches0 $name
- dict lappend doc flags $name $flags
+ dict lappend doc flags $name [split $flags ,]
#:log "default_value $proc_name: $sw -> '[lindex $f 1]' <$pair/$f>"
if {$flags eq "switch" && $default eq ""} {
set default "false"
}
+ } else {
+ dict lappend doc flags $name [split $flags ,]
}
#:log "default_value $proc_name: $sw -> 'default' <$pair/$f>"
if {[llength $def] > 1} {
@@ -595,28 +612,13 @@
# The following extensions of the base classes are defined here:
#
::Serializer exportMethods {
- ::nx::Class method init
::xotcl::Object instproc ad_proc
::xotcl::Object instproc ad_forward
::xotcl::Class instproc ad_instproc
::xotcl::Class instproc ad_instforward
::xotcl::Object instproc ad_doc
}
-::nx::Class method init {} {
- set r [next]
- #
- # When loading the blueprint, ::xo::api might not be available yet.
- #
- if {[info commands ::xo::api] ne ""} {
- ::xo::api update_object_doc "" [self] ""
- #ns_log notice "METHODS [self] <[:info methods]>"
- } else {
- #ns_log notice "[self] init: no <::xo::api> available"
- }
- return $r
-}
-
::xotcl::Object instproc ad_proc {
{-private:switch false}
{-deprecated:switch false}