diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2008-11-24 10:02:43 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2008-11-24 10:02:43 (GMT) |
commit | 7a7f3cd3492455ecfeb0c513c9e9c860e32b39f1 (patch) | |
tree | d127a23fc5b784a3934ed14934f9b8b5d58f0a11 /tools | |
parent | 974a49e4500d766dfd050097ec752d5b712245ec (diff) | |
download | tcl-7a7f3cd3492455ecfeb0c513c9e9c860e32b39f1.zip tcl-7a7f3cd3492455ecfeb0c513c9e9c860e32b39f1.tar.gz tcl-7a7f3cd3492455ecfeb0c513c9e9c860e32b39f1.tar.bz2 |
Converter script improvements. [Bug 2330040]
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 |