latex2e writer : Move usepackage hyperref after stylesheet inclusion.
[docutils.git] / test / test_writers / test_html4css1_template.py
blob98714fde60ff3666541e04301a65adafb7863f97
1 #!/usr/bin/env python
3 # $Id$
4 # Author: David Goodger <goodger@python.org>
5 # Copyright: This module has been placed in the public domain.
7 """
8 Tests for the HTML writer.
9 """
11 import os
12 from __init__ import DocutilsTestSupport
15 def suite():
16 settings = {'template': os.path.join(DocutilsTestSupport.testroot,
17 'data', 'full-template.txt'),
18 'embed_stylesheet': 0,}
19 s = DocutilsTestSupport.PublishTestSuite('html', suite_settings=settings)
20 s.generateTests(totest)
21 return s
23 totest = {}
25 totest['template'] = [
26 ["""\
27 ================
28 Document Title
29 ================
30 ----------
31 Subtitle
32 ----------
34 :Author: Me
36 .. footer:: footer text
38 Section
39 =======
41 Some text.
42 """,
43 r'''head_prefix = """\
44 <?xml version="1.0" encoding="utf-8" ?>
45 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
46 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
47 <head>"""
50 head = """\
51 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
52 <meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
53 <title>Document Title</title>
54 <meta name="author" content="Me" />"""
57 stylesheet = """\
58 <link rel="stylesheet" href="../docutils/writers/html4css1/html4css1.css" type="text/css" />"""
61 body_prefix = """\
62 </head>
63 <body>
64 <div class="document" id="document-title">"""
67 body_pre_docinfo = """\
68 <h1 class="title">Document Title</h1>
69 <h2 class="subtitle" id="subtitle">Subtitle</h2>"""
72 docinfo = """\
73 <table class="docinfo" frame="void" rules="none">
74 <col class="docinfo-name" />
75 <col class="docinfo-content" />
76 <tbody valign="top">
77 <tr><th class="docinfo-name">Author:</th>
78 <td>Me</td></tr>
79 </tbody>
80 </table>"""
83 body = """\
84 <div class="section" id="section">
85 <h1>Section</h1>
86 <p>Some text.</p>
87 </div>"""
90 body_suffix = """\
91 </div>
92 <div class="footer">
93 <hr class="footer" />
94 footer text
95 </div>
96 </body>
97 </html>"""
100 head_prefix = """\
101 <?xml version="1.0" encoding="utf-8" ?>
102 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
103 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
104 <head>"""
107 head = """\
108 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
109 <meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
110 <title>Document Title</title>
111 <meta name="author" content="Me" />"""
114 stylesheet = """\
115 <link rel="stylesheet" href="../docutils/writers/html4css1/html4css1.css" type="text/css" />"""
118 body_prefix = """\
119 </head>
120 <body>
121 <div class="document" id="document-title">"""
124 body_pre_docinfo = """\
125 <h1 class="title">Document Title</h1>
126 <h2 class="subtitle" id="subtitle">Subtitle</h2>"""
129 docinfo = """\
130 <table class="docinfo" frame="void" rules="none">
131 <col class="docinfo-name" />
132 <col class="docinfo-content" />
133 <tbody valign="top">
134 <tr><th class="docinfo-name">Author:</th>
135 <td>Me</td></tr>
136 </tbody>
137 </table>"""
140 body = """\
141 <div class="section" id="section">
142 <h1>Section</h1>
143 <p>Some text.</p>
144 </div>"""
147 body_suffix = """\
148 </div>
149 <div class="footer">
150 <hr class="footer" />
151 footer text
152 </div>
153 </body>
154 </html>"""
157 title = """\
158 Document Title"""
161 subtitle = """\
162 Subtitle"""
165 header = """\
169 footer = """\
170 <div class="footer">
171 <hr class="footer" />
172 footer text
173 </div>"""
176 meta = """\
177 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
178 <meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
179 <meta name="author" content="Me" />"""
182 fragment = """\
183 <div class="section" id="section">
184 <h1>Section</h1>
185 <p>Some text.</p>
186 </div>"""
189 html_prolog = """\
190 <?xml version="1.0" encoding="%s" ?>
191 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">"""
194 html_head = """\
195 <meta http-equiv="Content-Type" content="text/html; charset=%s" />
196 <meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
197 <title>Document Title</title>
198 <meta name="author" content="Me" />"""
201 html_title = """\
202 <h1 class="title">Document Title</h1>"""
205 html_subtitle = """\
206 <h2 class="subtitle" id="subtitle">Subtitle</h2>"""
209 html_body = """\
210 <div class="document" id="document-title">
211 <h1 class="title">Document Title</h1>
212 <h2 class="subtitle" id="subtitle">Subtitle</h2>
213 <table class="docinfo" frame="void" rules="none">
214 <col class="docinfo-name" />
215 <col class="docinfo-content" />
216 <tbody valign="top">
217 <tr><th class="docinfo-name">Author:</th>
218 <td>Me</td></tr>
219 </tbody>
220 </table>
221 <div class="section" id="section">
222 <h1>Section</h1>
223 <p>Some text.</p>
224 </div>
225 </div>
226 <div class="footer">
227 <hr class="footer" />
228 footer text
229 </div>"""
230 ''']
233 if __name__ == '__main__':
234 import unittest
235 unittest.main(defaultTest='suite')