From 36a7dc586ff228596fec6afc4130c203b2b3c6d0 Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 14 Jan 2010 11:45:09 +0000 Subject: Add link remapping capability. --- tools/tcltk-man2html-utils.tcl | 16 ++++++++++------ tools/tcltk-man2html.tcl | 8 +++++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/tools/tcltk-man2html-utils.tcl b/tools/tcltk-man2html-utils.tcl index 9ed16d3..0291a4f 100644 --- a/tools/tcltk-man2html-utils.tcl +++ b/tools/tcltk-man2html-utils.tcl @@ -6,7 +6,7 @@ ## Copyright (c) 1995-1997 Roger E. Critchlow Jr ## Copyright (c) 2004-2010 Donal K. Fellows ## -## CVS: $Id: tcltk-man2html-utils.tcl,v 1.4 2010/01/13 17:09:53 dkf Exp $ +## CVS: $Id: tcltk-man2html-utils.tcl,v 1.5 2010/01/14 11:45:09 dkf Exp $ set ::manual(report-level) 1 @@ -611,7 +611,7 @@ proc output-name {line} { ## build a cross-reference link if appropriate ## proc cross-reference {ref} { - global manual + global manual remap_link_target global ensemble_commands exclude_refs_map exclude_when_followed_by_map set lref [string tolower $ref] if {[string match "Tcl_*" $ref] || [string match "Tk_*" $ref]} { @@ -625,6 +625,12 @@ proc cross-reference {ref} { return "$ref" } ## + ## apply a link remapping if available + ## + if {[info exists remap_link_target($lref)]} { + set lref $remap_link_target($lref) + } + ## ## nothing to reference ## if {![info exists manual(name-$lref)]} { @@ -635,10 +641,8 @@ proc cross-reference {ref} { return "$ref" } } - if {$lref in {stdin stdout stderr end}} { - # no good place to send these - # tcl tokens? - # also end + if {$lref in {end}} { + # no good place to send this tcl token? } return $ref } diff --git a/tools/tcltk-man2html.tcl b/tools/tcltk-man2html.tcl index 9fc1228..87a0e89 100755 --- a/tools/tcltk-man2html.tcl +++ b/tools/tcltk-man2html.tcl @@ -18,7 +18,7 @@ package require Tcl 8.6 # Copyright (c) 1995-1997 Roger E. Critchlow Jr # Copyright (c) 2004-2010 Donal K. Fellows # -# CVS: $Id: tcltk-man2html.tcl,v 1.40 2010/01/13 17:09:53 dkf Exp $ +# CVS: $Id: tcltk-man2html.tcl,v 1.41 2010/01/14 11:45:11 dkf Exp $ set Version "0.40" @@ -797,6 +797,11 @@ set ensemble_commands { clipboard console grab grid image option pack place selection tk tkwait winfo wm } +array set remap_link_target { + stdin Tcl_GetStdChannel + stdout Tcl_GetStdChannel + stderr Tcl_GetStdChannel +} array set exclude_refs_map { history.n {exec} canvas.n {bitmap text} @@ -807,6 +812,7 @@ array set exclude_refs_map { radiobutton.n {image} scrollbar.n {set} selection.n {string} + tcltest.n {error} tkvars.n {tk} } array set exclude_when_followed_by_map { -- cgit v0.12