summaryrefslogtreecommitdiffstats
path: root/tools/tcltk-man2html-utils.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tools/tcltk-man2html-utils.tcl')
-rw-r--r--tools/tcltk-man2html-utils.tcl85
1 files changed, 71 insertions, 14 deletions
diff --git a/tools/tcltk-man2html-utils.tcl b/tools/tcltk-man2html-utils.tcl
index 65d81de..34222e3 100644
--- a/tools/tcltk-man2html-utils.tcl
+++ b/tools/tcltk-man2html-utils.tcl
@@ -50,7 +50,7 @@ proc indexfile {} {
proc copyright {copyright {level {}}} {
# We don't actually generate a separate copyright page anymore
#set page "${level}copyright.htm"
- #return "<A HREF=\"$page\">Copyright</A> &#169; [htmlize-text [lrange $copyright 2 end]]"
+ #return "<A HREF=\"$page\">Copyright</A> &copy; [htmlize-text [lrange $copyright 2 end]]"
# obfuscate any email addresses that may appear in name
set who [string map {@ (at)} [lrange $copyright 2 end]]
return "Copyright &copy; [htmlize-text $who]"
@@ -130,8 +130,8 @@ proc htmlize-text {text {charmap {}}} {
\" {&quot;} \
{<} {&lt;} \
{>} {&gt;} \
- \u201c "&#8220;" \
- \u201d "&#8221;"
+ \u201c "&ldquo;" \
+ \u201d "&rdquo;"
return [string map $charmap $text]
}
@@ -144,20 +144,73 @@ proc process-text {text} {
{\&} "\t" \
{\%} {} \
"\\\n" "\n" \
- {\(+-} "&#177;" \
+ {\(r!} "&iexcl;" \
+ {\(ct} "&cent;" \
+ {\(Po} "&pound;" \
+ {\(Cs} "&curren;" \
+ {\(Ye} "&yen;" \
+ {\(bb} "&brvbar;" \
+ {\(sc} "&sect;" \
+ {\(ad} "&die;" \
{\(co} "&copy;" \
- {\(em} "&#8212;" \
- {\(en} "&#8211;" \
- {\(fm} "&#8242;" \
- {\(mc} "&#181;" \
- {\(mu} "&#215;" \
- {\(mi} "&#8722;" \
- {\(->} "<font size=\"+1\">&#8594;</font>" \
+ {\(Of} "&ordf;" \
+ {\(Fo} "&laquo;" \
+ {\(no} "&not;" \
+ {\(rg} "&reg;" \
+ {\(a-} "&macr;" \
+ {\(de} "&deg;" \
+ {\(+-} "&plusmn;" \
+ {\(S2} "&sup2;" \
+ {\(S3} "&sup3;" \
+ {\(aa} "&acute;" \
+ {\(mc} "&micro;" \
+ {\(ps} "&para;" \
+ {\(pc} "&middot;" \
+ {\(ac} "&cedil;" \
+ {\(S1} "&sup1;" \
+ {\(Om} "&ordm;" \
+ {\(Fc} "&raquo;" \
+ {\(14} "&frac14;" \
+ {\(12} "&frac12;" \
+ {\(34} "&frac34;" \
+ {\(r?} "&iquest;" \
+ {\(AE} "&AElig;" \
+ {\(-D} "&ETH;" \
+ {\(mu} "&times;" \
+ {\(TP} "&THORN;" \
+ {\(ss} "&szlig;" \
+ {\(ae} "&aelig;" \
+ {\(Sd} "&eth;" \
+ {\(di} "&divide;" \
+ {\(Tp} "&thorn;" \
+ {\(em} "&mdash;" \
+ {\(en} "&ndash;" \
+ {\(fm} "&prime;" \
+ {\(mi} "&minus;" \
+ {\(.i} "&imath;" \
+ {\(.j} "&jmath;" \
+ {\(Fn} "&fnof;" \
+ {\(OE} "&OElig;" \
+ {\(oe} "&oelig;" \
+ {\(IJ} "&IJlig;" \
+ {\(ij} "&ijlig;" \
+ {\(<-} "<font size=\"+1\">&larr;</font>" \
+ {\(->} "<font size=\"+1\">&rarr;</font>" \
+ {\(eu} "&euro;" \
{\fP} {\fR} \
{\.} . \
- {\(bu} "&#8226;" \
+ {\(bu} "&bull;" \
{\*(qo} "&ocirc;" \
]
+ # This might make a few invalid mappings, but we don't use them
+ foreach c {a c e g i l n o s t u y z A C E G I L N O S T U Y Z} {
+ foreach {prefix suffix} {
+ o ring / slash : uml ' acute ^ circ ` grave ~ tilde , cedil v caron
+ } {
+ lappend charmap "\\\[${prefix}${c}\]" "&${c}${suffix};"
+ lappend charmap "\\(${prefix}${c}" "&${c}${suffix};"
+ }
+ }
lappend charmap {\-\|\-} -- ; # two hyphens
lappend charmap {\-} - ; # a hyphen
@@ -520,7 +573,7 @@ proc output-IP-list {context code rest} {
if {[regexp {^\[[\da-f]+\]|\(?[\da-f]+\)$} $rest]} {
set dl "<OL class=\"[string tolower $manual(section)]\">"
set enddl "</OL>"
- } elseif {"&#8226;" eq $rest} {
+ } elseif {"&bull;" eq $rest} {
set dl "<UL class=\"[string tolower $manual(section)]\">"
set enddl "</UL>"
}
@@ -546,7 +599,7 @@ proc output-IP-list {context code rest} {
man-puts "$para<LI value=\"$value\">"
} elseif {[regexp {^\(?([\da-f]+)\)$} $rest -> value]} {
man-puts "$para<LI value=\"$value\">"
- } elseif {"&#8226;" eq $rest} {
+ } elseif {"&bull;" eq $rest} {
man-puts "$para<LI>"
} else {
man-puts "$para<DT>[long-toc $rest]<DD>"
@@ -1559,6 +1612,10 @@ proc make-manpage-section {outputDir sectionDescriptor} {
puts stderr ""
}
+ if {![llength $manual(wing-toc)]} {
+ fatal "not table of contents."
+ }
+
#
# make the wing table of contents for the section
#