Commit 76c4c08d authored by Frank Bergmann's avatar Frank Bergmann

- OpenACS 5.9

parent 0dbf680f
......@@ -2,23 +2,23 @@
<!-- Generated by the OpenACS Package Manager -->
<package key="acs-api-browser" url="http://openacs.org/repository/apm/packages/acs-api-browser/" type="apm_service">
<package-name>API Browser</package-name>
<pretty-plural>API Browsers</pretty-plural>
<package-name>ACS API Browser</package-name>
<pretty-plural>ACS API Browsers</pretty-plural>
<initial-install-p>t</initial-install-p>
<singleton-p>t</singleton-p>
<version name="5.10.0d1" url="http://openacs.org/repository/download/apm/acs-api-browser-5.10.0d1.apm">
<version name="5.9.0" url="http://openacs.org/repository/download/apm/acs-api-browser-5.9.0.apm">
<owner url="http://openacs.org">OpenACS</owner>
<summary>Interactive documentation for the Tcl and SQL APIs.</summary>
<release-date>2013-09-08</release-date>
<release-date>2015-10-04</release-date>
<maturity>3</maturity>
<vendor url="http://openacs.org">OpenACS</vendor>
<license url="http://www.gnu.org/copyleft/gpl.html">GPL</license>
<maturity>3</maturity>
<description format="text/html">On line interactive documentation for the locally installed Tcl and SQL APIs. Links to the Tcl core and AOLServer online documentation as well.</description>
<provides url="acs-api-browser" version="5.10.0d1"/>
<requires url="acs-kernel" version="5.10.0d1"/>
<provides url="acs-api-browser" version="5.9.0"/>
<requires url="acs-kernel" version="5.9.0"/>
<callbacks>
</callbacks>
......
......@@ -69,3 +69,9 @@ switch [db_type] {
}
}
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -105,7 +105,7 @@ ad_proc -public api_read_script_documentation {
regsub -all {\#.*$} $line "" line
set line [string trim $line]
if { $line ne "" } {
set has_contract_p [regexp {(^ad_page_contract\s)|( initialize )} $line match]
set has_contract_p [regexp {(^ad_(page|include)_contract\s)|(Package initialize )} $line]
break
}
}
......@@ -128,7 +128,7 @@ ad_proc -public api_read_script_documentation {
if {[regexp {^ad_page_contract documentation} $::errorInfo] } {
array set doc_elements $error
}
if { [info exists doc_elements] } {
if { [array exists doc_elements] } {
return [array get doc_elements]
}
return [list]
......@@ -764,26 +764,42 @@ namespace eval ::apidoc {
}
ad_proc -public format_see { see } {
Takes the value in the argument "see" and possibly formats it
into a link that will give the user more info about that
resource
@param see a string expected to comtain the resource to format
@return the html string representing the resource
} {
regsub -all {proc *} $see {} see
set see [string trim $see]
if {[nsv_exists api_proc_doc $see]} {
return "<a href=\"[ns_quotehtml proc-view?proc=[ns_urlencode ${see}]]\">$see</a>"
set href [export_vars -base proc-view {{proc $see}}]
return [subst {<a href="[ns_quotehtml $href]">$see</a>}]
}
if {[string match "/doc/*.html" $see]
if {[string match "/doc/*" $see]
|| [util_url_valid_p $see]} {
return "<a href=\"[ns_quotehtml $see]\">$see</a>"
return [subst {<a href="[ns_quotehtml $see]">$see</a>}]
}
if {[file exists "$::acs::rootdir${see}"]} {
return "<a href=\"[ns_quotehtml content-page-view?source_p=1&path=[ns_urlencode $see]]\">$see</a>"
set href [export_vars -base content-page-view {{source_p 1} {path $see}}]
return [subst {<a href="[ns_quotehtml $href]">$see</a>}]
}
return ${see}
}
ad_proc -public format_author { author_string } {
Extracts information about the author and formats it into an
HTML string.
@param author_string author information to format
@return the formatted result
} {
if { [regexp {^[^ \n\r\t]+$} $author_string]
&& [string first "@" $author_string] >= 0
&& [string first ":" $author_string] < 0 } {
return "<a href=\"mailto:$author_string\">$author_string</a>"
return [subst {<a href="mailto:$author_string">$author_string</a>}]
} elseif { [regexp {^([^\(\)]+)\s+\((.+)\)$} [string trim $author_string] {} name email] } {
return "$name &lt;<a href=\"mailto:$email\">$email</a>&gt;"
}
......@@ -971,15 +987,15 @@ namespace eval ::apidoc {
Given a proc name, formats it as HTML, including highlighting syntax in
various colors and creating hyperlinks to other proc definitions.<BR>
The inspiration for this proc was the tcl2html script created by Jeff Hobbs.
<P>
<p>
Known Issues:
<OL>
<LI> This proc will mistakenly highlight switch strings that look like commands as commands, etc.
<LI> There are many undocumented AOLserver commands including all of the commands added by modules.
<LI> When a proc inside a string has explicitly quoted arguments, they are not formatted.
<LI> regexp and regsub are hard to parse properly. E.g. If we use the start option, and we quote its argument,
<ol>
<li> This proc will mistakenly highlight switch strings that look like commands as commands, etc.
<li> There are many undocumented AOLserver commands including all of the commands added by modules.
<li> When a proc inside a string has explicitly quoted arguments, they are not formatted.
<li> regexp and regsub are hard to parse properly. E.g. If we use the start option, and we quote its argument,
and we have an ugly regexp, then this code might highlight it incorrectly.
</OL>
</ol>
@author Jamie Rasmussen (jrasmuss@mle.ie)
......
......@@ -19,4 +19,9 @@ aa_register_case \
aa_true "api documentation proc can document itself" \
[ string match "*packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl*" $result]
}
}
\ No newline at end of file
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -84,3 +84,9 @@ template::util::list_to_multirow xql_links [::apidoc::xql_links_list $path]
set title [file tail $path]
set script_documentation [api_script_documentation $path]
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -28,3 +28,9 @@ foreach proc [lsort [nsv_array names api_proc_doc]] {
}
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -74,3 +74,9 @@ if { $safe_p } {
} else {
ad_return_warning "Invalid file location" "Can only display files in package or doc directory"
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -61,3 +61,9 @@ if { [info exists about_package_key] } {
}
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -11,8 +11,8 @@ ad_page_contract {
} {
version_id:naturalnum,notnull
{ public_p:boolean "" }
{ kind "procs_files" }
{ about_package_key ""}
{ kind:word "procs_files" }
{ about_package_key:token ""}
} -properties {
title:onevalue
context:onevalue
......@@ -79,7 +79,12 @@ switch $kind {
set first_sentence [::apidoc::first_sentence [lindex $doc_elements(main) 0]]
set view procs-file-view
} else {
set first_sentence ""
array set doc_elements [api_read_script_documentation $full_path]
if { [info exists doc_elements(main)] } {
set first_sentence [::apidoc::first_sentence [lindex $doc_elements(main) 0]]
} else {
set first_sentence ""
}
set view content-page-view
}
......@@ -171,3 +176,9 @@ switch $kind {
}
}
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -54,3 +54,9 @@ set name [string tolower $name]
db_release_unused_handles
ad_return_template
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -14,16 +14,14 @@ ad_page_contract {
set context [list "All PL/SQL Subprograms"]
# Organize the subprograms under three headings: FUNCTION, PROCEDURE,
# and PACKAGE.
#
# Organize the subprograms und types like FUNCTION, PROCEDURE, and
# PACKAGE in oracle or FUNCTION in PostgresSQL
#
db_multirow all_subprograms all_subprograms {}
db_multirow all_subprograms all_subprograms {
select object_type as type, object_name as name
from user_objects
where object_type in ('PACKAGE', 'PROCEDURE', 'FUNCTION')
order by
decode(object_type, 'PACKAGE', 0, 'PROCEDURE', 1, 'FUNCTION', 2) asc
}
db_release_unused_handles
ad_return_template
\ No newline at end of file
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -64,3 +64,9 @@ foreach sublist $matches {
multirow append proc_list $file $proc $url
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -186,3 +186,9 @@ foreach output $private_matches {
set show_private_url [export_vars -base [ad_conn url] -override { { show_private_p 1 } } { name_weight doc_weight param_weight source_weight search_type query_string show_deprecated_p }]
set hide_private_url [export_vars -base [ad_conn url] -override { { show_private_p 0 } } { name_weight doc_weight param_weight source_weight search_type query_string show_deprecated_p }]
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -7,19 +7,18 @@
</if>
<else>
<table width="100%">
<tr><td style="background: #eeeeee">@documentation;noquote@</td></tr>
<tr><td style="background: #eeeeee">@documentation;literal@</td></tr>
</table>
<if @source_p@ eq 0>
[ <a href="proc-view?proc=@proc@&amp;source_p=1&amp;version_id=@version_id@">show source</a> ]
[ <a href="@procViewToggleURL;noi18n@">show source</a> ]
</if>
<else>
[ <a href="proc-view?proc=@proc@&amp;source_p=0&amp;version_id=@version_id@">hide source</a> ]
[ <a href="@procViewToggleURL;noi18n@">hide source</a> ]
</else>
<if @source_p@ ne @default_source_p@>
| [ <a href="set-default?source_p=@source_p@&amp;return_url=@return_url@">make this
the default</a> ]
| [ <a href="@setDefaultURL;noi18n@">make this the default</a> ]
</if>
</else>
......
......@@ -3,7 +3,7 @@ ad_page_contract {
@cvs-id $Id$
} {
proc:token,trim
proc:nohtml,trim
source_p:boolean,optional,trim
{version_id:naturalnum,optional ""}
} -properties {
......@@ -71,7 +71,7 @@ if { !$documented_call } {
a private interface.</p><p>The procedure is defined as:
<pre class='code'>
proc $proc {[info args $proc]} {
[ad_quotehtml [info body $proc]]
[ns_quotehtml [info body $proc]]
}
</pre></p>
}]
......@@ -127,6 +127,8 @@ proc $proc {[info args $proc]} {
set documentation [api_proc_documentation -script $proc_index]
}
}
set procViewToggleURL [export_vars -base proc-view [list proc [list source_p [expr {!$source_p}]] version_id]]
set setDefaultURL [export_vars -base set-default [list source_p return_url]]
#
# Local variables:
......
......@@ -5,7 +5,7 @@ ad_page_contract {
} {
version_id:naturalnum,optional
{ public_p:boolean "" }
path:token,trim
path:path,trim
source_p:boolean,optional,trim
} -properties {
title:onevalue
......@@ -36,9 +36,9 @@ if {![file readable $::acs::rootdir/$path] || [file isdirectory $::acs::rootdir/
if {[info exists version_id]} {
set kind procs
set href [export_vars -base [ad_conn package_url]/package-view {version_id {kind procs}}]
set link [subst {<p>Go back to <a href="[ns_quotehrml $href]">Package Documentation</a>.}]
set link [subst {<p>Go back to <a href="[ns_quotehtml $href]">Package Documentation</a>.}]
} else {
set link [subst {<p>Go back to <a href="[ns_quotehrml [ad_conn package_url]]">API Browser</a>.}]
set link [subst {<p>Go back to <a href="[ns_quotehtml [ad_conn package_url]]">API Browser</a>.}]
}
ad_return_warning "No such library file" [subst {
The file '$path' was not found. Maybe the url contains a typo.
......@@ -111,3 +111,9 @@ if { $source_p } {
set file_contents [template::util::read_file $::acs::rootdir/$path]
set file_contents [apidoc::tclcode_to_html $file_contents]
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -17,3 +17,9 @@ if { $found_p } {
} else {
ad_return_error "Unknown Property" "Couldn't find any property to set"
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -33,3 +33,9 @@ for { set i [expr { $len-1 }] } { $i >= 0 } { incr i -1 } {
set title "Tcl API Procedure Search for: \"$tcl_proc\""
set context [list "Tcl API Search: $tcl_proc"]
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -34,3 +34,9 @@ if {$url ne ""} {
set title "[ns_info name] Tcl API Search for: \"$tcl_proc\""
set context [list "Tcl API Search: $tcl_proc"]
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -42,3 +42,9 @@ lappend context $type
set title $type
set documentation [api_type_documentation $type]
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment