[docmaker] Produce better HTML code. * src/tools/docmaker/tohtml.py: Always use double quotes for attribute values. (source_footer): Close `td' and `tr' groups.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
diff --git a/ChangeLog b/ChangeLog
index 9f9f012..be5acae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2014-11-27 Werner Lemberg <wl@gnu.org>
+ [docmaker] Produce better HTML code.
+
+ * src/tools/docmaker/tohtml.py: Always use double quotes for
+ attribute values.
+ (source_footer): Close `td' and `tr' groups.
+
+2014-11-27 Werner Lemberg <wl@gnu.org>
+
Use better way to disable creation of .pyc files for `make refdoc'.
Python 2.6 was released in 2008...
diff --git a/src/tools/docmaker/tohtml.py b/src/tools/docmaker/tohtml.py
index 8861633..aa4ccbe 100644
--- a/src/tools/docmaker/tohtml.py
+++ b/src/tools/docmaker/tohtml.py
@@ -64,18 +64,18 @@ html_header_2 = """\
"""
html_header_3 = """
-<table align=center><tr><td><font size=-1>[<a href="\
+<table align="center"><tr><td><font size="-1">[<a href="\
"""
html_header_3i = """
-<table align=center><tr><td width="100%"></td>
-<td><font size=-1>[<a href="\
+<table align="center"><tr><td width="100%"></td>
+<td><font size="-1">[<a href="\
"""
html_header_4 = """\
">Index</a>]</font></td>
<td width="100%"></td>
-<td><font size=-1>[<a href="\
+<td><font size="-1">[<a href="\
"""
html_header_5 = """\
@@ -113,40 +113,40 @@ para_header = "<p>"
para_footer = "</p>"
# Block header and footer.
-block_header = '<table align=center width="75%"><tr><td>'
+block_header = '<table align="center" width="75%"><tr><td>'
block_footer_start = """\
</td></tr></table>
<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="\
+<table align="center" width="75%"><tr><td><font size="-2">[<a href="\
"""
block_footer_middle = """\
">Index</a>]</font></td>
<td width="100%"></td>
-<td><font size=-2>[<a href="\
+<td><font size="-2">[<a href="\
"""
block_footer_end = """\
">TOC</a>]</font></td></tr></table>
"""
# Description header/footer.
-description_header = '<table align=center width="87%"><tr><td>'
+description_header = '<table align="center" width="87%"><tr><td>'
description_footer = "</td></tr></table><br>"
# Marker header/inter/footer combination.
-marker_header = '<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>'
+marker_header = '<table align="center" width="87%" cellpadding="5"><tr bgcolor="#EEEEFF"><td><em><b>'
marker_inter = "</b></em></td></tr><tr><td>"
marker_footer = "</td></tr></table>"
# Header location header/footer.
-header_location_header = '<table align=center width="87%"><tr><td>'
+header_location_header = '<table align="center" width="87%"><tr><td>'
header_location_footer = "</td></tr></table><br>"
# Source code extracts header/footer.
-source_header = '<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>\n'
-source_footer = "\n</pre></table><br>"
+source_header = '<table align="center" width="87%"><tr bgcolor="#D6E8FF"><td><pre>\n'
+source_footer = "\n</pre></td></tr></table><br>"
# Chapter header/inter/footer.
-chapter_header = '<br><table align=center width="75%"><tr><td><h2>'
+chapter_header = '<br><table align="center" width="75%"><tr><td><h2>'
chapter_inter = '</h2><ul class="empty"><li>'
chapter_footer = '</li></ul></td></tr></table>'
@@ -154,7 +154,7 @@ chapter_footer = '</li></ul></td></tr></table>'
index_footer_start = """\
<hr>
<table><tr><td width="100%"></td>
-<td><font size=-2>[<a href="\
+<td><font size="-2">[<a href="\
"""
index_footer_end = """\
">TOC</a>]</font></td></tr></table>
@@ -163,7 +163,7 @@ index_footer_end = """\
# TOC footer.
toc_footer_start = """\
<hr>
-<table><tr><td><font size=-2>[<a href="\
+<table><tr><td><font size="-2">[<a href="\
"""
toc_footer_end = """\
">Index</a>]</font></td>
@@ -230,7 +230,7 @@ class HtmlFormatter( Formatter ):
+ html_header_5t + project_title
+ html_header_6 )
self.html_footer = (
- "<center><font size=""-2"">generated on "
+ '<center><font size="-2">generated on '
+ time.asctime( time.localtime( time.time() ) )
+ "</font></center>" + html_footer )
@@ -317,7 +317,7 @@ class HtmlFormatter( Formatter ):
def print_html_field( self, field ):
if field.name:
- print( "<table><tr valign=top><td><b>"
+ print( '<table><tr valign="top"><td><b>'
+ field.name
+ "</b></td><td>" )
@@ -360,15 +360,15 @@ class HtmlFormatter( Formatter ):
def print_html_field_list( self, fields ):
print "<p></p>"
- print "<table cellpadding=3 border=0>"
+ print '<table cellpadding="3" border="0">'
for field in fields:
if len( field.name ) > 22:
- print( "<tr valign=top><td colspan=0><b>"
+ print( '<tr valign="top"><td colspan="0"><b>'
+ field.name
+ "</b></td></tr>" )
- print "<tr valign=top><td></td><td>"
+ print '<tr valign="top"><td></td><td>'
else:
- print( "<tr valign=top><td><b>"
+ print( '<tr valign="top"><td><b>'
+ field.name
+ "</b></td><td>" )
@@ -411,7 +411,7 @@ class HtmlFormatter( Formatter ):
count = len( self.block_index )
rows = ( count + self.columns - 1 ) / self.columns
- print "<table align=center border=0 cellpadding=0 cellspacing=0>"
+ print '<table align="center" border="0" cellpadding="0" cellspacing="0">'
for r in range( rows ):
line = "<tr>"
for c in range( self.columns ):
@@ -451,10 +451,10 @@ class HtmlFormatter( Formatter ):
def toc_chapter_enter( self, chapter ):
print chapter_header + string.join( chapter.title ) + chapter_inter
- print "<table cellpadding=5>"
+ print '<table cellpadding="5">'
def toc_section_enter( self, section ):
- print '<tr valign=top><td class="left">'
+ print '<tr valign="top"><td class="left">'
print( '<a href="' + self.make_section_url( section ) + '">'
+ section.title + '</a></td><td>' )
@@ -507,7 +507,7 @@ class HtmlFormatter( Formatter ):
if maxwidth <> 0:
# print section synopsis
print section_synopsis_header
- print "<table align=center cellspacing=5 cellpadding=0 border=0>"
+ print '<table align="center" cellspacing="5" cellpadding="0" border="0">'
columns = width / maxwidth
if columns < 1: