Index: library/lib/doc-assets/ac-js =================================================================== diff -u -rbb58b68431fe35dd6ff16e69044705e1246d0dda -r5d5f67b7b4a9806e10419e44efdcfe724bfcff9b --- library/lib/doc-assets/ac-js (.../ac-js) (revision bb58b68431fe35dd6ff16e69044705e1246d0dda) +++ library/lib/doc-assets/ac-js (.../ac-js) (revision 5d5f67b7b4a9806e10419e44efdcfe724bfcff9b) @@ -132,7 +132,7 @@ oAutoComp.maxResultsDisplayed = 200; oAutoComp.minQueryLength = 0; oAutoComp.formatResult = function(oResultItem, query) { - var sMarkup = "" + oResultItem[1].host + ' ' + oResultItem[1].name + ''; + var sMarkup = "" + oResultItem[1].host + ' ' + oResultItem[1].name + ' (' + oResultItem[1].type.toLowerCase() +')'; return sMarkup; }; Index: library/lib/doc-assets/class.html.tmpl =================================================================== diff -u -r18ff1444fef5c209dfb40cf2ae694206c0d10309 -r5d5f67b7b4a9806e10419e44efdcfe724bfcff9b --- library/lib/doc-assets/class.html.tmpl (.../class.html.tmpl) (revision 18ff1444fef5c209dfb40cf2ae694206c0d10309) +++ library/lib/doc-assets/class.html.tmpl (.../class.html.tmpl) (revision 5d5f67b7b4a9806e10419e44efdcfe724bfcff9b) @@ -81,40 +81,38 @@ [:!let iattrs [:inherited @class-attribute]] [:? {$iattrs ne ""} {
- [:for superclass [dict keys $iattrs] { - [:!let attrs [dict get $iattrs $superclass]] -
-

Per-class parameters inherited - from [$superclass name]:

-
- - [:for a $attrs { - - [$a name] - - }] - -
-
- }] -
+ [:for superclass [dict keys $iattrs] { + [:!let attrs [dict get $iattrs $superclass]] +
+

Per-class parameters inherited + from [$superclass name]:

+
+ + [:for a $attrs { + + [$a name] + + }] + +
+
+ }] + + }] -}] - - [:?var :@object-attribute {

Per-object parameters

- + [:for attr ${:@object-attribute} { -
+

[$attr name]

@@ -177,29 +175,28 @@ [:!let imethods [:inherited @class-method]] [:? {$imethods ne ""} {
- [:for superclass [dict keys $imethods] { - [:!let ms [dict get $imethods $superclass]] -
-

Per-class methods inherited - from [$superclass name]:

-
- - [:for m $ms { - - [$m name] - - }] - -
-
- }] -
- + [:for superclass [dict keys $imethods] { + [:!let ms [dict get $imethods $superclass]] +
+

Per-class methods inherited + from [$superclass name]:

+
+ + [:for m $ms { + + [$m name] + + }] + +
+
+ }] +
}] [:?var :@method { Index: library/lib/doc-assets/entity.html.tmpl =================================================================== diff -u -r18ff1444fef5c209dfb40cf2ae694206c0d10309 -r5d5f67b7b4a9806e10419e44efdcfe724bfcff9b --- library/lib/doc-assets/entity.html.tmpl (.../entity.html.tmpl) (revision 18ff1444fef5c209dfb40cf2ae694206c0d10309) +++ library/lib/doc-assets/entity.html.tmpl (.../entity.html.tmpl) (revision 5d5f67b7b4a9806e10419e44efdcfe724bfcff9b) @@ -69,7 +69,7 @@
Index: library/lib/doc-tools.tcl =================================================================== diff -u -r26ce746b45449fbff64f88c6d9e9050a63b89449 -r5d5f67b7b4a9806e10419e44efdcfe724bfcff9b --- library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision 26ce746b45449fbff64f88c6d9e9050a63b89449) +++ library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision 5d5f67b7b4a9806e10419e44efdcfe724bfcff9b) @@ -1422,17 +1422,7 @@ # 2) proceed by rendering the project's parts (package, class, # object, and command entities) set ext [lindex [split [file tail $tmpl] .] end-1] - set top_level_entities [:owned_parts] - dict for {feature instances} $top_level_entities { - if {[$feature name] eq "@package"} { - foreach pkg $instances { - dict for {pkg_feature pkg_feature_instances} [$pkg owned_parts] { - dict lappend top_level_entities $pkg_feature {*}$pkg_feature_instances - } - } - } - } - + set top_level_entities [:navigatable_parts] set init [subst { set project \[:current_project\] set project_entities \[list $top_level_entities\] @@ -1505,28 +1495,39 @@ return "[string range $str 0 [expr {$margin-1}]]$placeholder[string range $str end-[expr {$margin+1}] end]" } - :method list_structural_features {} { - set entry {{"access": "$access", "host": "$host", "name": "$name", "url": "$url", "type": "$type"}} - set entries [list] - # - # TODO: Should I wrap up delegating calls to the originator - # entity behind a unified interface (a gatekeeper?) - # - set features [[:origin] owned_parts] + :public method as_dict {partof feature} { + set hash [dict create] + dict set hash access "" + dict set hash host [$partof name] + dict set hash name [:print_name] +# dict set hash url "[$partof filename].html#[string trimleft [$feature name] @]_${:name}" + dict set hash url "[:href $partof]" + dict set hash type [$feature pretty_name] + return $hash + } + + :method as_array_of_hashes {} { + set features [:navigatable_parts] + set js_array [list] dict for {feature instances} $features { foreach inst $instances { - # TODO: @modifier support is specific to the parts of - # @object instances. Untangle! - set access [expr {[$inst eval {info exists :@modifier}]?[$inst @modifier]:""}] - set host ${:name} - set name [$inst print_name] - set url "[:filename].html#[string trimleft [$feature name] @]_[$inst name]" - set type [$feature name] - lappend entries [subst $entry] + set d [$inst as_dict [current] $feature] + set js_hash {{"access": "$access", "host": "$host", "name": "$name", "url": "$url", "type": "$type"}} + dict with d { + lappend js_array [subst $js_hash] + } } } - return "\[[join $entries ,\n]\]" + return "\[[join $js_array ,\n]\]" } + + :method navigatable_parts {} { + # + # TODO: Should I wrap up delegating calls to the originator + # entity behind a unified interface (a gatekeeper?) + # + return [[:origin] owned_parts] + } :method listing {{-inline true} script} { return [expr {$inline?"$script":"
$script
"}] @@ -1613,8 +1614,27 @@ :public method filename {} { return "index" } + :method navigatable_parts {} { + # + # TODO: Should I wrap up delegating calls to the originator + # entity behind a unified interface (a gatekeeper?) + # + set top_level_entities [next] + dict for {feature instances} $top_level_entities { + if {[$feature name] eq "@package"} { + foreach pkg $instances { + dict for {pkg_feature pkg_feature_instances} [$pkg owned_parts] { + dict lappend top_level_entities $pkg_feature \ + {*}$pkg_feature_instances + } + } + } + } + return $top_level_entities + } + } - + MixinLayer::Mixin create [current]::@glossary -superclass [current]::Entity { :public method print_name {} { @@ -1646,7 +1666,7 @@ } } - + :public method href {-local:switch top_entity:optional} { set fragments "#${:name}" if {$local} { @@ -1692,7 +1712,16 @@ return $res } - } + }; # NxDocRenderer::@glossary + + MixinLayer::Mixin create [current]::@method -superclass [current]::Entity { + :public method as_dict {partof feature} { + set hash [next] + dict set hash access ${:@modifier} + return $hash + } + }; # NxDocRenderer::@method + }; # NxDocTemplating # Index: library/nx/nx.nxd =================================================================== diff -u -r26ce746b45449fbff64f88c6d9e9050a63b89449 -r5d5f67b7b4a9806e10419e44efdcfe724bfcff9b --- library/nx/nx.nxd (.../nx.nxd) (revision 26ce746b45449fbff64f88c6d9e9050a63b89449) +++ library/nx/nx.nxd (.../nx.nxd) (revision 5d5f67b7b4a9806e10419e44efdcfe724bfcff9b) @@ -1,15 +1,15 @@ # -*- Tcl -*- -# @package ::nx +# @package nx # # The <<@glossary nx>> is a compact and expressive object-oriented -# language extension for <<@Gls tcl>>. The object system model is highly -# influenced by <<@glossary clos>> and its off-springs (e.g., -# <<@glossary flavors>>). This package provides the basic object system for -# <<@glossary nx>>. It defines the basic language entities <<@class -# ::nx::Object>> and <<@class ::nx::Class>>, as well as essential -# language primitives (in particular, <<@command ::nx::next>> and <<@command -# ::nx::current>>). +# language extension for <<@Gls tcl>>. The object system model is +# highly influenced by <<@glossary clos>> and its off-springs (e.g., +# <<@glossary flavors>>). This package provides the basic object +# system for <<@glossary nx>>. It defines the basic language entities +# <<@class ::nx::Object>> and <<@class ::nx::Class>>, as well as +# essential language primitives (in particular, <<@command +# ::nx::next>> and <<@command ::nx::current>>). # # @require Tcl # @version 1.0.0a @@ -518,7 +518,9 @@ # @superclass ::nx::doc::entities::class::nx::Object # @class ObjectParameterSlot -# +# +# ... +# # @superclass ::nx::doc::entities::class::nx::Slot # @class.attribute {Slot name} Index: tests/doc.tcl =================================================================== diff -u -r18ff1444fef5c209dfb40cf2ae694206c0d10309 -r5d5f67b7b4a9806e10419e44efdcfe724bfcff9b --- tests/doc.tcl (.../doc.tcl) (revision 18ff1444fef5c209dfb40cf2ae694206c0d10309) +++ tests/doc.tcl (.../doc.tcl) (revision 5d5f67b7b4a9806e10419e44efdcfe724bfcff9b) @@ -975,7 +975,7 @@ # 1) NSF documentation project set project [::nx::doc::@project new \ - -name ::NextScriptingFramework \ + -name NextScriptingFramework \ -url http://www.next-scripting.org/ \ -version 1.0.0a \ -@namespace "::nsf"] @@ -991,7 +991,7 @@ puts stderr TIMING=[time { set project [::nx::doc::@project new \ - -name ::NextScriptingLanguage \ + -name NextScriptingLanguage \ -url http://www.next-scripting.org/ \ -version 1.0.0a \ -@namespace "::nx"]