summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authordas <das>2004-11-12 09:02:29 (GMT)
committerdas <das>2004-11-12 09:02:29 (GMT)
commitce9986a680127539554c2031d7f85312b3619315 (patch)
tree164cf4e58176c0a731e7347bb842051367e6dde6 /tools
parentce7e8c329343a49a8adaf322ba6d05030bc10cfb (diff)
downloadtcl-ce9986a680127539554c2031d7f85312b3619315.zip
tcl-ce9986a680127539554c2031d7f85312b3619315.tar.gz
tcl-ce9986a680127539554c2031d7f85312b3619315.tar.bz2
* doc/clock.n:
* doc/registry.n: * doc/upvar.n: fixed *roff errors uncovered by running 'make html'. * tools/tcltk-man2html.tcl: added faked support for bullet point lists, i.e. *nroff ".IP \(bu" syntax. Synced other changes from HEAD.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/tcltk-man2html.tcl31
1 files changed, 21 insertions, 10 deletions
diff --git a/tools/tcltk-man2html.tcl b/tools/tcltk-man2html.tcl
index 30e11d3..b9c8280 100755
--- a/tools/tcltk-man2html.tcl
+++ b/tools/tcltk-man2html.tcl
@@ -230,6 +230,7 @@ proc process-text {text} {
{\(+-} {&#177;} \
{\fP} {\fR} \
{\.} . \
+ {\(bu} {&#8226;} \
] $text]
regsub -all {\\o'o\^'} $text {\&ocirc;} text; # o-circumflex in re_syntax.n
regsub -all {\\-\\\|\\-} $text -- text; # two hyphens
@@ -488,7 +489,7 @@ proc output-RS-list {} {
.RE {
break
}
- .SH {
+ .SH - .SS {
manerror "unbalanced .RS at section end"
backup-text 1
break
@@ -534,7 +535,10 @@ proc output-IP-list {context code rest} {
man-puts </DL>
} else {
# labelled list, make contents
- if {[string compare $context ".SH"]} {
+ if {
+ [string compare $context ".SH"] &&
+ [string compare $context ".SS"]
+ } then {
man-puts <P>
}
man-puts <DL>
@@ -555,6 +559,8 @@ proc output-IP-list {context code rest} {
if {[string equal $manual(section) "ARGUMENTS"] || \
[regexp {^\[\d+\]$} $rest]} {
man-puts "$para<DT>$rest<DD>"
+ } elseif {[string equal {&#8226;} $rest]} {
+ man-puts "$para<DT><DD>$rest&nbsp;"
} else {
man-puts "$para<DT>[long-toc $rest]<DD>"
}
@@ -954,14 +960,18 @@ proc output-directive {line} {
.BE {
# man-puts <HR>
}
- .SH {
+ .SH - .SS {
# drain any open lists
# announce the subject
set manual(section) $rest
# start our own stack of stuff
set manual($manual(name)-$manual(section)) {}
lappend manual(has-$manual(section)) $manual(name)
- man-puts "<H3>[long-toc $manual(section)]</H3>"
+ if {[string compare .SS $code]} {
+ man-puts "<H3>[long-toc $manual(section)]</H3>"
+ } else {
+ man-puts "<H4>[long-toc $manual(section)]</H4>"
+ }
# some sections can simply free wheel their way through the text
# some sections can be processed in their own loops
switch -exact $manual(section) {
@@ -994,6 +1004,7 @@ proc output-directive {line} {
continue
}
if {[next-op-is .SH rest]
+ || [next-op-is .SS rest]
|| [next-op-is .BE rest]
|| [next-op-is .SO rest]} {
backup-text 1
@@ -1022,7 +1033,7 @@ proc output-directive {line} {
}
{SEE ALSO} {
while {[more-text]} {
- if {[next-op-is .SH rest]} {
+ if {[next-op-is .SH rest] || [next-op-is .SS rest]} {
backup-text 1
return
}
@@ -1049,7 +1060,7 @@ proc output-directive {line} {
}
KEYWORDS {
while {[more-text]} {
- if {[next-op-is .SH rest]} {
+ if {[next-op-is .SH rest] || [next-op-is .SS rest]} {
backup-text 1
return
}
@@ -1072,7 +1083,7 @@ proc output-directive {line} {
}
}
if {[next-op-is .IP rest]} {
- output-IP-list .SH .IP $rest
+ output-IP-list $code .IP $rest
return
}
if {[next-op-is .PP rest]} {
@@ -1377,11 +1388,11 @@ proc make-man-pages {html args} {
set manual(partial-text) {}
}
switch -exact $code {
- .SH {
+ .SH - .SS {
if {[llength $rest] == 0} {
gets $manual(infp) rest
}
- lappend manual(text) ".SH [unquote $rest]"
+ lappend manual(text) "$code [unquote $rest]"
}
.TH {
lappend manual(text) "$code [unquote $rest]"
@@ -1601,7 +1612,7 @@ proc make-man-pages {html args} {
}
puts $afp "</H2><HR><DL>"
foreach k $keys {
- if {[regexp -nocase -- "^keyword-$a" $k]} {
+ if {[string match -nocase "keyword-${a}*" $k]} {
set k [string range $k 8 end]
puts $afp "<DT><A NAME=\"$k\">$k</A><DD>"
set refs {}