140 "CodeDocumentationViewer", |
142 "CodeDocumentationViewer", |
141 "No further documentation available")) |
143 "No further documentation available")) |
142 ) |
144 ) |
143 |
145 |
144 return ( |
146 return ( |
145 mainTemplate |
147 mainTemplate.format("dark" if e5App().usesDarkPalette() else "light") |
146 .replace("@HEADER@", header) |
148 .replace("@HEADER@", header) |
147 .replace("@DOCSTRING@", docstring) |
149 .replace("@DOCSTRING@", docstring) |
148 ) |
150 ) |
149 |
151 |
150 |
152 |
160 mainTemplate = """ |
162 mainTemplate = """ |
161 <!DOCTYPE html> |
163 <!DOCTYPE html> |
162 <html> |
164 <html> |
163 <head> |
165 <head> |
164 <meta http-equiv="content-type" content="text/html; charset=utf-8"> |
166 <meta http-equiv="content-type" content="text/html; charset=utf-8"> |
165 <link rel="stylesheet" href="qrc:documentViewerStyle.css" |
167 <link rel="stylesheet" href="qrc:documentViewerStyle-{0}.css" |
166 type="text/css" /> |
168 type="text/css" /> |
167 </head> |
169 </head> |
168 <body> |
170 <body> |
169 <div id="doc-warning">@TEXT@</div> |
171 <div id="doc-warning">@TEXT@</div> |
170 </body> |
172 </body> |
171 </html> |
173 </html> |
172 """ |
174 """ |
173 |
175 |
174 return mainTemplate.replace("@TEXT@", text) |
176 return ( |
|
177 mainTemplate.format("dark" if e5App().usesDarkPalette() else "light") |
|
178 .replace("@TEXT@", text) |
|
179 ) |
175 |
180 |
176 |
181 |
177 def prepareDocumentationViewerHtmlWarningDocument(text): |
182 def prepareDocumentationViewerHtmlWarningDocument(text): |
178 """ |
183 """ |
179 Public function to prepare a HTML warning document. |
184 Public function to prepare a HTML warning document. |
186 mainTemplate = """ |
191 mainTemplate = """ |
187 <!DOCTYPE html> |
192 <!DOCTYPE html> |
188 <html> |
193 <html> |
189 <head> |
194 <head> |
190 <meta http-equiv="content-type" content="text/html; charset=utf-8"> |
195 <meta http-equiv="content-type" content="text/html; charset=utf-8"> |
191 <link rel="stylesheet" href="qrc:documentViewerStyle.css" |
196 <link rel="stylesheet" href="qrc:documentViewerStyle-{0}.css" |
192 type="text/css" /> |
197 type="text/css" /> |
193 </head> |
198 </head> |
194 <body> |
199 <body> |
195 <div id="warning">@TEXT@</div> |
200 <div id="warning">@TEXT@</div> |
196 </body> |
201 </body> |
197 </html> |
202 </html> |
198 """ |
203 """ |
199 |
204 |
200 return mainTemplate.replace("@TEXT@", text) |
205 return ( |
|
206 mainTemplate.format("dark" if e5App().usesDarkPalette() else "light") |
|
207 .replace("@TEXT@", text) |
|
208 ) |