summaryrefslogtreecommitdiffstats
path: root/tools/tcltk-man2html-utils.tcl
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-11-08 10:14:35 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-11-08 10:14:35 (GMT)
commit4c193ca2a19fee2768b0148f7c0c57888257eb54 (patch)
tree5d1e523fbb71d185b6ee76876e4d0f37222fc074 /tools/tcltk-man2html-utils.tcl
parentb883137394973c0812d2f0ee147ddce2d878bb2e (diff)
downloadtcl-off_trunk.zip
tcl-off_trunk.tar.gz
tcl-off_trunk.tar.bz2
Added tooltip generation to contents and keywords pages.off_trunk
Diffstat (limited to 'tools/tcltk-man2html-utils.tcl')
-rw-r--r--tools/tcltk-man2html-utils.tcl21
1 files changed, 17 insertions, 4 deletions
diff --git a/tools/tcltk-man2html-utils.tcl b/tools/tcltk-man2html-utils.tcl
index 780cc6b..d02bcb6 100644
--- a/tools/tcltk-man2html-utils.tcl
+++ b/tools/tcltk-man2html-utils.tcl
@@ -636,6 +636,7 @@ proc output-name {line} {
lappend manual(wing-toc) $name
lappend manual(name-$name) $manual(wing-file)/$manual(name)
}
+ set manual(tooltip-$manual(wing-file)/$manual(name).htm) $line
}
##
@@ -1256,7 +1257,11 @@ proc make-manpage-section {outputDir sectionDescriptor} {
# whistle
puts stderr "scanning section $manual(wing-name)"
# put the entry for this section into the short table of contents
- puts $manual(short-toc-fp) "<DT><A HREF=\"$manual(wing-file)/[indexfile]\">$manual(wing-name)</A></DT><DD>$manual(wing-description)</DD>"
+ if {[regexp {^(.+), version (.+)$} $manual(wing-name) -> name version]} {
+ puts $manual(short-toc-fp) "<DT><A HREF=\"$manual(wing-file)/[indexfile]\" TITLE=\"version $version\">$name</A></DT><DD>$manual(wing-description)</DD>"
+ } else {
+ puts $manual(short-toc-fp) "<DT><A HREF=\"$manual(wing-file)/[indexfile]\">$manual(wing-name)</A></DT><DD>$manual(wing-description)</DD>"
+ }
# initialize the wing table of contents
puts $manual(wing-toc-fp) [htmlhead $manual(wing-name) \
$manual(wing-name) $overall_title "../[indexfile]"]
@@ -1331,7 +1336,7 @@ proc make-manpage-section {outputDir sectionDescriptor} {
}
switch -exact -- $code {
.if - .nr - .ti - .in - .ie - .el -
- .ad - .na - .so - .ne - .AS - .VE - .VS - . {
+ .ad - .na - .so - .ne - .AS - .HS - .VE - .VS - . {
# ignore
continue
}
@@ -1567,8 +1572,16 @@ proc make-manpage-section {outputDir sectionDescriptor} {
set tail [lindex $tail [expr {[llength $tail]-1}]]
}
set tail [file tail $tail]
- append rows([expr {$n%$nrows}]) \
- "<td> <a href=\"$tail.htm\">$name</a> </td>"
+ if {[info exists manual(tooltip-$manual(wing-file)/$tail.htm)]} {
+ set tooltip $manual(tooltip-$manual(wing-file)/$tail.htm)
+ set tooltip [string map {[ {\[} ] {\]} $ {\$} \\ \\\\} $tooltip]
+ regsub {^[^-]+-\s*(.)} $tooltip {[string totitle \1]} tooltip
+ append rows([expr {$n%$nrows}]) \
+ "<td> <a href=\"$tail.htm\" title=\"[subst $tooltip]\">$name</a> </td>"
+ } else {
+ append rows([expr {$n%$nrows}]) \
+ "<td> <a href=\"$tail.htm\">$name</a> </td>"
+ }
incr n
}
puts $manual(wing-toc-fp) <table>