diff options
Diffstat (limited to 'tools/tcltk-man2html-utils.tcl')
-rw-r--r-- | tools/tcltk-man2html-utils.tcl | 85 |
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> © [htmlize-text [lrange $copyright 2 end]]" + #return "<A HREF=\"$page\">Copyright</A> © [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 © [htmlize-text $who]" @@ -130,8 +130,8 @@ proc htmlize-text {text {charmap {}}} { \" {"} \ {<} {<} \ {>} {>} \ - \u201c "“" \ - \u201d "”" + \u201c "“" \ + \u201d "”" return [string map $charmap $text] } @@ -144,20 +144,73 @@ proc process-text {text} { {\&} "\t" \ {\%} {} \ "\\\n" "\n" \ - {\(+-} "±" \ + {\(r!} "¡" \ + {\(ct} "¢" \ + {\(Po} "£" \ + {\(Cs} "¤" \ + {\(Ye} "¥" \ + {\(bb} "¦" \ + {\(sc} "§" \ + {\(ad} "¨" \ {\(co} "©" \ - {\(em} "—" \ - {\(en} "–" \ - {\(fm} "′" \ - {\(mc} "µ" \ - {\(mu} "×" \ - {\(mi} "−" \ - {\(->} "<font size=\"+1\">→</font>" \ + {\(Of} "ª" \ + {\(Fo} "«" \ + {\(no} "¬" \ + {\(rg} "®" \ + {\(a-} "¯" \ + {\(de} "°" \ + {\(+-} "±" \ + {\(S2} "²" \ + {\(S3} "³" \ + {\(aa} "´" \ + {\(mc} "µ" \ + {\(ps} "¶" \ + {\(pc} "·" \ + {\(ac} "¸" \ + {\(S1} "¹" \ + {\(Om} "º" \ + {\(Fc} "»" \ + {\(14} "¼" \ + {\(12} "½" \ + {\(34} "¾" \ + {\(r?} "¿" \ + {\(AE} "Æ" \ + {\(-D} "Ð" \ + {\(mu} "×" \ + {\(TP} "Þ" \ + {\(ss} "ß" \ + {\(ae} "æ" \ + {\(Sd} "ð" \ + {\(di} "÷" \ + {\(Tp} "þ" \ + {\(em} "—" \ + {\(en} "–" \ + {\(fm} "′" \ + {\(mi} "−" \ + {\(.i} "ı" \ + {\(.j} "ȷ" \ + {\(Fn} "ƒ" \ + {\(OE} "Œ" \ + {\(oe} "œ" \ + {\(IJ} "IJ" \ + {\(ij} "ij" \ + {\(<-} "<font size=\"+1\">←</font>" \ + {\(->} "<font size=\"+1\">→</font>" \ + {\(eu} "€" \ {\fP} {\fR} \ {\.} . \ - {\(bu} "•" \ + {\(bu} "•" \ {\*(qo} "ô" \ ] + # 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 {"•" eq $rest} { + } elseif {"•" 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 {"•" eq $rest} { + } elseif {"•" 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 # |