summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2008-11-24 10:02:43 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2008-11-24 10:02:43 (GMT)
commit7a7f3cd3492455ecfeb0c513c9e9c860e32b39f1 (patch)
treed127a23fc5b784a3934ed14934f9b8b5d58f0a11 /tools
parent974a49e4500d766dfd050097ec752d5b712245ec (diff)
downloadtcl-7a7f3cd3492455ecfeb0c513c9e9c860e32b39f1.zip
tcl-7a7f3cd3492455ecfeb0c513c9e9c860e32b39f1.tar.gz
tcl-7a7f3cd3492455ecfeb0c513c9e9c860e32b39f1.tar.bz2
Converter script improvements. [Bug 2330040]
Diffstat (limited to 'tools')
-rwxr-xr-xtools/tcltk-man2html.tcl66
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" \
- {\(+-} "&#177;" \
- {\(co} "&copy;" \
- {\(em} "&#8212;" \
- {\(fm} "&#8242;" \
- {\(mu} "&#215;" \
- {\(->} "<font size=\"+1\">&#8594;</font>" \
- {\fP} {\fR} \
- {\.} . \
- {\(bu} "&#8226;" \
- ]
+ {\&} "\t" \
+ {\%} {} \
+ "\\\n" "\n" \
+ {\(+-} "&#177;" \
+ {\(co} "&copy;" \
+ {\(em} "&#8212;" \
+ {\(fm} "&#8242;" \
+ {\(mu} "&#215;" \
+ {\(mi} "&#8722;" \
+ {\(->} "<font size=\"+1\">&#8594;</font>" \
+ {\fP} {\fR} \
+ {\.} . \
+ {\(bu} "&#8226;" \
+ ]
lappend charmap {\o'o^'} {&ocirc;} ; # 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