Skip to content

Commit b87b113

Browse files
committed
Deploy eddee34 book-entwicklung-add-python-docs-..
1 parent f1459e7 commit b87b113

131 files changed

Lines changed: 2614 additions & 1074 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

@/xml.html

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

__hyperbook_assets/client.js

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,42 @@ var hyperbook = (function () {
230230
* @param {HTMLElement} el - The element to toggle.
231231
*/
232232
function toggleLightbox(el) {
233-
el.parentElement.classList.toggle("lightbox");
234-
el.parentElement.classList.toggle("normal");
233+
const overlay = document.createElement("div");
234+
overlay.classList.add("lightbox-overlay");
235+
236+
const captionText =
237+
el.parentElement.querySelector("figcaption")?.textContent || "";
238+
239+
// container for image + caption
240+
const content = document.createElement("div");
241+
content.classList.add("lightbox-content");
242+
243+
// image container fills remaining space
244+
const imgContainer = document.createElement("div");
245+
imgContainer.classList.add("lightbox-image-container");
246+
247+
const lightboxImg = document.createElement("img");
248+
lightboxImg.src = el.src;
249+
imgContainer.appendChild(lightboxImg);
250+
251+
content.appendChild(imgContainer);
252+
253+
// add caption if exists
254+
if (captionText) {
255+
const caption = document.createElement("div");
256+
caption.classList.add("caption");
257+
caption.textContent = captionText;
258+
content.appendChild(caption);
259+
}
260+
261+
overlay.appendChild(content);
262+
263+
overlay.addEventListener("click", () => {
264+
document.body.removeChild(overlay);
265+
});
266+
267+
document.body.appendChild(overlay);
268+
overlay.style.display = "flex";
235269
}
236270

237271
function init(root) {

__hyperbook_assets/content.css

Lines changed: 58 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ figure {
1313
color: var(--color-brand);
1414
}
1515

16+
.hyperbook-markdown hr {
17+
clear: both;
18+
border: none;
19+
}
20+
1621
/**
1722
* IE 8–11 and Prince don’t recognize the `wbr` element,
1823
* but a pseudo-element can achieve the same effect with IE 9+ and Prince.
@@ -27,27 +32,42 @@ figure {
2732
max-width: 100%;
2833
}
2934

30-
.hyperbook-markdown figure.lightbox {
31-
position: fixed;
32-
display: flex;
33-
justify-content: center;
34-
flex-direction: column;
35-
align-items: center;
36-
top: 0;
37-
left: 0;
38-
right: 0;
39-
bottom: 0;
40-
padding: 1em;
41-
z-index: 10000;
42-
margin: 0px;
43-
background: rgba(0, 0, 0, 0.5);
35+
.hyperbook-markdown figure.align-left {
36+
display: table;
37+
float: left;
38+
margin-right: 1.75rem;
39+
}
40+
41+
.hyperbook-markdown figure.align-right {
42+
display: table;
43+
float: right;
44+
margin-left: 1.75rem;
45+
}
46+
47+
.hyperbook-markdown figure.align-rightplus {
48+
display: table;
49+
float: right;
50+
margin-left: 1.75rem;
51+
margin-right: -1.5rem;
4452
}
4553

46-
.hyperbook-markdown figure.lightbox img {
47-
min-width: 100%;
48-
min-height: 100%;
49-
cursor: zoom-out;
50-
object-fit: contain;
54+
.hyperbook-markdown figure.align-leftplus {
55+
display: table;
56+
float: left;
57+
margin-right: 1.75rem;
58+
margin-left: -1.5rem;
59+
}
60+
61+
.hyperbook-markdown figure.align-centerplus {
62+
display: grid;
63+
justify-items: center;
64+
clear: both;
65+
margin-left: -1.5rem;
66+
margin-right: -1.5rem;
67+
68+
img {
69+
width: 100%;
70+
}
5171
}
5272

5373
.hyperbook-markdown table {
@@ -76,12 +96,16 @@ figure {
7696
}
7797

7898
.hyperbook-markdown figure.normal {
79-
text-align: center;
99+
display: grid;
100+
clear: both;
101+
justify-items: center;
102+
align-content: center;
80103
margin-top: 10px;
81104
margin-bottom: 10px;
82105
}
83106

84107
.hyperbook-markdown figure.normal img {
108+
display: inline-block;
85109
cursor: zoom-in;
86110
}
87111

@@ -148,11 +172,11 @@ figure {
148172
margin-bottom: 0;
149173
}
150174

151-
.hyperbook-markdown li + li {
175+
.hyperbook-markdown li+li {
152176
margin-top: 0.25em;
153177
}
154178

155-
.hyperbook-markdown li > p {
179+
.hyperbook-markdown li>p {
156180
margin-top: 16px;
157181
}
158182

@@ -226,6 +250,7 @@ figure {
226250
.hyperbook-markdown h4,
227251
.hyperbook-markdown h5,
228252
.hyperbook-markdown h6 {
253+
clear: both;
229254
font-family: hyperbook-heading, sans-serif;
230255
margin-top: 24px;
231256
margin-bottom: 16px;
@@ -305,10 +330,10 @@ figure {
305330
list-style-type: none;
306331
}
307332

308-
.hyperbook-markdown #toc-toggle > .bar1,
309-
.hyperbook-markdown #toc-toggle > .bar2,
310-
.hyperbook-markdown #toc-toggle > .bar3,
311-
.hyperbook-markdown #toc-toggle > .bar4 {
333+
.hyperbook-markdown #toc-toggle>.bar1,
334+
.hyperbook-markdown #toc-toggle>.bar2,
335+
.hyperbook-markdown #toc-toggle>.bar3,
336+
.hyperbook-markdown #toc-toggle>.bar4 {
312337
background-color: var(--color-text);
313338
}
314339

@@ -431,16 +456,16 @@ figure {
431456
height: 100%;
432457
}
433458

434-
.toc-drawer-content > nav {
459+
.toc-drawer-content>nav {
435460
padding: 20px;
436461
flex: 1;
437462
}
438463

439-
.toc-drawer-content > nav li a {
464+
.toc-drawer-content>nav li a {
440465
display: block;
441466
}
442467

443-
.toc-drawer-content > nav li a:hover {
468+
.toc-drawer-content>nav li a:hover {
444469
text-decoration: underline;
445470
}
446471

@@ -547,16 +572,16 @@ figure {
547572
opacity: 1;
548573
}
549574

550-
.hyperbook-markdown #toc-toggle > .bar1,
551-
.hyperbook-markdown #toc-toggle > .bar3 {
575+
.hyperbook-markdown #toc-toggle>.bar1,
576+
.hyperbook-markdown #toc-toggle>.bar3 {
552577
width: 20px;
553578
height: 2px;
554579
margin: 2px 3px;
555580
transition: 0.4s;
556581
}
557582

558-
.hyperbook-markdown #toc-toggle > .bar2,
559-
.hyperbook-markdown #toc-toggle > .bar4 {
583+
.hyperbook-markdown #toc-toggle>.bar2,
584+
.hyperbook-markdown #toc-toggle>.bar4 {
560585
width: 25px;
561586
height: 2px;
562587
margin: 2px 3px;
Lines changed: 34 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
:root {
2+
--alert-color: var(--color-nav-border);
3+
--alert-content: "";
4+
}
5+
16
.directive-alert>p {
27
margin-bottom: 0;
38
}
49

510
.directive-alert {
11+
display: flow-root;
612
letter-spacing: 0;
713
box-sizing: border-box;
814
font-size: inherit;
@@ -15,97 +21,54 @@
1521
position: relative;
1622
border-left-width: 4px;
1723
border-left-style: solid;
24+
background-color: var(--color-nav);
25+
border-left-color: var(--alert-color);
26+
border-left-style: solid;
27+
border-left-width: 4px;
28+
29+
a,
30+
strong {
31+
color: var(--alert-color);
32+
}
33+
34+
:first-child {
35+
margin-top: 0;
36+
}
1837
}
1938

20-
.directive-alert::before {
39+
.directive-alert.icon::before {
2140
border-radius: 100%;
2241
font-size: 14px;
2342
font-weight: 700;
24-
left: -12px;
25-
line-height: 20px;
43+
left: -14px;
2644
display: flex;
2745
align-items: center;
2846
justify-content: center;
2947
position: absolute;
30-
height: 20px;
31-
width: 20px;
32-
text-align: center;
33-
top: 12px;
34-
}
35-
36-
.directive-alert.success {
37-
border-left-style: solid;
38-
border-left-width: 4px;
39-
}
40-
41-
.directive-alert.success::before {
42-
content: "✓";
43-
}
44-
45-
.directive-alert.info {
46-
border-left-style: solid;
47-
border-left-width: 4px;
48-
}
49-
50-
.directive-alert.info::before {
51-
content: "i";
52-
}
53-
54-
.directive-alert.warn {
55-
border-left-style: solid;
56-
border-left-width: 4px;
57-
}
58-
59-
.directive-alert.warn::before {
60-
content: "!";
61-
}
62-
63-
.directive-alert.error {
64-
border-left-style: solid;
65-
border-left-width: 4px;
66-
}
67-
68-
.directive-alert.error::before {
69-
content: "x";
70-
}
71-
72-
.directive-alert {
73-
background-color: var(--color-nav);
74-
border-left-color: var(--color-nav-border);
75-
}
76-
77-
.directive-alert::before {
48+
height: 24px;
49+
width: 24px;
50+
top: 8px;
7851
color: #fff;
52+
content: var(--alert-content);
53+
background-color: var(--alert-color);
7954
}
8055

8156
.directive-alert.success {
82-
border-left-color: #00c851;
83-
}
84-
85-
.directive-alert.success::before {
86-
background-color: #00c851;
57+
--alert-color: #00c851;
58+
--alert-content: "✓";
8759
}
8860

8961
.directive-alert.info {
90-
border-left-color: #33b5e5;
91-
}
92-
93-
.directive-alert.info::before {
94-
background-color: #33b5e5;
62+
--alert-color: #33b5e5;
63+
--alert-content: "i";
9564
}
9665

9766
.directive-alert.warn {
98-
border-left-color: #f0b429;
99-
}
100-
101-
.directive-alert.warn::before {
102-
background-color: #f0b429;
67+
--alert-color: #f0b429;
68+
--alert-content: "!";
10369
}
10470

10571
.directive-alert.error {
106-
border-left-color: #ef4e4e;
107-
}
108-
109-
.directive-alert.error::before {
110-
background-color: #ef4e4e;
72+
--alert-color: #ef4e4e;
73+
--alert-content: "x";
11174
}

__hyperbook_assets/search.js

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

0 commit comments

Comments
 (0)