[docmaker] Provide higher-level markup and simplify HTML. * src/tools/docmaker/tohtml.py: Instead of using extraneous `<div>' elements, use CSS descendants (of class `section') to format the data. Also remove reduntant <p> and <br> elements, replacing them with proper CSS. Globally reduce page width to 75%. (block_header): Rename <div> class to `section'.
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 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
diff --git a/ChangeLog b/ChangeLog
index e7da604..e071840 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
2014-11-29 Werner Lemberg <wl@gnu.org>
+ [docmaker] Provide higher-level markup and simplify HTML.
+
+ * src/tools/docmaker/tohtml.py: Instead of using extraneous `<div>'
+ elements, use CSS descendants (of class `section') to format the
+ data.
+
+ Also remove reduntant <p> and <br> elements, replacing them with
+ proper CSS.
+
+ Globally reduce page width to 75%.
+
+ (block_header): Rename <div> class to `section'.
+
+2014-11-29 Werner Lemberg <wl@gnu.org>
+
[docmaker] Add `top' links after blocks.
* src/tools/docmaker/tohtml.py (block_footer_middle): Implement it.
diff --git a/src/tools/docmaker/tohtml.py b/src/tools/docmaker/tohtml.py
index 74b8e0c..da9eb2c 100644
--- a/src/tools/docmaker/tohtml.py
+++ b/src/tools/docmaker/tohtml.py
@@ -41,28 +41,34 @@ html_header_2 = """\
body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
color: #000000;
- background: #FFFFFF; }
+ background: #FFFFFF;
+ width: 87%;
+ margin: auto; }
- div.code { width: 100%;
- background-color: #D6E8FF;
- margin: 0 0 0 -0.5em;
- padding: 0.3ex 0 0.3ex 0.5em; }
- div.indent1 { width: 87%;
- margin: auto; }
div.indent2 { width: 75%;
margin: auto; }
+ div.section { width: 75%;
+ margin: auto; }
+ div.section hr { margin: 4ex 0 1ex 0; }
+ div.section h4 { background-color: #EEEEFF;
+ font-size: medium;
+ font-style: oblique;
+ font-weight: bold;
+ margin: 3ex 0 1.5ex 9%;
+ padding: 0.3ex 0 0.3ex 1%; }
+ div.section p { margin: 1.5ex 0 1.5ex 10%; }
+ div.section pre { margin: 3ex 0 3ex 9%;
+ background-color: #D6E8FF;
+ padding: 2ex 0 2ex 1%; }
+ div.section table.fields { width: 90%;
+ margin: 1.5ex 0 1.5ex 10%; }
div.timestamp { text-align: center;
- font-size: 69%; }
+ font-size: 69%;
+ margin: 1.5ex 0 1.5ex 0; }
h1 { text-align: center; }
- h3 { font-size: medium; }
- h4 { background-color: #EEEEFF;
- width: 100%;
- font-size: medium;
- font-style: oblique;
- font-weight: bold;
- margin: 0 0 0 -0.5em;
- padding: 0.3ex 0 0.3ex 0.5em; }
+ h3 { font-size: medium;
+ margin: 4ex 0 1.5ex 0; }
li { text-align: justify; }
@@ -76,9 +82,6 @@ html_header_2 = """\
color: darkblue; }
table.center { margin: auto; }
- table.fields { border: 0;
- border-spacing: 0;
- width: 100%; }
table.fields td.val { font-weight: bold;
text-align: right;
width: 30%;
@@ -86,7 +89,7 @@ html_header_2 = """\
padding: 0 1em 0 0; }
table.fields td.desc { vertical-align: baseline;
padding: 0 0 0 1em; }
- table.index { margin: auto;
+ table.index { margin: 6ex auto 6ex auto;
border: 0;
border-collapse: separate;
border-spacing: 1em 0.3ex; }
@@ -94,7 +97,8 @@ html_header_2 = """\
table.index td { padding: 0; }
table.index-toc-link { width: 100%;
border: 0;
- border-spacing: 0; }
+ border-spacing: 0;
+ margin: 1ex 0 1ex 0; }
table.index-toc-link td.left { padding: 0 0.5em 0 0.5em;
font-size: 83%;
text-align: left; }
@@ -112,6 +116,7 @@ html_header_2 = """\
table.synopsis td { padding: 0; }
td { padding: 0 0.5em 0 0.5em; }
+ td.desc p { margin: 1.5ex 0 1.5ex 0; }
td.left { padding: 0 0.5em 0 0.5em;
text-align: left; }
@@ -130,8 +135,7 @@ html_header_3r = """
"""
html_header_4 = """\
-">Index</a>]</td>
-<td class="right">[<a href="\
+">Index</a>]</td><td class="right">[<a href="\
"""
html_header_5t = """\
@@ -168,14 +172,14 @@ para_header = "<p>"
para_footer = "</p>"
# Block header and footer.
-block_header = '<div class="indent2">'
+block_header = '<div class="section">'
block_footer_start = """\
<hr>
<table class="index-toc-link"><tr><td class="left">[<a href="\
"""
block_footer_middle = """\
-">Index</a>]</td>
-<td class="middle">[<a href="#">Top</a>]</td>
+">Index</a>]</td>\
+<td class="middle">[<a href="#">Top</a>]</td>\
<td class="right">[<a href="\
"""
block_footer_end = """\
@@ -183,21 +187,21 @@ block_footer_end = """\
"""
# Description header/footer.
-description_header = '<div class="indent1">'
-description_footer = "</div><br>"
+description_header = ""
+description_footer = ""
# Marker header/inter/footer combination.
-marker_header = '<div class="indent1"><h4>'
+marker_header = "<h4>"
marker_inter = "</h4>"
-marker_footer = "</div>"
+marker_footer = ""
# Header location header/footer.
-header_location_header = '<div class="indent1">'
-header_location_footer = "</div><br>"
+header_location_header = "<p>"
+header_location_footer = "</p>"
# Source code extracts header/footer.
-source_header = '<div class="indent1"><div class="code"><pre>'
-source_footer = "</pre></div></div>"
+source_header = "<pre>"
+source_footer = "</pre>"
# Chapter header/inter/footer.
chapter_header = '<br><div class="indent2"><h2>'
@@ -415,7 +419,6 @@ class HtmlFormatter( Formatter ):
return result
def print_html_field_list( self, fields ):
- print "<p></p>"
print '<table class="fields">'
for field in fields:
print ( '<tr><td class="val">'
@@ -579,7 +582,7 @@ class HtmlFormatter( Formatter ):
line = line + "</tr>"
print line
- print "</table><br><br>"
+ print "</table>"
print section_synopsis_footer
print description_header
@@ -607,9 +610,9 @@ class HtmlFormatter( Formatter ):
# + " '" + block.source.filename + "'.\n" )
if header:
- print header_location_header
- print 'Defined in ' + header + '.'
- print header_location_footer
+ print ( header_location_header
+ + 'Defined in ' + header + '.'
+ + header_location_footer )
print source_header
for l in block.code: