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.27.8.21 -r1.27.8.22 --- openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 10 Sep 2014 16:54:49 -0000 1.27.8.21 +++ openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 10 Sep 2014 20:19:26 -0000 1.27.8.22 @@ -217,7 +217,7 @@ # # XXX: Need to support "Returns Properties:" # } append out "
Location:
$path\n" - append out [::apidoc::api_format_common_elements doc_elements] + append out [::apidoc::format_common_elements doc_elements] append out "" @@ -254,7 +254,7 @@ if { [info exists doc_elements(author)] } { append out "
Author[ad_decode [llength $doc_elements(author)] 1 "" "s"]:\n" foreach author $doc_elements(author) { - append out "
[::apidoc::api_format_author $author]\n" + append out "
[::apidoc::format_author $author]\n" } } if { [info exists doc_elements(cvs-id)] } { @@ -319,7 +319,7 @@ } append out \ - [::apidoc::api_format_common_elements doc_elements] \ + [::apidoc::format_common_elements doc_elements] \ "
Location:
$doc_elements(script)\n" \ "\n" @@ -524,15 +524,15 @@ append out "
Error:
[join $doc_elements(error) "
"]
\n" } - append out [::apidoc::api_format_common_elements doc_elements] + append out [::apidoc::format_common_elements doc_elements] if { $source_p } { if {[parameter::get_from_package_key \ -package_key acs-api-browser \ -parameter FancySourceFormattingP \ -default 1]} { append out [subst {
Source code:
-
[::apidoc::api_tcl_to_html $proc_name]
+
[::apidoc::tcl_to_html $proc_name]

}] } else { @@ -729,7 +729,7 @@ return [ns_quotehtml $readable_xml] } - ad_proc -private api_format_see { see } { + ad_proc -public format_see { see } { regsub -all {proc *} $see {} see set see [string trim $see] if {[nsv_exists api_proc_doc $see]} { @@ -745,7 +745,7 @@ return ${see} } - ad_proc -private api_format_author { author_string } { + ad_proc -public format_author { author_string } { if { [regexp {^[^ \n\r\t]+$} $author_string] && [string first "@" $author_string] >= 0 && [string first ":" $author_string] < 0 } { @@ -756,24 +756,24 @@ return $author_string } - ad_proc -private api_format_changelog_list { changelog } { + ad_proc -private format_changelog_list { changelog } { Format the change log info } { append out "

Changelog:\n" foreach change $changelog { - append out "
[api_format_changelog_change $change]
\n" + append out "
[format_changelog_change $change]
\n" } return $out } - ad_proc -private api_format_changelog_change { change } { + ad_proc -private format_changelog_change { change } { Formats the change log line: turns email addresses in parenthesis into links. } { regsub {\(([^ \n\r\t]+@[^ \n\r\t]+\.[^ \n\r\t]+)\)} $change {(\1)} change return $change } - ad_proc -private api_format_author_list { authors } { + ad_proc -private format_author_list { authors } { Generates an HTML-formatted list of authors (including <dt> and @@ -788,48 +788,48 @@ } append out "
Author[ad_decode [llength $authors] 1 "" "s"]:\n" foreach author $authors { - append out "
[api_format_author $author]
\n" + append out "
[format_author $author]
\n" } return $out } - ad_proc -private api_format_common_elements { doc_elements_var } { + ad_proc -private format_common_elements { doc_elements_var } { upvar $doc_elements_var doc_elements set out "" if { [info exists doc_elements(author)] } { - append out [api_format_author_list $doc_elements(author)] + append out [format_author_list $doc_elements(author)] } if { [info exists doc_elements(creation-date)] } { append out "
Created:\n
[lindex $doc_elements(creation-date) 0]
\n" } if { [info exists doc_elements(change-log)] } { - append out [api_format_changelog_list $doc_elements(change-log)] + append out [format_changelog_list $doc_elements(change-log)] } 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)] + append out [format_see_list $doc_elements(see)] } return $out } - ad_proc -private api_format_see_list { sees } { + ad_proc -private 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_first_sentence { string } { + ad_proc -private first_sentence { string } { Returns the first sentence of a string. @@ -840,7 +840,7 @@ return $string } - ad_proc -private api_set_public { + ad_proc -private set_public { version_id { public_p "" } } { @@ -922,7 +922,7 @@ return $score } - ad_proc -private api_is_xotcl_object {scope proc_name} { + ad_proc -private is_xotcl_object {scope proc_name} { Checks, whether the specified argument is an xotcl object. Does not cause problems when xocl is not loaded. @return boolean value @@ -934,7 +934,7 @@ return $result } - ad_proc -private api_tcl_to_html {proc_name} { + ad_proc -private tcl_to_html {proc_name} { Given a proc name, formats it as HTML, including highlighting syntax in various colors and creating hyperlinks to other proc definitions.
@@ -964,7 +964,7 @@ set proc_namespace "" regexp {^(::)?(.*)::[^:]+$} $proc_name match colons proc_namespace - return [api_tclcode_to_html -scope $scope -proc_namespace $proc_namespace [api_get_body $proc_name]] + return [tclcode_to_html -scope $scope -proc_namespace $proc_namespace [api_get_body $proc_name]] } @@ -1070,7 +1070,7 @@ return "$token" } - ad_proc -private api_tclcode_to_html {{-scope ""} {-proc_namespace ""} script} { + ad_proc -public tclcode_to_html {{-scope ""} {-proc_namespace ""} script} { Given a script, this proc formats it as HTML, including highlighting syntax in various colors and creating hyperlinks to other proc definitions.
@@ -1081,7 +1081,7 @@ } { set script [string trimright $script] - template::head::add_style -style $apidoc::style + template::head::add_style -style $::apidoc::style # Keywords will be colored as other procs, but not hyperlinked # to api-doc pages. Perhaps we should hyperlink them to the Tcl man pages? @@ -1196,8 +1196,8 @@ set procl [length_proc [string range $data $i end]] set proc_name [string range $data $i $i+$procl] - if {$proc_name eq "*"} { - append html * + if {$proc_name eq "*" || $proc_name eq "@"} { + append html $proc_name } elseif {$proc_name in $::apidoc::KEYWORDS || ([regexp {^::(.*)} $proc_name match had_colons] && $had_colons in $::apidoc::KEYWORDS)} { @@ -1211,7 +1211,7 @@ } elseif {$proc_name in $XOTCL_KEYWORDS} { append html [pretty_token keyword $proc_name] - } elseif {[api_is_xotcl_object $scope $proc_name]} { + } elseif {[is_xotcl_object $scope $proc_name]} { set url [::xotcl::api object_url \ -show_source 1 -show_methods 2 \ $scope $proc_name] @@ -1277,7 +1277,7 @@ return [string range $html 1 end] } - ad_proc -private api_xql_links_list { path } { + ad_proc -private xql_links_list { path } { Returns list of xql files related to tcl script file @param path path and filename from $::acs::rootdir Index: openacs-4/packages/acs-api-browser/www/content-page-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/www/content-page-view.adp,v diff -u -r1.10.16.1 -r1.10.16.2 --- openacs-4/packages/acs-api-browser/www/content-page-view.adp 11 Sep 2013 09:51:27 -0000 1.10.16.1 +++ openacs-4/packages/acs-api-browser/www/content-page-view.adp 10 Sep 2014 20:19:26 -0000 1.10.16.2 @@ -31,6 +31,6 @@

Content File Source

-
<%= $file_contents %>
+
@file_contents;literal@
Index: openacs-4/packages/acs-api-browser/www/content-page-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/www/content-page-view.tcl,v diff -u -r1.5.4.6 -r1.5.4.7 --- openacs-4/packages/acs-api-browser/www/content-page-view.tcl 2 Sep 2014 18:04:07 -0000 1.5.4.6 +++ openacs-4/packages/acs-api-browser/www/content-page-view.tcl 10 Sep 2014 20:19:26 -0000 1.5.4.7 @@ -64,20 +64,11 @@ multirow create xql_links link } else { if { $source_p } { - if {[catch { - - set fd [open $filename r] - set file_contents [read $fd] - close $fd - - } err ]} { - set file_contents "error opening '$filename'\n$err" - } else { - set file_contents [ad_quotehtml $file_contents] - } + set file_contents [template::util::read_file $filename] + set file_contents [apidoc::tclcode_to_html $file_contents] } - template::util::list_to_multirow xql_links [::apidoc::api_xql_links_list $path] + template::util::list_to_multirow xql_links [::apidoc::xql_links_list $path] } Index: openacs-4/packages/acs-api-browser/www/package-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/www/package-view.adp,v diff -u -r1.6.22.3 -r1.6.22.4 --- openacs-4/packages/acs-api-browser/www/package-view.adp 16 Oct 2013 20:08:07 -0000 1.6.22.3 +++ openacs-4/packages/acs-api-browser/www/package-view.adp 10 Sep 2014 20:19:26 -0000 1.6.22.4 @@ -9,7 +9,7 @@ - + @@ -21,8 +21,8 @@
@procs_files.path@@procs_files.path@       @procs_files.first_sentence@ 
- - + + @@ -34,7 +34,7 @@
@procedures.proc@
@procedures.proc@       @procedures.first_sentence@ 
- + @@ -46,9 +46,9 @@
@sql_files.path@        
- + -
@content_pages.indentation;noquote@ + @content_pages.indentation;noquote@ @content_pages.name@ Index: openacs-4/packages/acs-api-browser/www/package-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/www/package-view.tcl,v diff -u -r1.7.2.7 -r1.7.2.8 --- openacs-4/packages/acs-api-browser/www/package-view.tcl 2 Sep 2014 18:04:07 -0000 1.7.2.7 +++ openacs-4/packages/acs-api-browser/www/package-view.tcl 10 Sep 2014 20:19:27 -0000 1.7.2.8 @@ -26,7 +26,7 @@ content_pages:multirow } -set public_p [::apidoc::api_set_public $version_id $public_p] +set public_p [::apidoc::set_public $version_id $public_p] db_0or1row pretty_name_from_package_id { select pretty_name, package_key, version_name @@ -76,7 +76,7 @@ if { [nsv_exists api_library_doc $full_path] } { array set doc_elements [nsv_get api_library_doc $full_path] - set first_sentence [::apidoc::api_first_sentence [lindex $doc_elements(main) 0]] + set first_sentence [::apidoc::first_sentence [lindex $doc_elements(main) 0]] set view procs-file-view } else { set first_sentence "" @@ -106,7 +106,7 @@ continue } } - multirow append procedures $proc [::apidoc::api_first_sentence [lindex $doc_elements(main) 0]] + multirow append procedures $proc [::apidoc::first_sentence [lindex $doc_elements(main) 0]] } } sql_files { @@ -156,7 +156,7 @@ set type $doc_elements(type) } if { [info exists doc_elements(main)] } { - set first_sentence [::apidoc::api_first_sentence [lindex $doc_elements(main) 0]] + set first_sentence [::apidoc::first_sentence [lindex $doc_elements(main) 0]] } } else { set content_type directory Index: openacs-4/packages/acs-api-browser/www/procs-file-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/www/procs-file-view.tcl,v diff -u -r1.3.10.4 -r1.3.10.5 --- openacs-4/packages/acs-api-browser/www/procs-file-view.tcl 2 Sep 2014 18:04:07 -0000 1.3.10.4 +++ openacs-4/packages/acs-api-browser/www/procs-file-view.tcl 10 Sep 2014 20:19:27 -0000 1.3.10.5 @@ -25,9 +25,9 @@ } if {[info exists version_id]} { - set public_p [::apidoc::api_set_public $version_id $public_p] + set public_p [::apidoc::set_public $version_id $public_p] } else { - set public_p [::apidoc::api_set_public "" $public_p] + set public_p [::apidoc::set_public "" $public_p] } set dimensional_list { Index: openacs-4/packages/acs-api-browser/www/type-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/www/Attic/type-view.tcl,v diff -u -r1.3.20.4 -r1.3.20.5 --- openacs-4/packages/acs-api-browser/www/type-view.tcl 2 Sep 2014 18:04:07 -0000 1.3.20.4 +++ openacs-4/packages/acs-api-browser/www/type-view.tcl 10 Sep 2014 20:19:27 -0000 1.3.20.5 @@ -24,7 +24,7 @@ } -set public_p [::apidoc::api_set_public $version_id] +set public_p [::apidoc::set_public $version_id] set context [list] Index: openacs-4/packages/xotcl-core/www/show-object.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/www/show-object.tcl,v diff -u -r1.15.6.9 -r1.15.6.10 --- openacs-4/packages/xotcl-core/www/show-object.tcl 4 Sep 2014 12:43:04 -0000 1.15.6.9 +++ openacs-4/packages/xotcl-core/www/show-object.tcl 10 Sep 2014 20:19:27 -0000 1.15.6.10 @@ -222,7 +222,7 @@ if { [info exists doc_elements(see)] } { append output "
See Also:\n" foreach seeref $doc_elements(see) { - append output "
[::apidoc::api_format_see $seeref]\n" + append output "
[::apidoc::format_see $seeref]\n" } } if { [info exists doc_elements(creation-date)] } { @@ -231,7 +231,7 @@ if { [info exists doc_elements(author)] } { append output "
Author[ad_decode [llength $doc_elements(author)] 1 "" "s"]:\n" foreach author $doc_elements(author) { - append output "
[::apidoc::api_format_author $author]\n" + append output "
[::apidoc::format_author $author]\n" } } if { [info exists doc_elements(cvs-id)] } { @@ -274,7 +274,7 @@ if { $show_source } { append output \ "
" \
-        [::apidoc::api_tcl_to_html [::xotcl::api proc_index $scope $object $proc $m]] \
+        [::apidoc::tcl_to_html [::xotcl::api proc_index $scope $object $proc $m]] \
         
} return $output @@ -304,7 +304,7 @@ if { $show_source } { append output \ "
" \
-              [::apidoc::api_tcl_to_html [::xotcl::api proc_index $scope $object instproc $m]] \
+              [::apidoc::tcl_to_html [::xotcl::api proc_index $scope $object instproc $m]] \
               
} } Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -r1.239.2.18 -r1.239.2.19 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 3 Sep 2014 20:17:42 -0000 1.239.2.18 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 10 Sep 2014 20:19:27 -0000 1.239.2.19 @@ -1467,8 +1467,8 @@ } code_listing instproc pretty_value {v} { [my object] do_substitutions 0 - if {[info commands ::apidoc::api_tclcode_to_html] ne ""} { - set html [::apidoc::api_tclcode_to_html [my value]] + if {[info commands ::apidoc::tclcode_to_html] ne ""} { + set html [::apidoc::tclcode_to_html [my value]] regsub -all "\n?\r" $html html return "
$html
" } else {