+ [:for attr [dict values $class_attrs] {
+ [:!let depr [expr {[$attr !get @deprecated]?"deprecated":""}]]
+
+ [$attr name]
+
+ }]
+
+ Index: Makefile.in =================================================================== diff -u -rd72a757e0aa13c9e34e5e8d284a6a3a833b9f6e6 -rfa7635cbfe2309b8e6282e2c7925fa2617b061aa --- Makefile.in (.../Makefile.in) (revision d72a757e0aa13c9e34e5e8d284a6a3a833b9f6e6) +++ Makefile.in (.../Makefile.in) (revision fa7635cbfe2309b8e6282e2c7925fa2617b061aa) @@ -194,7 +194,7 @@ TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \ @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ PATH="$(EXTRA_PATH):$(PATH)" \ - TCLLIBPATH="$(top_builddir) ${srcdir}" + TCLLIBPATH="$(top_builddir) ${srcdir} $(TCLLIBPATH)" TCLSH_PROG = @TCLSH_PROG@ TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) #TCLSH = $(TCLSH_ENV) valgrind --dsymutil=yes $(TCLSH_PROG) @@ -276,6 +276,45 @@ # use language reference as sample file to trigger generation of documentation files doc: $(xotcl_target_doc_dir)/langRef-xotcl.html +YUIDOC_OUTPUT = \ + $(target_doc_dir)/$(PACKAGE_NAME)/index.html \ + $(target_doc_dir)/nx/index.html \ + $(xotcl_target_doc_dir)/XOTcl-langRef/index.html + +yuidoc: pkgIndex.tcl $(YUIDOC_OUTPUT) + +$(target_doc_dir)/$(PACKAGE_NAME)/index.html: + $(TCLSH) $(src_app_dir_native)/utils/nxdoc -doctitle $(PACKAGE_NAME) \ + -docurl "http://next-scripting.org/" -docversion $(PACKAGE_VERSION) \ + -outdir $(target_doc_dir) "package:$(PACKAGE_NAME)" + +$(target_doc_dir)/nx/index.html: + $(TCLSH) $(src_app_dir_native)/utils/nxdoc -doctitle nx \ + -docurl "http://next-scripting.org/" -docversion $(PACKAGE_VERSION) \ + -outdir $(target_doc_dir) "package:nx" + +$(xotcl_target_doc_dir)/XOTcl-langRef/index.html: + $(TCLSH) $(src_app_dir_native)/utils/nxdoc -doctitle XOTcl-langRef \ + -docurl "http://next-scripting.org/" -docversion $(PACKAGE_VERSION) \ + -outdir $(xotcl_target_doc_dir) "@package:XOTcl-langRef" + +XOWIKI_OUTPUT = \ + $(target_doc_dir)/$(PACKAGE_NAME).xowiki \ + $(target_doc_dir)/nx.xowiki \ + $(xotcl_target_doc_dir)/XOTcl-langRef.xowiki + +xowiki: pkgIndex.tcl $(XOWIKI_OUTPUT) + +$(xotcl_target_doc_dir)/XOTcl-langRef.xowiki : + $(TCLSH) $(src_app_dir_native)/utils/nxdoc -doctitle $(basename $(notdir $@)) \ + -docurl "http://next-scripting.org/" -docversion $(PACKAGE_VERSION) \ + -outdir $(@D) -format xowiki -layout many-to-1 "@package:$(basename $(notdir $@))" + +%.xowiki : + $(TCLSH) $(src_app_dir_native)/utils/nxdoc -doctitle $(*F) \ + -docurl "http://next-scripting.org/" -docversion $(PACKAGE_VERSION) \ + -outdir $(@D) -format xowiki -layout many-to-1 "package:$(*F)" + example-doc: $(EXAMPLE_SCRIPTS) $(xotcl_target_doc_dir)/langRef-xotcl.html: pkgIndex.tcl $(xotcl_src_doc_dir)/langRef.xotcl $(XODOC_SOURCE) @@ -616,9 +655,12 @@ # variable in configure.in #======================================================================== -clean: - -rm -rf $(BINARIES) $(CLEANFILES) $(installed_shells) pkgIndex.tcl ./receiver \ - $(xotcl_target_doc_dir)/*-xotcl.html +cleandoc: + -rm -rf $(xotcl_target_doc_dir)/*-xotcl.html $(dir $(YUIDOC_OUTPUT)) $(XOWIKI_OUTPUT) + +clean: cleandoc + -rm -rf $(BINARIES) $(CLEANFILES) $(installed_shells) pkgIndex.tcl ./receiver + find ${srcdir} -type f -name \*~ -exec rm \{} \; @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ for dir in $$dirs ; do \ Index: apps/utils/nxdoc =================================================================== diff -u --- apps/utils/nxdoc (revision 0) +++ apps/utils/nxdoc (revision fa7635cbfe2309b8e6282e2c7925fa2617b061aa) @@ -0,0 +1,84 @@ +#!/usr/local/src/tcl8.6-fossil/unix/tclsh +#!/bin/env tclsh + +package req nx::doc 1.0 + +namespace eval ::nx::doc { + namespace import -force ::nx::* + Class create CLI { + + # + # rendering + # + :property {outdir "."} + :property {format "html"} + :property {theme "yuidoc"} + :property {layout "many-to-many"} + + # + # doc project + # + :property doctitle + :property {docversion 0.1} + :property docurl + :property docbaseurl + :property {validation:switch false} + + # + # input + # + :property sourcepath + :property {includes ""} + :property {excludes ""} + :protected property sources:1..* { + set :config false + } + + # + # auxiliary + # + + :protected method ... args { + :sources [concat {*}[split $args :]] + } + + :protected class method objectparameter {} { + foreach slot [:info slot objects -type ::nx::VariableSlot] { + lappend defs([$slot position]) [$slot getParameterSpec] + } + set parameterdefinitions [list] + foreach p [lsort [array names defs]] { + lappend parameterdefinitions {*}$defs($p) + } + return [concat $parameterdefinitions ...:alias,args] + } + + :protected method init {} { + set prj [@project new \ + -name ${:doctitle} \ + -url ${:docurl} \ + -version ${:docversion} \ + -sources ${:sources}] + + processor process \ + -sandboxed \ + {*}[expr {${:validation}?"-validate":""}] \ + -include ${:includes} $prj + + make doc \ + -format ${:format} \ + $prj \ + -theme ${:theme} \ + -layout ${:layout} \ + -outdir ${:outdir} + } + } + namespace export CLI +} + +namespace import -force ::nx::doc::CLI +# +# nxdoc -outdir /tmp/ -format html -theme yuidoc package:nsf +# +CLI new {*}$argv + Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/@class.html.asciidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/@class.html.yuidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/@command.html.asciidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/@command.html.yuidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/@method.html.asciidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/@method.html.yuidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/@object.html.asciidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/@object.html.yuidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/@package.html.asciidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/@package.html.yuidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/@project.html.asciidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/@project.html.yuidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/asciidoc/xhtml11.css'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/attributemethod.html.asciidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/attributemethod.html.yuidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/body-chunked.html.yuidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/body.html.yuidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/filter.html.yuidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/glossary.html.yuidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/hookmethod.html.yuidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/leftbar.html.yuidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/link.html.asciidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/link.html.yuidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/listing.html.asciidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/listing.html.yuidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/overview.html.yuidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/status.svg'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/submethod.html.asciidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/submethod.html.yuidoc'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/yuidoc/ac.js'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/yuidoc/api-next.css'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/yuidoc/api.css'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/yuidoc/api.js'. Fisheye: No comparison available. Pass `N' to diff? Index: library/lib/doc-assets/yuidoc/bg_hd.gif =================================================================== diff -u -r77c371a2e4a1bd85367d11869de6e2dc9fac4771 -rfa7635cbfe2309b8e6282e2c7925fa2617b061aa Binary files differ Index: library/lib/doc-assets/yuidoc/nx.png =================================================================== diff -u -r77c371a2e4a1bd85367d11869de6e2dc9fac4771 -rfa7635cbfe2309b8e6282e2c7925fa2617b061aa Binary files differ Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-assets/yuidoc/reset-fonts-grids-min.css'. Fisheye: No comparison available. Pass `N' to diff? Index: library/lib/doc-assets/yuidoc/status.png =================================================================== diff -u -r77c371a2e4a1bd85367d11869de6e2dc9fac4771 -rfa7635cbfe2309b8e6282e2c7925fa2617b061aa Binary files differ Fisheye: Tag fa7635cbfe2309b8e6282e2c7925fa2617b061aa refers to a dead (removed) revision in file `library/lib/doc-tools.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: library/lib/nxdoc-assets/@class.html.asciidoc =================================================================== diff -u --- library/lib/nxdoc-assets/@class.html.asciidoc (revision 0) +++ library/lib/nxdoc-assets/@class.html.asciidoc (revision fa7635cbfe2309b8e6282e2c7925fa2617b061aa) @@ -0,0 +1,106 @@ +
+ + [:for attr [dict values $class_attrs] { + [$attr name] + }] + +
+ }] + [:!let iattrs [:inherited @class-attribute]] + [:? {$iattrs ne ""} { + [:for superclass [dict keys $iattrs] { + [:!let attrs [dict values [dict get $iattrs $superclass]]] ++ + [:for a $attrs { + [$a name] + }] + +
+ }] + }] + + [:? {[info exists class_attrs]} { +[$attr as_text]
+ + [:for m $class_methods { + [$m name] + }] + +
+ }] + [:!let imethods [:inherited @class-method]] + [:? {$imethods ne ""} { + [:for superclass [dict keys $imethods] { + [:!let ms [dict values [dict get $imethods $superclass]]] ++ + [:for m $ms { + [$m name] + }] + +
+ }] + }] + + [:? {[info exists class_methods]} { + [:for m $class_methods { + [:? {[info exists class_attrs] && [dict exists $class_attrs [$m name]]} { + [$m render -initscript [list set owning_attribute [dict get $class_attrs [$m name]]] attributemethod] + } - { + [$m render] + }] + }] + }] ++ + [:for om $omethods { + [$om name] + }] + +
+ [:for om $omethods { + [$om render] + }] +
+ ${:name}
+ create
+ obj
+ [:pinfo get -default "" bundle parametersyntax]
+
+
+ [:for attr [dict values $class_attrs] {
+ [:!let depr [expr {[$attr !get @deprecated]?"deprecated":""}]]
+
+ [$attr name]
+
+ }]
+
+
+ [:for a $attrs {
+ [:!let depr [expr {[$a !get @deprecated]?"deprecated":""}]]
+
+ [$a name]
+
+ }]
+
+
+ [:for m $class_methods {
+ [:!let modifier [expr {[$m pinfo get -default 0 bundle call-protected]?"protected":""}]]
+ [:!let depr [expr {[$m !get @deprecated]?"deprecated":""}]]
+
+ [$m name]
+
+ }]
+
+
+ [:for m $ms {
+ [:!let depr [expr {[$m !get @deprecated]?"deprecated":""}]]
+
+ [$m name]
+
+ }]
+
+
+ [:for m $omethods {
+ [:!let depr [expr {[$m !get @deprecated]?"deprecated":""}]]
+
+ [$m name]
+
+ }]
+
+
+ [:for m $hooks {
+ [:!let modifier [expr {[$m pinfo get -default 0 bundle call-protected]?"protected":""}]]
+ [:!let depr [expr {[$m !get @deprecated]?"deprecated":""}]]
+
+ [$m name]
+
+ }]
+
+ [$sub as_text]
+[$param as_text]
[$param as_text]
[:? {[info exists :@return] && [${:@return} @spec] ne ""} {<[${:@return} @spec]>} ]
+ ${:name}
+ [:pinfo get -default "" bundle parametersyntax]
+
+ [:?var :@command {
+
+ [:for sub [:!get -sortedby name @command] {
+
+ [$sub name]
+
+ }]
+
+ [:? {[$sub eval {info exists :@return}] && [[$sub @return] @spec] ne ""} {<[[$sub @return] @spec]>} ]
+ ${:name} [$sub name]
+ [$sub pinfo get -default "" bundle parametersyntax]
+
+ [$param name]
+ [:? {[$param eval {info exists :@spec}] && [$param @spec] ne ""} {<[$param @spec]>}]
+
+ [$param as_text]
+ [join [$param pinfo get -default "" validation]
+
[$param name]
+ [:? {[$param eval {info exists :@spec}] && [$param @spec] ne ""} {<[$param @spec]>}]
+
+ [$param statusmark]
+ [$param as_text]
+ [join [$param pinfo get -default "" validation]
+
$prefix [:name] [:pinfo get -default "" bundle parametersyntax] +
+ [:?var :@method { + [:for sm [:get_sub_methods] { + [$sm render -initscript [list set supermethod [current]] submethod] + }] + } - { + [:?var :@parameter { +
+ $prefix
+ ${:name}
+ [:pinfo get -default "" bundle parametersyntax]
+
+ [$param print_name]
+ [:? {[$param eval {info exists :@spec}] && [$param @spec] ne
+ ""} {: [$param @spec]}]
+
+ [$param statusmark]
+ [$param as_text]
+ [join [$param pinfo get -default "" validation]]
+ [:? {[$param eval {info exists :default}]} {
+ [:? {[$ret eval {info exists :@spec}] && [$ret @spec] ne ""} {[$ret @spec]}]
+
+ + [:for om $omethods { + [$om name] + }] + +
+ [:for om $omethods { + [$om render] + }] +
+ [:for attr [dict values $obj_attrs] {
+ [:!let depr [expr {[$attr !get @deprecated]?"deprecated":""}]]
+
+ [$attr name]
+
+ }]
+
+
+ [:for m $omethods {
+ [:!let depr [expr {[$m !get @deprecated]?"deprecated":""}]]
+
+ [$m name]
+
+ }]
+
+ + [:as_text] +
+ +[:?var :@require { +${:@require}
+}] + +[:?var :@class { +$ddesc
+ [:?objvar $entry refs { + [:? {[$entry eval [concat dict exists \${:refs} [current]]]} { ++ [:!let refs [sort_by_value [$entry eval [concat dict get \${:refs} [current]]]]] + [:for src [dict keys $refs] { + + [$src make_link [current]] + ([dict get $refs $src]) + + }] +
+ }] + }] +$prefix ${:name} + ?value?
+ [$owning_attribute as_text] +If provided, list of values to be set for the attribute ${:name}
$prefix ${:name} add value
+...
$prefix ${:name} delete value
+...
+ $prefix ${:name} ?value?
+
+
+ value : $spec
+
+ If provided, the
+ attribute ${:name} is set to value. If omitted, the current attribute
+ value is returned.
+ [:? {[$owning_attribute @spec] ne ""} {[$owning_attribute @spec]}]
+
+ $prefix
+ ${:name} add
+ value
+
+ value
+ [:?objvar $owning_attribute @spec {
+ [:? {[$owning_attribute @spec] ne ""} { : [$owning_attribute @spec]}]
+ }]
+
+
+
+
+ obj
+ ${:name} delete
+ value
+
+ value
+ [:?objvar $owning_attribute @spec {
+ [:? {[$owning_attribute @spec] ne ""} { : [$owning_attribute @spec]}]
+ }]
+
+
+ Choose a package, class, object or command name from the list for more information.
+Choose a package, object or command name from the list for more information.
+
+ [:for src [dict keys $refs] {
+
+ [$src make_link [current]]
+ ([dict get $refs $src])
+
+ }]
+
+ [:? {[info exists :@return] && [${:@return} @spec] ne ""} {<[${:@return} @spec]>} ]
+ obj
+ ${:name}
+ $paramspec
+
+ [$param print_name]
+ [:? {[$param eval {info exists :@spec}] && [$param @spec] ne ""} {<[$param @spec]>}]
+
+ [:? {[:statustoken] ne "extra"} {
+ [$param statusmark]
+ }]
+ [$param as_text]
+ [join [$param pinfo get -default "" validation]]
+ [:? {[$param eval {info exists :default}]} {
+ [:? {[$ret eval {info exists :@spec}] && [$ret @spec] ne ""} {[$ret @spec]}]
+
$script
} - {$script
} - {$script}]
Index: library/lib/nxdoc-assets/overview.html.yuidoc
===================================================================
diff -u
--- library/lib/nxdoc-assets/overview.html.yuidoc (revision 0)
+++ library/lib/nxdoc-assets/overview.html.yuidoc (revision fa7635cbfe2309b8e6282e2c7925fa2617b061aa)
@@ -0,0 +1,17 @@
+[:? {![info exists parts]} {
+[:!let parts [:navigatable_parts]]
+}]
+[:for feature [dict keys $parts] {
+[:!let f [dict get $parts $feature]]
+Contained [string tolower [$feature pretty_plural]]: [llength $f]
+$prefix $name [:pinfo get -default "" bundle parametersyntax] +
+ [:?var :@parameter { +[$param as_text]
[:? {[info exists :@return] && [${:@return} @spec] ne ""} { : [${:@return} @spec]} ]
+ $prefix
+ $name
+ [:pinfo get -default "" bundle parametersyntax]
+
+ [$param name]
+ [:? {[$param eval {info exists :@spec}] && [$param @spec] ne ""} { : [$param @spec]}]
+
+ [$param statusmark]
+ [$param as_text]
+ [$param pinfo get -default "" validation]
+
+
$cmd
"
+ }
+
+ :method link {tag value} {
+ set unresolvable "?"
+ if {[string first @ $tag] != 0} {
+ set m [current method]=$tag
+ if {[:info lookup methods \
+ -source application \
+ -callprotection public $m] eq ""} {
+ return $unresolvable
+ }
+ return [:$m $value]
+ } else {
+ set names $value
+ set tagpath [split [string trimleft $tag @] .]
+ lassign [::nx::doc::Tag normalise $tagpath $names] err res
+ if {$err} {
+ # puts stderr RES=$res
+ return $unresolvable;
+ }
+ lassign [::nx::doc::Tag find -all -strict {*}$res] err path
+ if {$err || $path eq ""} {
+ # puts stderr "FAILED res $path (err-$err-id-[expr {$path eq ""}])"
+ return $unresolvable;
+ }
+
+ set path [dict create {*}$path]
+ set entities [dict keys $path]
+ set id [lindex $entities end]
+ return [$id render_link $tag [:rendered top] $path]
+ }
+ }
+
+ :public method make_link {source} {
+ set path [dict create {*}[:get_upward_path -attribute {set :name}]]
+ set tag [[:info class] tag]
+ return [:render_link $tag $source $path]
+ }
+
+ :public method render_link {tag source path} {
+ set id [current]
+ set pathnames [dict values $path]
+ set entities [dict keys $path]
+ set top_entity [lindex $entities 0]
+ set pof ""
+ if {$top_entity ne $id} {
+ set pof "[$top_entity name]#"
+ set pathnames [lrange $pathnames 1 end]
+ set entities [lrange $entities 1 end]
+ }
+ #return "$pof[join $pathnames .]"
+ # GN TODO: Maybe a nicer "title" property via method title?
+ #return "[join $pathnames { }]"
+ set iscript [join [list [list set title $pof[join $pathnames .]] \
+ [list set source_anchor [join $pathnames { }]] \
+ [list set top_entity $top_entity]] \n]
+ :render -initscript $iscript link
+ }
+
+ :public method as_text {} {
+ set text [expr {[:origin] ne [current]?[[:origin] as_text]:[next]}]
+ return [string map {"\n\n" "