Skip to content

Commit 6240527

Browse files
committed
Improve CSS for documentation
1 parent 1ca3828 commit 6240527

File tree

5 files changed

+34
-124
lines changed

5 files changed

+34
-124
lines changed

changelog.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<meta name="generator" content="Docutils 0.20.1: https://docutils.sourceforge.io/" />
5+
<meta name="generator" content="Docutils 0.21.2: https://docutils.sourceforge.io/" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<title>Changelog for DBUtils</title>
88
<link rel="stylesheet" href="doc.css" type="text/css" />

doc.css

Lines changed: 16 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,13 @@
11
/*
2-
Webware for Python (https://webwareforpython.github.io/w4py/)
3-
4-
Common style sheet for Webware's documentation pages
2+
Style sheet for DBUtils documentation pages.
53
*/
64

75
/* First import default style for pages created with Docutils: */
86

97
@import url(docutils.css);
108

11-
/* Customization for Webware goes here: */
9+
/* Customization for DBUtils goes here: */
1210

13-
body {
14-
background-color: #FFFFFF;
15-
font-family: Verdana, Arial, Helvetica, sans-serif;
16-
font-size: 10pt;
17-
padding: 12pt;
18-
}
19-
table {
20-
empty-cells: show;
21-
border-collapse: collapse;
22-
margin: 0 auto;
23-
}
24-
table.doc {
25-
border-spacing: 2px;
26-
border-collapse: separate;
27-
border-style: none;
28-
}
29-
td, th {
30-
font-family: Verdana, Arial, Helvetica, sans-serif;
31-
font-size: 10pt;
32-
}
33-
table.doc td, table.doc th {
34-
padding: 4px;
35-
border-style: none;
36-
}
3711
p {
3812
margin-top: 6pt;
3913
margin-bottom: 6pt;
@@ -43,11 +17,9 @@ li {
4317
margin-bottom: 6pt;
4418
}
4519
h1, h2 {
46-
font-family: Verdana, Arial, Helvetica, sans-serif;
4720
color: #002352;
4821
}
4922
h3, h4 {
50-
font-family: Verdana, Arial, Helvetica, sans-serif;
5123
color: #002352;
5224
}
5325
h1 {
@@ -59,119 +31,45 @@ h2 {
5931
h3 {
6032
font-size: 14pt;
6133
}
62-
h4 {
63-
font-size: 12pt;
64-
}
65-
h5 {
66-
font-size: 11pt;
67-
}
68-
h6 {
69-
font-size: 10pt;
70-
}
71-
h1.titlebar {
72-
padding: 4pt;
73-
margin-bottom: 12pt;
74-
text-align: center;
75-
color: white;
76-
background-color: #025;
77-
}
78-
h1.title, h1.header {
34+
h1.title {
7935
padding: 4pt;
8036
margin-bottom: 12pt;
8137
text-align: center;
8238
border-bottom: 1pt solid #025;
8339
padding-bottom: 8pt;
8440
}
85-
div.footer {
86-
font-family: Tahoma, Arial, Helvetica, sans-serif;
87-
font-size: 9pt;
88-
text-align: center;
89-
padding: 4pt;
90-
margin-top: 16pt;
91-
border-top: 1pt solid #025;
92-
}
93-
.left {
94-
text-align: left;
95-
}
96-
.right {
97-
text-align: right;
98-
}
99-
.center {
100-
text-align: center;
101-
}
102-
.top {
103-
vertical-align: top;
104-
}
105-
.nowrap {
106-
white-space: nowrap;
107-
}
108-
.contents {
109-
font-family: Tahoma, Arial, Helvetica, sans-serif;
110-
}
11141
.contents ul {
11242
list-style: none;
11343
margin-bottom: 24pt;
11444
padding-left: 0em;
11545
margin-left: 2em;
11646
}
11747
.contents ul li {
118-
font-size: 11pt;
119-
margin-bottom: 3pt;
48+
font-size: 14pt;
49+
margin-bottom: 2pt;
12050
}
12151
.contents ul ul {
12252
list-style-type: none;
123-
margin-top: 2pt;
124-
margin-bottom: 2pt;
53+
margin-top: 1pt;
54+
margin-bottom: 1pt;
12555
padding-left: 0em;
12656
margin-left: 1.5em;
12757
}
12858
.contents ul ul li {
129-
font-size: 10pt;
59+
font-size: 13pt;
13060
margin-bottom: 1pt;
13161
}
132-
.contents .topic-title {
133-
font-size: 16pt;
134-
}
135-
span.name {
136-
font-weight: bold;
137-
}
138-
span.filename {
139-
font-family: Tahoma, Arial, Helvetica, sans-serif;
140-
font-size: 9pt;
141-
}
142-
code, .literal, .literal-block, .pre, .py {
143-
font-family: "Andale Mono", "Lucida Console", Monaco, "Courier New", Courier, monospace;
144-
font-size: 10pt;
145-
color: #052;
146-
}
147-
tt.literal, span.pre {
148-
background-color: #FFFFFF;
149-
}
150-
pre.py, pre.literal-block {
151-
margin: 0;
152-
padding: 2pt 1pt 1pt 2pt;
153-
background-color: #F0F0F8;
154-
}
155-
.typed {
156-
font-weight: bold;
157-
}
158-
.error {
159-
color: red;
62+
.contents > p.topic-title {
63+
font-size: 24pt;
16064
}
16165
.warning {
16266
color: brown;
16367
}
164-
165-
/* Configuration documentation: */
166-
167-
dl.config {
168-
}
169-
dt.config {
170-
}
171-
dd.config {
68+
.admonition-title {
69+
background-color: #F5F5DC;
70+
padding: 1pt 3pt;
17271
}
173-
span.setting {
174-
font-family: Tahoma, Arial, Helvetica, sans-serif;
175-
font-size: 9pt;
176-
font-weight: bold;
72+
.admonition-title::before {
73+
content: "⚠";
74+
margin-right: .5em;
17775
}

docutils.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

main.de.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
33
<head>
44
<meta charset="utf-8" />
5-
<meta name="generator" content="Docutils 0.20.1: https://docutils.sourceforge.io/" />
5+
<meta name="generator" content="Docutils 0.21.2: https://docutils.sourceforge.io/" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<title>Benutzeranleitung für DBUtils</title>
88
<link rel="stylesheet" href="doc.css" type="text/css" />
@@ -321,11 +321,14 @@ <h3>PersistentDB (persistent_db)</h3>
321321
Stattdessen wird die Verbindung automatisch dann geschlossen, wenn der Thread
322322
endet. Sie können dieses Verhalten ändern, indem Sie den Parameter namens
323323
<span class="docutils literal">closeable</span> setzen.</p>
324+
<aside class="admonition warning">
325+
<p class="admonition-title">Warnung</p>
324326
<p>Bitte beachten Sie, dass Transaktionen explizit durch Aufruf der Methode
325327
<span class="docutils literal">begin()</span> eingeleitet werden müssen. Hierdurch wird sichergestellt, dass
326328
das transparente Neueröffnen von Verbindungen bis zum Ende der Transaktion
327329
ausgesetzt wird, und dass die Verbindung zurückgerollt wird, before sie vom
328330
gleichen Thread erneut benutzt wird.</p>
331+
</aside>
329332
<p>Das Holen einer Verbindung kann etwas beschleunigt werden, indem man den
330333
Parameter <span class="docutils literal">threadlocal</span> auf <span class="docutils literal">threading.local</span> setzt; dies könnte aber in
331334
einigen Umgebungen nicht funktionieren (es ist zum Beispiel bekannt, dass
@@ -428,12 +431,15 @@ <h3>PooledDB (pooled_db)</h3>
428431
with db.cursor() as cur:
429432
cur.execute(...)
430433
res = cur.fetchone()</pre>
434+
<aside class="admonition warning">
435+
<p class="admonition-title">Warnung</p>
431436
<p>Bitte beachten Sie, dass Transaktionen explizit durch Aufruf der Methode
432437
<span class="docutils literal">begin()</span> eingeleitet werden müssen. Hierdurch wird sichergestellt,
433438
dass die Verbindung nicht mehr mit anderen Threads geteilt wird, dass das
434439
transparente Neueröffnen von Verbindungen bis zum Ende der Transaktion
435440
ausgesetzt wird, und dass die Verbindung zurückgerollt wird, bevor sie
436441
wieder an den Verbindungspool zurückgegeben wird.</p>
442+
</aside>
437443
</section>
438444
</section>
439445
<section id="besonderheiten-bei-der-benutzung">

main.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<meta name="generator" content="Docutils 0.20.1: https://docutils.sourceforge.io/" />
5+
<meta name="generator" content="Docutils 0.21.2: https://docutils.sourceforge.io/" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<title>DBUtils User's Guide</title>
88
<link rel="stylesheet" href="doc.css" type="text/css" />
@@ -298,10 +298,13 @@ <h3>PersistentDB (persistent_db)</h3>
298298
contrary to the intent of having persistent connections. Instead,
299299
the connection will be automatically closed when the thread dies.
300300
You can change this behavior by setting the <span class="docutils literal">closeable</span> parameter.</p>
301+
<aside class="admonition warning">
302+
<p class="admonition-title">Warning</p>
301303
<p>Note that you need to explicitly start transactions by calling the
302304
<span class="docutils literal">begin()</span> method. This ensures that the transparent reopening will be
303305
suspended until the end of the transaction, and that the connection
304306
will be rolled back before being reused by the same thread.</p>
307+
</aside>
305308
<p>By setting the <span class="docutils literal">threadlocal</span> parameter to <span class="docutils literal">threading.local</span>, getting
306309
connections may become a bit faster, but this may not work in all
307310
environments (for instance, <span class="docutils literal">mod_wsgi</span> is known to cause problems
@@ -374,7 +377,7 @@ <h3>PooledDB (pooled_db)</h3>
374377
<pre class="literal-block">db = pool.dedicated_connection()</pre>
375378
<p>If you don't need it anymore, you should immediately return it to the
376379
pool with <span class="docutils literal">db.close()</span>. You can get another connection in the same way.</p>
377-
<p><em>Warning:</em> In a threaded environment, never do the following:</p>
380+
<p>Warning: In a threaded environment, never do the following:</p>
378381
<pre class="literal-block">pool.connection().cursor().execute(...)</pre>
379382
<p>This would release the connection too early for reuse which may be fatal
380383
if the connections are not thread-safe. Make sure that the connection
@@ -390,11 +393,14 @@ <h3>PooledDB (pooled_db)</h3>
390393
with db.cursor() as cur:
391394
cur.execute(...)
392395
res = cur.fetchone()</pre>
396+
<aside class="admonition warning">
397+
<p class="admonition-title">Warning</p>
393398
<p>Note that you need to explicitly start transactions by calling the
394399
<span class="docutils literal">begin()</span> method. This ensures that the connection will not be shared
395400
with other threads, that the transparent reopening will be suspended
396401
until the end of the transaction, and that the connection will be rolled
397402
back before being given back to the connection pool.</p>
403+
</aside>
398404
</section>
399405
</section>
400406
<section id="advanced-usage">

0 commit comments

Comments
 (0)