api_library_documentation (public)

 api_library_documentation [ -format format ] path

Defined in packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl

Generates formatted documentation for a Tcl library file (just the header, describing what the library does).

Switches:
-format (optional, defaults to "text/html")
Parameters:
path (required)
the path to the file, relative to the OpenACS path root.

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_api_browser_trivial_smoke_test acs_api_browser_trivial_smoke_test (test acs-api-browser) api_library_documentation api_library_documentation test_acs_api_browser_trivial_smoke_test->api_library_documentation apidoc::format_author apidoc::format_author (public) api_library_documentation->apidoc::format_author packages/acs-api-browser/www/procs-file-view.tcl packages/acs-api-browser/ www/procs-file-view.tcl packages/acs-api-browser/www/procs-file-view.tcl->api_library_documentation

Testcases:
acs_api_browser_trivial_smoke_test
Source code:
    if { $format ne "text/html" } {
        return -code error "Only text/html documentation is currently supported"
    }

    set out "<h3>[ns_quotehtml [file tail $path]]</h3>"

    if { [nsv_exists api_library_doc $path] } {
        array set doc_elements [nsv_get api_library_doc $path]
        append out "<blockquote><p>\n"
        append out [lindex $doc_elements(main) 0]

        append out "<dl>\n"
        append out "<dt>Location:</dt>\n<dd>[ns_quotehtml $path]\n"
        if { [info exists doc_elements(creation-date)] } {
            append out "<dt>Created:</dt>\n<dd>[lindex $doc_elements(creation-date) 0]\n"
        }
        if { [info exists doc_elements(author)] } {
            append out "<dt>Author[expr {[llength $doc_elements(author)] > 1 ? "s" : ""}]:</dt>\n"
            foreach author $doc_elements(author) {
                append out "<dd>[::apidoc::format_author $author]\n"
            }
        }
        if { [info exists doc_elements(cvs-id)] } {
            append out [subst {
                <dt>CVS Identification:</dt>
                <dd><code>[ns_quotehtml [lindex $doc_elements(cvs-id) 0]]</code>
            }]
        }
        append out "</dl>\n"
        append out "</blockquote>\n"
    }

    return $out
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: