summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2008-11-24 10:02:42 (GMT)
committerdkf <dkf@noemail.net>2008-11-24 10:02:42 (GMT)
commit4a61c05f625cf66a32ac06d32dbd3087918f60d9 (patch)
treed127a23fc5b784a3934ed14934f9b8b5d58f0a11 /tools
parent4e423b270c1b1c0ac8360c7b25b770fa0056287c (diff)
downloadtcl-4a61c05f625cf66a32ac06d32dbd3087918f60d9.zip
tcl-4a61c05f625cf66a32ac06d32dbd3087918f60d9.tar.gz
tcl-4a61c05f625cf66a32ac06d32dbd3087918f60d9.tar.bz2
Converter script improvements. [Bug 2330040]
FossilOrigin-Name: 4cc290da5f864f0623155e5c8618ea9178653e94
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