comparison packages/pkgconf/fixhtml.tcl @ 171:42f843b391aa

Merge from eCos master repository on 2001-07-18-03:13:25-BST
author jlarmour
date Wed, 18 Jul 2001 11:38:39 +0000
parents 0d2b193a635f
children feb0fcf83327
comparison
equal deleted inserted replaced
170:f664e0b5f88b 171:42f843b391aa
66 <!-- copyright holder. --> 66 <!-- copyright holder. -->
67 <!-- Distribution of the work or derivative of the work in any --> 67 <!-- Distribution of the work or derivative of the work in any -->
68 <!-- standard (paper) book form is prohibited unless prior --> 68 <!-- standard (paper) book form is prohibited unless prior -->
69 <!-- permission is obtained from the copyright holder. -->" 69 <!-- permission is obtained from the copyright holder. -->"
70 70
71 # The generated files all have a .htm suffix rather than a .html
72 # suffix. For now this is preserved, to avoid having to change all the
73 # anchors. It might be better to rename all the files to .html in
74 # future, and perhaps also to change book1.htm to index.htm
75
76 set files [glob *.html] 71 set files [glob *.html]
77 foreach file $files { 72 foreach file $files {
78 set status [catch { 73 set status [catch {
79 74
80 set fd [open $file "r"] 75 set fd [open $file "r"]
82 close $fd 77 close $fd
83 78
84 # If there is already a (C) message on the first line, skip this file. 79 # If there is already a (C) message on the first line, skip this file.
85 if {[regexp {[^\n]*Copyright (C) [0-9]* Red Hat.*} $data] == 0} { 80 if {[regexp {[^\n]*Copyright (C) [0-9]* Red Hat.*} $data] == 0} {
86 81
87
88 # The DSSSL has the annoying habit of splitting tags over several lines. 82 # The DSSSL has the annoying habit of splitting tags over several lines.
89 # This should sort things out. 83 # This should sort things out.
90 # REMOVED by jifl: doing this can add newlines in tags like 84 # REMOVED by jifl: doing this can add newlines in tags like
91 # <literallayout>, <screen>, and/or <programlisting> 85 # <literallayout>, <screen>, and/or <programlisting>
92 # regsub -all "\n>" $data ">\n" data 86 # regsub -all "\n>" $data ">\n" data
93 87
94 # Add a copyright banner 88 # Add a copyright banner
95 set data "[set copyright_banner]\n[set data]" 89 set data "[set copyright_banner]\n[set data]"
96 90
91 # Look for a smarttags meta. If absent, insert one. There should
92 # already be one meta present identifying the stylesheet, so
93 # that identifies a sensible location for inserting another meta.
94 if {[regexp {MSSmartTagsPreventParsing} $data] == 0} {
95 regsub -nocase {<META} $data "<meta name=\"MSSmartTagsPreventParsing\" content=\"TRUE\">\n<META" data
96 }
97
97 # Take care of some character entities that Netscape does not understand 98 # Take care of some character entities that Netscape does not understand
98 regsub -all "&mgr;" $data "\\&#03BC;" data 99 regsub -all "&mgr;" $data "\\&#03BC;" data
99 regsub -all "&mdash;" $data "\\&#8212;" data 100 regsub -all "&mdash;" $data "\\&#8212;" data
100 regsub -all "&hellip;" $data "\\&#8230;" data 101 regsub -all "&hellip;" $data "\\&#8230;" data
101 regsub -all "&ldquo;" $data "\\&#8220;" data 102 regsub -all "&ldquo;" $data "\\&#8220;" data