diff options
author | dkf <dkf@noemail.net> | 2008-11-24 10:02:42 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2008-11-24 10:02:42 (GMT) |
commit | 4a61c05f625cf66a32ac06d32dbd3087918f60d9 (patch) | |
tree | d127a23fc5b784a3934ed14934f9b8b5d58f0a11 /tools | |
parent | 4e423b270c1b1c0ac8360c7b25b770fa0056287c (diff) | |
download | tcl-4a61c05f625cf66a32ac06d32dbd3087918f60d9.zip tcl-4a61c05f625cf66a32ac06d32dbd3087918f60d9.tar.gz tcl-4a61c05f625cf66a32ac06d32dbd3087918f60d9.tar.bz2 |
Converter script improvements. [Bug 2330040]
FossilOrigin-Name: 4cc290da5f864f0623155e5c8618ea9178653e94
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/tcltk-man2html.tcl | 66 |
1 files changed, 39 insertions, 27 deletions
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} "×" \ - {\(->} "<font size=\"+1\">→</font>" \ - {\fP} {\fR} \ - {\.} . \ - {\(bu} "•" \ - ] + {\&} "\t" \ + {\%} {} \ + "\\\n" "\n" \ + {\(+-} "±" \ + {\(co} "©" \ + {\(em} "—" \ + {\(fm} "′" \ + {\(mu} "×" \ + {\(mi} "−" \ + {\(->} "<font size=\"+1\">→</font>" \ + {\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 <DL> - lappend manual(section-toc) <DL> - foreach option [lsort -dictionary $opts] { - man-puts "<DT><B>[std-option-toc $option $targetPage]</B>" + # 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 </DL> - lappend manual(section-toc) </DL> - } else { - manerror "unexpected .SO format:\n[expand-next-text 2]" + if {![next-op-is .SO rest]} { + break + } + } + output-directive {.SH STANDARD OPTIONS} + man-puts <DL> + lappend manual(section-toc) <DL> + foreach optionpair [lsort -dictionary -index 0 $optslist] { + lassign $optionpair option targetPage + man-puts "<DT><B>[std-option-toc $option $targetPage]</B>" } + man-puts </DL> + lappend manual(section-toc) </DL> } .OP { output-widget-options $rest |