summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-05-18 12:28:40 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-05-18 12:28:40 (GMT)
commited17621baeb45319b311dda8072998d0f8b3fd45 (patch)
treef2d9573d38cfec1ccab74708c4ff275758102325 /tools
parentf5104d2203876e2a9cfa961aaa04abd6973c44ce (diff)
downloadtcl-ed17621baeb45319b311dda8072998d0f8b3fd45.zip
tcl-ed17621baeb45319b311dda8072998d0f8b3fd45.tar.gz
tcl-ed17621baeb45319b311dda8072998d0f8b3fd45.tar.bz2
More adaptations to understand .SS macros.
Diffstat (limited to 'tools')
-rw-r--r--tools/index.tcl4
-rw-r--r--tools/man2html1.tcl2
-rw-r--r--tools/man2html2.tcl16
-rwxr-xr-xtools/tcltk-man2html.tcl26
4 files changed, 32 insertions, 16 deletions
diff --git a/tools/index.tcl b/tools/index.tcl
index 26e4386..b39f7ca 100644
--- a/tools/index.tcl
+++ b/tools/index.tcl
@@ -9,7 +9,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: index.tcl,v 1.4 2003/06/04 23:40:18 mistachkin Exp $
+# RCS: @(#) $Id: index.tcl,v 1.5 2004/05/18 12:28:40 dkf Exp $
#
# Global variables used by these scripts:
@@ -133,7 +133,7 @@ proc text string {
proc macro {name args} {
switch $name {
- SH {
+ SH - SS {
global state
switch $args {
diff --git a/tools/man2html1.tcl b/tools/man2html1.tcl
index 2e8ba52..0adc61e 100644
--- a/tools/man2html1.tcl
+++ b/tools/man2html1.tcl
@@ -75,7 +75,7 @@ proc text string {
proc macro {name args} {
switch $name {
- SH {
+ SH - SS {
global state
switch $args {
diff --git a/tools/man2html2.tcl b/tools/man2html2.tcl
index 789b4db..41244eb 100644
--- a/tools/man2html2.tcl
+++ b/tools/man2html2.tcl
@@ -307,6 +307,9 @@ proc macro {name args} {
SH {
SHmacro $args
}
+ SS {
+ SSmacro $args subsection
+ }
SO {
global noFillCount inPRE file
@@ -625,12 +628,13 @@ proc macro2 {name args} {
# SHmacro --
#
-# Subsection head; handles the .SH macro.
+# Subsection head; handles the .SH and .SS macros.
#
# Arguments:
# name - Section name.
+# style - Type of section (optional)
-proc SHmacro argList {
+proc SHmacro {argList {style section}} {
global file noFillCount textState charCnt
set args [join $argList " "]
@@ -641,9 +645,13 @@ proc SHmacro argList {
set noFillCount 0
nest reset
- puts -nonewline $file "<H3>"
+ set tag H3
+ if {[string compare "subsection" $level] == 0} {
+ set tag H4
+ }
+ puts -nonewline $file "<$tag>"
text $args
- puts $file "</H3>"
+ puts $file "</$tag>"
# ? args textState
diff --git a/tools/tcltk-man2html.tcl b/tools/tcltk-man2html.tcl
index b7d03dc..7190b1d 100755
--- a/tools/tcltk-man2html.tcl
+++ b/tools/tcltk-man2html.tcl
@@ -488,7 +488,7 @@ proc output-RS-list {} {
.RE {
break
}
- .SH {
+ .SH - .SS {
manerror "unbalanced .RS at section end"
backup-text 1
break
@@ -534,7 +534,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>
@@ -954,14 +957,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 +1001,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 +1030,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 +1057,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 +1080,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 +1385,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]"