From 7a7f3cd3492455ecfeb0c513c9e9c860e32b39f1 Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 24 Nov 2008 10:02:43 +0000 Subject: Converter script improvements. [Bug 2330040] --- ChangeLog | 41 +++++++++++++++++------------- tools/tcltk-man2html.tcl | 66 ++++++++++++++++++++++++++++-------------------- 2 files changed, 62 insertions(+), 45 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3e858e9..1b34877 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,17 +1,22 @@ +2008-11-24 Donal K. Fellows + + * tools/tcltk-man2html.tcl: Improvements to tackle tricky aspects of + cross references and new entities to map. [Bug 2330040] + 2008-11-19 Jan Nijtmans - * generic/tclThreadTest.c Convert Tcl_SetResult(......, TCL_DYNAMIC) to - Tcl_SetResult(......, TCL_VOLATILE), in preparation - for TIP #340 + * generic/tclThreadTest.c: Convert Tcl_SetResult(......, TCL_DYNAMIC) + to Tcl_SetResult(......, TCL_VOLATILE), in preparation for TIP #340 2008-11-17 Jan Nijtmans - * generic/tcl.decls: Fix signature and implementation of - * generic/tclDecls.h: Tcl_HashStats, such that it conforms - * generic/tclHash.c: to the documentation. - * generic/tclVar.c: [Bug 2308236] - * doc/Hash.3 - * generic/tclDictObj.c Convert Tcl_SetResult call to Tcl_SetObjResult. + * generic/tcl.decls: Fix signature and implementation of + * generic/tclDecls.h: Tcl_HashStats, such that it conforms to the + * generic/tclHash.c: documentation. [Bug 2308236] + * generic/tclVar.c: + * doc/Hash.3: + * generic/tclDictObj.c: Convert Tcl_SetResult call to + Tcl_SetObjResult. 2008-11-17 Alexandre Ferrieux @@ -28,13 +33,13 @@ 2008-11-16 Jan Nijtmans - * generic/tclTest.c: replace two times Tcl_SetResult with - Tcl_SetObjResult, a little simplification - in preparation for the TIP #340 patch. + * generic/tclTest.c: Replace two times Tcl_SetResult with + Tcl_SetObjResult, a little simplification in preparation for the TIP + #340 patch. 2008-11-13 Jan Nijtmans - * generic/tclInt.h: rename static function FSUnloadTempFile to + * generic/tclInt.h: Rename static function FSUnloadTempFile to * generic/tclIOUtil.c TclFSUnloadTempFile, needed in tclLoad.c * generic/tclLoad.c Fixed [Bug 2269431]: load of shared @@ -42,19 +47,19 @@ 2008-11-12 Pat Thoyts - * tests/registry.test: Use HKCU to avoid requiring admin access - for registry testing on vista/server2008 + * tests/registry.test: Use HKCU to avoid requiring admin access for + registry testing on Vista/Server2008 2008-11-11 Jan Nijtmans * generic/tclNamesp.c: Eliminate warning: passing arg 4 of `Tcl_SplitList' from incompatible pointer type - * win/tcl.m4: reverted change from 2008-11-06 (was under the + * win/tcl.m4: Reverted change from 2008-11-06 (was under the impression that "-Wno-implicit-int" added an extra warning) * win/configure (regenerated) - * unix/tcl.m4: Use -O2 as gcc optimization compiler flag, and get - rid of -Wno-implicit-int for UNIX + * unix/tcl.m4: Use -O2 as gcc optimization compiler flag, and + get rid of -Wno-implicit-int for UNIX. * unix/configure (regenerated) 2008-11-10 Andreas Kupries diff --git a/tools/tcltk-man2html.tcl b/tools/tcltk-man2html.tcl index e846a00..8ed5e08 100755 --- a/tools/tcltk-man2html.tcl +++ b/tools/tcltk-man2html.tcl @@ -344,21 +344,23 @@ proc htmlize-text {text {charmap {}}} { proc process-text {text} { global manual - # preprocess text + # preprocess text; note that this is an incomplete map, and will probably + # need to have things added to it as the manuals expand to use them. set charmap [list \ - {\&} "\t" \ - {\%} {} \ - "\\\n" "\n" \ - {\(+-} "±" \ - {\(co} "©" \ - {\(em} "—" \ - {\(fm} "′" \ - {\(mu} "×" \ - {\(->} "" \ - {\fP} {\fR} \ - {\.} . \ - {\(bu} "•" \ - ] + {\&} "\t" \ + {\%} {} \ + "\\\n" "\n" \ + {\(+-} "±" \ + {\(co} "©" \ + {\(em} "—" \ + {\(fm} "′" \ + {\(mu} "×" \ + {\(mi} "−" \ + {\(->} "" \ + {\fP} {\fR} \ + {\.} . \ + {\(bu} "•" \ + ] lappend charmap {\o'o^'} {ô} ; # o-circumflex in re_syntax.n lappend charmap {\-\|\-} -- ; # two hyphens lappend charmap {\-} - ; # a hyphen @@ -516,7 +518,8 @@ proc long-toc {text} { proc option-toc {name class switch} { global manual if {[string match "*OPTIONS" $manual(section)]} { - if {$manual(name) ne "ttk_widget"} { + if {$manual(name) ne "ttk_widget" && ($manual(name) ne "ttk_entry" || + ![string match validate* $name])} { # link the defined option into the long table of contents set link [long-toc "$switch, $name, $class"] regsub -- "$switch, $name, $class" $link "$switch" link @@ -1254,20 +1257,29 @@ proc output-directive {line} { return } .SO { - set targetPage $rest - if {[match-text @stuff .SE]} { - output-directive {.SH STANDARD OPTIONS} - set opts [split $stuff \n\t] - man-puts
- lappend manual(section-toc)
- foreach option [lsort -dictionary $opts] { - man-puts "
[std-option-toc $option $targetPage]" + # When there's a sequence of multiple .SO chunks, process into one + set optslist {} + while 1 { + if {[match-text @stuff .SE]} { + foreach opt [split $stuff \n\t] { + lappend optslist [list $opt $rest] + } + } else { + manerror "unexpected .SO format:\n[expand-next-text 2]" } - man-puts
- lappend manual(section-toc)
- } else { - manerror "unexpected .SO format:\n[expand-next-text 2]" + if {![next-op-is .SO rest]} { + break + } + } + output-directive {.SH STANDARD OPTIONS} + man-puts
+ lappend manual(section-toc)
+ foreach optionpair [lsort -dictionary -index 0 $optslist] { + lassign $optionpair option targetPage + man-puts "
[std-option-toc $option $targetPage]" } + man-puts
+ lappend manual(section-toc)
} .OP { output-widget-options $rest -- cgit v0.12