Added course's notes

This commit is contained in:
MatsuneMikuroi committed 2026-09-25 13:33:30 +02:00
1 parent e07993262c
commit dcd2c072ae
191 files changed
+42866 -12

No files matched your search

File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
Binary file not shown.
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
Binary file not shown.
+156
View File
@@ -0,0 +1,156 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 230" width="760" height="230"
role="img" aria-labelledby="dc-title">
<title id="dc-title">Die prozedurale Fassung: in einem einzigen main() wird IO.readln() aufgerufen, dessen Ergebnis an rot13() übergeben und dieses Ergebnis an IO.println(). Ein Thread, ein Prozess, drei direkte Aufrufe.</title>
<style><![CDATA[
/* figures/diagram.css -- shared look of every built figure.
*
* build-figures.py drops this file into the style element of every built
* svg, so a figure carries its own styling and stays self-contained.
* Classes, not per-element fills, do the work: one edit here restyles the
* whole book.
*
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
*
* Dark theme: the @media block follows the reader's system setting. librsvg
* ignores media queries when it makes the pdf, so print always gets the light
* theme -- which is what a printed page wants.
*/
svg {
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
/* the figure sits on the page, not on a white card of its own */
background: transparent;
}
/* ---- surfaces ------------------------------------------------------- */
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
/* ---- lines ---------------------------------------------------------- */
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
.rule { stroke: #dae0e8; stroke-width: 1; }
/* ---- text ----------------------------------------------------------- */
.t { fill: #1b2430; font-size: 13px; }
.t-sm { fill: #1b2430; font-size: 11px; }
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
.t-mut { fill: #5a6879; font-size: 11px; }
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
.t-mono { fill: #1b2430; font-size: 11.5px;
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
.mid { text-anchor: middle; }
.end { text-anchor: end; }
/* ---- interaction ====================================================
* A .node groups one box with its labels. Hovering it lifts the whole group
* a little, which is enough to follow a path through a busy diagram without
* any script. Pointer events stay off the decorative layers so the hover
* target is the shape itself.
*/
.node { transition: opacity .12s ease; }
.node:hover .box,
.node:hover .box-accent,
.node:hover .diamond { stroke-width: 2.6; }
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
svg:hover .node:not(:hover) { opacity: .55; }
/* a figure that marks no nodes must not dim on hover */
svg:not(:has(.node)) .node { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
.node { transition: none; }
}
/* ---- dark theme ------------------------------------------------------ */
@media (prefers-color-scheme: dark) {
.box { fill: #1d2b33; stroke: #4c9aa5; }
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
.box-accent { fill: #24363d; stroke: #4c9aa5; }
.box-warn { fill: #332a18; stroke: #c99a3a; }
.box-plain { fill: #161b22; stroke: #30363d; }
.diamond { fill: #24363d; stroke: #4c9aa5; }
.ellipse { fill: #161b22; stroke: #8b98a8; }
.edge { stroke: #8b98a8; }
.edge-strong{ stroke: #4c9aa5; }
.edge-warn { stroke: #c99a3a; }
.edge-dash { stroke: #8b98a8; }
.rule { stroke: #30363d; }
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
.t-mut { fill: #8b98a8; }
.t-accent { fill: #4c9aa5; }
.t-warn { fill: #c99a3a; }
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
.arrow { fill: #8b98a8; }
.arrow-strong { fill: #4c9aa5; }
.arrow-warn { fill: #c99a3a; }
}
/* ---- arrowheads ======================================================
* marker contents cannot inherit the referencing element's fill, so each
* arrowhead is its own class and is themed alongside the line it ends.
*/
.arrow { fill: #5a6879; }
.arrow-strong { fill: #20666f; }
.arrow-warn { fill: #8a5a08; }
]]></style>
<defs>
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
</marker>
</defs>
<!-- everything happens inside one main(), on one thread -->
<rect class="box-plain" x="14" y="16" width="732" height="126" rx="4"/>
<text class="t-mut" data-label="frame" x="26" y="36">ein Prozess · ein Thread · ein main()</text>
<g class="node" data-flow-node="read">
<rect class="box" x="40" y="58" width="170" height="52" rx="3"/>
<text class="t-mono mid" data-label="read" x="125" y="90">IO.readln()</text>
</g>
<path class="edge" data-flow="1" data-flow-to="rot" d="M210,84 H298" marker-end="url(#a)"/>
<text class="t-accent mid" data-label="call1" x="254" y="72">Aufruf</text>
<g class="node" data-flow-node="rot">
<rect class="box" x="300" y="58" width="170" height="52" rx="3"/>
<text class="t-mono mid" data-label="rot" x="385" y="90">rot13(text)</text>
</g>
<path class="edge" data-flow="2" data-flow-to="print" d="M470,84 H558" marker-end="url(#a)"/>
<text class="t-accent mid" data-label="call2" x="514" y="72">Aufruf</text>
<g class="node" data-flow-node="print">
<rect class="box" x="560" y="58" width="170" height="52" rx="3"/>
<text class="t-mono mid" data-label="print" x="645" y="90">IO.println(…)</text>
</g>
<!-- who knows whom -->
<text class="t-sm" data-label="knows" x="14" y="176">main() kennt alle drei: ihre Namen, Argument- und Ergebnistypen und dass sie sofort verfügbar sind.</text>
<text class="t-mut" data-label="cost" x="14" y="202">Die Verdrahtung steht im Code selbst — Schritt 1 des Tutorials.</text>
</svg>

After

Width:  |  Height:  |  Size: 6.5 KiB

@@ -0,0 +1,213 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 700" width="620" height="700"
role="img" aria-labelledby="fp-title">
<title id="fp-title">Dieselbe Kette als fünf getrennte Prozesse auf einem Rechner: SensorService veröffentlicht eine .msg-Datei in consoleIn/outbox, ein Mediator-Prozess beobachtet dieses Verzeichnis und veröffentlicht eine Kopie in rot13/inbox, ProcessorService veröffentlicht sein Ergebnis in rot13/outbox, ein zweiter Mediator-Prozess verschiebt es nach consoleOut/inbox, und ActuatorService gibt es aus. Die vier Verzeichnisse bilden das Nachrichtenbrett auf einem lokalen Dateisystem.</title>
<style><![CDATA[
/* figures/diagram.css -- shared look of every built figure.
*
* build-figures.py drops this file into the style element of every built
* svg, so a figure carries its own styling and stays self-contained.
* Classes, not per-element fills, do the work: one edit here restyles the
* whole book.
*
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
*
* Dark theme: the @media block follows the reader's system setting. librsvg
* ignores media queries when it makes the pdf, so print always gets the light
* theme -- which is what a printed page wants.
*/
svg {
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
/* the figure sits on the page, not on a white card of its own */
background: transparent;
}
/* ---- surfaces ------------------------------------------------------- */
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
/* ---- lines ---------------------------------------------------------- */
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
.rule { stroke: #dae0e8; stroke-width: 1; }
/* ---- text ----------------------------------------------------------- */
.t { fill: #1b2430; font-size: 13px; }
.t-sm { fill: #1b2430; font-size: 11px; }
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
.t-mut { fill: #5a6879; font-size: 11px; }
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
.t-mono { fill: #1b2430; font-size: 11.5px;
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
.mid { text-anchor: middle; }
.end { text-anchor: end; }
/* ---- interaction ====================================================
* A .node groups one box with its labels. Hovering it lifts the whole group
* a little, which is enough to follow a path through a busy diagram without
* any script. Pointer events stay off the decorative layers so the hover
* target is the shape itself.
*/
.node { transition: opacity .12s ease; }
.node:hover .box,
.node:hover .box-accent,
.node:hover .diamond { stroke-width: 2.6; }
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
svg:hover .node:not(:hover) { opacity: .55; }
/* a figure that marks no nodes must not dim on hover */
svg:not(:has(.node)) .node { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
.node { transition: none; }
}
/* ---- dark theme ------------------------------------------------------ */
@media (prefers-color-scheme: dark) {
.box { fill: #1d2b33; stroke: #4c9aa5; }
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
.box-accent { fill: #24363d; stroke: #4c9aa5; }
.box-warn { fill: #332a18; stroke: #c99a3a; }
.box-plain { fill: #161b22; stroke: #30363d; }
.diamond { fill: #24363d; stroke: #4c9aa5; }
.ellipse { fill: #161b22; stroke: #8b98a8; }
.edge { stroke: #8b98a8; }
.edge-strong{ stroke: #4c9aa5; }
.edge-warn { stroke: #c99a3a; }
.edge-dash { stroke: #8b98a8; }
.rule { stroke: #30363d; }
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
.t-mut { fill: #8b98a8; }
.t-accent { fill: #4c9aa5; }
.t-warn { fill: #c99a3a; }
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
.arrow { fill: #8b98a8; }
.arrow-strong { fill: #4c9aa5; }
.arrow-warn { fill: #c99a3a; }
}
/* ---- arrowheads ======================================================
* marker contents cannot inherit the referencing element's fill, so each
* arrowhead is its own class and is themed alongside the line it ends.
*/
.arrow { fill: #5a6879; }
.arrow-strong { fill: #20666f; }
.arrow-warn { fill: #8a5a08; }
]]>
[data-label="mediator1"] { font-size: 11px; }
[data-label="mediator2"] { font-size: 11px; }</style>
<defs>
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
</marker>
</defs>
<!-- 1. SensorService (terminal 1) ==================================== -->
<g class="node" data-flow-node="sensor">
<rect class="box" x="120" y="24" width="300" height="46" rx="3"/>
<text class="t-lead mid" data-label="sensor" x="270" y="46">SensorService — ConsoleIn</text>
<text class="t-mut mid" data-label="t1" x="270" y="62">Terminal 1</text>
</g>
<path class="edge" data-flow="1" data-flow-to="outbox1" d="M270,70 V96" marker-end="url(#a)"/>
<text class="t-accent" data-label="publish1" x="286" y="88">veröffentlichen (.tmp → .msg)</text>
<!-- 2. consoleIn/outbox ============================================= -->
<g class="node" data-flow-node="outbox1">
<rect class="box-plain" x="120" y="98" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="126">consoleIn/outbox/*.msg</text>
</g>
<path class="edge" data-flow="2" data-flow-to="mediator1" d="M270,142 V168" marker-end="url(#a)"/>
<text class="t-accent" data-label="watch1" x="286" y="160">WatchService</text>
<!-- 3. first mediator process (terminal 2) =========================== -->
<g class="node" data-flow-node="mediator1">
<rect class="box-accent" x="120" y="170" width="300" height="46" rx="3"/>
<text class="t-lead mid" data-label="mediator1" x="270" y="192">Mediator.java consoleIn/outbox rot13/inbox</text>
<text class="t-mut mid" data-label="t2" x="270" y="208">Terminal 2</text>
</g>
<path class="edge" data-flow="3" data-flow-to="inbox2" d="M270,216 V242" marker-end="url(#a)"/>
<text class="t-accent" data-label="publish2" x="286" y="234">veröffentlichen</text>
<!-- 4. rot13/inbox =================================================== -->
<g class="node" data-flow-node="inbox2">
<rect class="box-plain" x="120" y="244" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="272">rot13/inbox/*.msg</text>
</g>
<path class="edge" data-flow="4" data-flow-to="processor" d="M270,288 V314" marker-end="url(#a)"/>
<text class="t-accent" data-label="watch2" x="286" y="306">WatchService</text>
<!-- 5. ProcessorService (terminal 3) ================================= -->
<g class="node" data-flow-node="processor">
<rect class="box" x="120" y="316" width="300" height="46" rx="3"/>
<text class="t-lead mid" data-label="processor" x="270" y="338">ProcessorService — ROT13</text>
<text class="t-mut mid" data-label="t3" x="270" y="354">Terminal 3</text>
</g>
<path class="edge" data-flow="5" data-flow-to="outbox2" d="M270,362 V388" marker-end="url(#a)"/>
<text class="t-accent" data-label="publish3" x="286" y="380">veröffentlichen</text>
<!-- 6. rot13/outbox ================================================== -->
<g class="node" data-flow-node="outbox2">
<rect class="box-plain" x="120" y="390" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="418">rot13/outbox/*.msg</text>
</g>
<path class="edge" data-flow="6" data-flow-to="mediator2" d="M270,434 V460" marker-end="url(#a)"/>
<text class="t-accent" data-label="watch3" x="286" y="452">WatchService</text>
<!-- 7. second mediator process (terminal 4) ========================== -->
<g class="node" data-flow-node="mediator2">
<rect class="box-accent" x="120" y="462" width="300" height="46" rx="3"/>
<text class="t-lead mid" data-label="mediator2" x="270" y="484">Mediator.java rot13/outbox consoleOut/inbox</text>
<text class="t-mut mid" data-label="t4" x="270" y="500">Terminal 4</text>
</g>
<path class="edge" data-flow="7" data-flow-to="inbox3" d="M270,508 V534" marker-end="url(#a)"/>
<text class="t-accent" data-label="publish4" x="286" y="526">veröffentlichen</text>
<!-- 8. consoleOut/inbox ============================================== -->
<g class="node" data-flow-node="inbox3">
<rect class="box-plain" x="120" y="536" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="564">consoleOut/inbox/*.msg</text>
</g>
<path class="edge" data-flow="8" data-flow-to="actuator" d="M270,580 V606" marker-end="url(#a)"/>
<text class="t-accent" data-label="watch4" x="286" y="598">WatchService</text>
<!-- 9. ActuatorService (terminal 5) ================================== -->
<g class="node" data-flow-node="actuator">
<rect class="box" x="120" y="608" width="300" height="46" rx="3"/>
<text class="t-lead mid" data-label="actuator" x="270" y="630">ActuatorService — ConsoleOut</text>
<text class="t-mut mid" data-label="t5" x="270" y="646">Terminal 5</text>
</g>
<!-- the four directories belong to one message board on one filesystem -->
<path class="edge-dash" d="M436,98 H452 V580 H436"/>
<text class="t-mono" x="460" y="330">messageBoard/</text>
<text class="t-mut" data-label="board" x="460" y="348">Verzeichnis = Postfach, Datei = Nachricht</text>
<!-- the five processes are started by hand, one terminal each -->
<path class="edge-dash" d="M104,24 H88 V654 H104"/>
<text class="t-warn" data-label="topology" x="14" y="686">Fünf von Hand gestartete Prozesse. Die Topologie steckt nun in den zwei Mediator-Befehlszeilen — bei dem, der sie getippt hat.</text>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

+206
View File
@@ -0,0 +1,206 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 700" width="560" height="700"
role="img" aria-labelledby="mj-title">
<title id="mj-title">Die vermittelte Fassung in einer JVM: ConsoleIn legt eine Nachricht in consoleIn.outbox, ein Vermittler nimmt sie und legt sie in rot13.inbox, ROT13 nimmt sie und legt sein Ergebnis in rot13.outbox, ein zweiter Vermittler verschiebt es nach consoleOut.inbox, und ConsoleOut nimmt es und gibt es aus.</title>
<style><![CDATA[
/* figures/diagram.css -- shared look of every built figure.
*
* build-figures.py drops this file into the style element of every built
* svg, so a figure carries its own styling and stays self-contained.
* Classes, not per-element fills, do the work: one edit here restyles the
* whole book.
*
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
*
* Dark theme: the @media block follows the reader's system setting. librsvg
* ignores media queries when it makes the pdf, so print always gets the light
* theme -- which is what a printed page wants.
*/
svg {
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
/* the figure sits on the page, not on a white card of its own */
background: transparent;
}
/* ---- surfaces ------------------------------------------------------- */
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
/* ---- lines ---------------------------------------------------------- */
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
.rule { stroke: #dae0e8; stroke-width: 1; }
/* ---- text ----------------------------------------------------------- */
.t { fill: #1b2430; font-size: 13px; }
.t-sm { fill: #1b2430; font-size: 11px; }
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
.t-mut { fill: #5a6879; font-size: 11px; }
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
.t-mono { fill: #1b2430; font-size: 11.5px;
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
.mid { text-anchor: middle; }
.end { text-anchor: end; }
/* ---- interaction ====================================================
* A .node groups one box with its labels. Hovering it lifts the whole group
* a little, which is enough to follow a path through a busy diagram without
* any script. Pointer events stay off the decorative layers so the hover
* target is the shape itself.
*/
.node { transition: opacity .12s ease; }
.node:hover .box,
.node:hover .box-accent,
.node:hover .diamond { stroke-width: 2.6; }
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
svg:hover .node:not(:hover) { opacity: .55; }
/* a figure that marks no nodes must not dim on hover */
svg:not(:has(.node)) .node { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
.node { transition: none; }
}
/* ---- dark theme ------------------------------------------------------ */
@media (prefers-color-scheme: dark) {
.box { fill: #1d2b33; stroke: #4c9aa5; }
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
.box-accent { fill: #24363d; stroke: #4c9aa5; }
.box-warn { fill: #332a18; stroke: #c99a3a; }
.box-plain { fill: #161b22; stroke: #30363d; }
.diamond { fill: #24363d; stroke: #4c9aa5; }
.ellipse { fill: #161b22; stroke: #8b98a8; }
.edge { stroke: #8b98a8; }
.edge-strong{ stroke: #4c9aa5; }
.edge-warn { stroke: #c99a3a; }
.edge-dash { stroke: #8b98a8; }
.rule { stroke: #30363d; }
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
.t-mut { fill: #8b98a8; }
.t-accent { fill: #4c9aa5; }
.t-warn { fill: #c99a3a; }
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
.arrow { fill: #8b98a8; }
.arrow-strong { fill: #4c9aa5; }
.arrow-warn { fill: #c99a3a; }
}
/* ---- arrowheads ======================================================
* marker contents cannot inherit the referencing element's fill, so each
* arrowhead is its own class and is themed alongside the line it ends.
*/
.arrow { fill: #5a6879; }
.arrow-strong { fill: #20666f; }
.arrow-warn { fill: #8a5a08; }
]]></style>
<defs>
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
</marker>
</defs>
<!-- one JVM, five virtual threads: the frame the whole chain lives in -->
<rect class="box-plain" x="10" y="10" width="540" height="676" rx="4"/>
<text class="t-mut" data-label="frame" x="22" y="30">eine JVM · fünf virtuelle Threads · BlockingQueue-Postfächer</text>
<!-- 1. ConsoleIn ==================================================== -->
<g class="node" data-flow-node="consolein">
<rect class="box" x="120" y="44" width="300" height="44" rx="3"/>
<text class="t-lead mid" data-label="consolein" x="270" y="72">ConsoleIn — „ich lese“</text>
</g>
<path class="edge" data-flow="1" data-flow-to="outbox1" d="M270,88 V114" marker-end="url(#a)"/>
<text class="t-accent" data-label="put1" x="286" y="106">put</text>
<!-- 2. consoleIn.outbox ============================================= -->
<g class="node" data-flow-node="outbox1">
<rect class="box-plain" x="120" y="116" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="144">consoleIn.outbox</text>
</g>
<path class="edge" data-flow="2" data-flow-to="mediator1" d="M270,160 V186" marker-end="url(#a)"/>
<text class="t-accent" data-label="take1" x="286" y="178">take</text>
<!-- 3. first mediator =============================================== -->
<g class="node" data-flow-node="mediator1">
<rect class="box-accent" x="120" y="188" width="300" height="44" rx="3"/>
<text class="t-lead mid" data-label="mediator1" x="270" y="211">Vermittler</text>
<text class="t-mut mid" data-label="route1" x="270" y="226">consoleIn.outbox → rot13.inbox</text>
</g>
<path class="edge" data-flow="3" data-flow-to="inbox2" d="M270,232 V258" marker-end="url(#a)"/>
<text class="t-accent" data-label="put2" x="286" y="250">put</text>
<!-- 4. rot13.inbox =================================================== -->
<g class="node" data-flow-node="inbox2">
<rect class="box-plain" x="120" y="260" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="288">rot13.inbox</text>
</g>
<path class="edge" data-flow="4" data-flow-to="rot13" d="M270,304 V330" marker-end="url(#a)"/>
<text class="t-accent" data-label="take2" x="286" y="322">take</text>
<!-- 5. ROT13 ========================================================= -->
<g class="node" data-flow-node="rot13">
<rect class="box" x="120" y="332" width="300" height="44" rx="3"/>
<text class="t-lead mid" data-label="rot13" x="270" y="360">ROT13 — „ich rotiere“</text>
</g>
<path class="edge" data-flow="5" data-flow-to="outbox2" d="M270,376 V402" marker-end="url(#a)"/>
<text class="t-accent" data-label="put3" x="286" y="394">put</text>
<!-- 6. rot13.outbox ================================================== -->
<g class="node" data-flow-node="outbox2">
<rect class="box-plain" x="120" y="404" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="432">rot13.outbox</text>
</g>
<path class="edge" data-flow="6" data-flow-to="mediator2" d="M270,448 V474" marker-end="url(#a)"/>
<text class="t-accent" data-label="take3" x="286" y="466">take</text>
<!-- 7. second mediator =============================================== -->
<g class="node" data-flow-node="mediator2">
<rect class="box-accent" x="120" y="476" width="300" height="44" rx="3"/>
<text class="t-lead mid" data-label="mediator2" x="270" y="499">Vermittler</text>
<text class="t-mut mid" data-label="route2" x="270" y="514">rot13.outbox → consoleOut.inbox</text>
</g>
<path class="edge" data-flow="7" data-flow-to="inbox3" d="M270,520 V546" marker-end="url(#a)"/>
<text class="t-accent" data-label="put4" x="286" y="538">put</text>
<!-- 8. consoleOut.inbox ============================================== -->
<g class="node" data-flow-node="inbox3">
<rect class="box-plain" x="120" y="548" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="576">consoleOut.inbox</text>
</g>
<path class="edge" data-flow="8" data-flow-to="consoleout" d="M270,592 V618" marker-end="url(#a)"/>
<text class="t-accent" data-label="take4" x="286" y="610">take</text>
<!-- 9. ConsoleOut ==================================================== -->
<g class="node" data-flow-node="consoleout">
<rect class="box" x="120" y="620" width="300" height="44" rx="3"/>
<text class="t-lead mid" data-label="consoleout" x="270" y="648">ConsoleOut — „ich gebe aus“</text>
</g>
<!-- side note: who holds the topology -->
<text class="t-warn" data-label="topology" x="22" y="672">Keine Fähigkeit nennt eine andere. Die Topologie steckt nur in den zwei Vermittlern, gestartet in main().</text>
</svg>

After

Width:  |  Height:  |  Size: 9.7 KiB

+1066
View File
File diff suppressed because it is too large. Load diff
+222
View File
@@ -0,0 +1,222 @@
[
{
"objectID": "index.html",
"href": "index.html",
"title": "Vom Aufruf zum Ereignis",
"section": "",
"text": "Über diese Notizen\nDiese Notizen fassen das Tutorial „SIN.04028 — From Calling to Eventing“ zusammen, Schritt für Schritt durchgearbeitet. Das Tutorial selbst liegt neben diesem Buch, in SIN.04028-From-Calling-to-Eventing/README.md, und gehört zur Vorlesung Process Control von Reto Konig an der Universität Freiburg (Herbstsemester 2026).\nDas gebaute Programm ändert sich nie: Sie tippen eine Zeile, sie kommt um 13 Buchstaben verschoben zurück.\nWas sich ändert, ist alles ringsherum. Das Tutorial baut dasselbe System immer wieder neu und stellt dabei drei Fragen, in dieser Reihenfolge:\nJedes Mal, wenn ein Schritt fertig ist, kommt hier eine Zusammenfassung hinzu; das Buch wächst also im Tempo der Arbeit. Jede Zusammenfassung sagt, was der Schritt getan hat, was beim Ausführen beobachtet wurde und was sich architektonisch verschoben hat — meist ein Stück Wissen, das den Besitzer gewechselt hat.",
"crumbs": [
"[About these notes]{.en}[À propos de ces notes]{.fr}[Über diese Notizen]{.de}"
]
},
{
"objectID": "index.html#sec-diagrams",
"href": "index.html#sec-diagrams",
"title": "Vom Aufruf zum Ereignis",
"section": "Wie die Abbildungen zu lesen sind",
"text": "Wie die Abbildungen zu lesen sind\nJede Abbildung existiert einmal als Zeichnung und dreimal als Sprache. In der Webfassung hat eine Abbildung mit Nachrichtenfluss eine kleine Leiste darunter: Abspielen schickt eine Nachricht durch die ganze Kette, Ein Sprung rückt einen einzigen Schritt vor, Zurücksetzen stellt alles zurück. Kästen leuchten auf, wenn die Nachricht sie erreicht; so ist zu sehen, welche Komponente wartet und welche arbeitet.\nIm PDF und in einem Browser ohne JavaScript ist dasselbe Bild da — nur unbewegt. Nichts in diesen Notizen hängt von der Animation ab.",
"crumbs": [
"[About these notes]{.en}[À propos de ces notes]{.fr}[Über diese Notizen]{.de}"
]
},
{
"objectID": "index.html#sec-build",
"href": "index.html#sec-build",
"title": "Vom Aufruf zum Ereignis",
"section": "Dieses Buch bauen",
"text": "Dieses Buch bauen\nDie drei Bücher entstehen aus einer einzigen Quelle:\n./render-all.sh # Abbildungen, dann html + pdf für en, fr, de\n./render-all.sh --serve # …und _book/ auf http://localhost:8000 ausliefern\n_book/ enthält das englische Buch, _book/fr/ das französische und _book/de/ das deutsche; das Sprachmenü in der Seitenleiste wechselt zwischen ihnen und merkt sich die Wahl. Ein einfaches quarto render baut nur Englisch und leert _book/, was die anderen zwei entfernt — also das Skript benutzen.",
"crumbs": [
"[About these notes]{.en}[À propos de ces notes]{.fr}[Über diese Notizen]{.de}"
]
},
{
"objectID": "00-orientation.html",
"href": "00-orientation.html",
"title": "1  Schritt 0 — Worum es im Tutorial geht",
"section": "",
"text": "1.1 Die drei Fragen\nSchritt 0 enthält keinen Code. Er nennt das Thema: nicht ROT13, sondern die Architektur darum herum. Die Funktionalität bleibt über 81 Schritte fast unverändert — genau das macht die Veränderungen ringsherum sichtbar.\nZwei Regeln werden hier gesetzt und gelten für das ganze Tutorial:\nDeshalb beginnt das Tutorial nicht mit MQTT und auch nicht mit dynamischen Abonnements. Es baut zuerst ein System mit absichtlich unbequemen Vermittlern, nimmt es in Betrieb und fragt erst dann, ob sie ihren Platz verdient haben.\nDie zweite Regel betrifft das Vokabular: Intent, Status/State und Event werden erst benannt, nachdem sie benutzt wurden. Sie erscheinen etwa ab Schritt 42, nicht früher.\nDie geplante Route, von Schritt 0 an:\nDer Wortlaut der drei Fragen ist wichtig, und man ersetzt ihn leicht durch eine schwächere Fassung:\n„Kennen“ ist nicht „kommunizieren“: zwei Komponenten können den ganzen Tag Nachrichten austauschen, ohne dass eine die andere nennt. „Über die Verdrahtung entscheiden“ ist nicht „verbinden“: der Teil, der Nachrichten weiterleitet, muss nicht der Teil sein, der die Route gewählt hat. Beide Unterscheidungen werden später konkret — die erste schon in Schritt 1, die zweite in Teil III.",
"crumbs": [
"<span class='chapter-number'>1</span>  <span class='chapter-title'>[Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de}</span>"
]
},
{
"objectID": "00-orientation.html#sec-three-questions",
"href": "00-orientation.html#sec-three-questions",
"title": "1  Schritt 0 — Worum es im Tutorial geht",
"section": "",
"text": "Das Tutorial fragt\nEine schwächere Fassung\n\n\n\n\nWer kennt wen?\nwer mit wem kommuniziert\n\n\nWer besitzt was?\nwelche Daten jeder Teil hält\n\n\nWer entscheidet über die Verdrahtung?\nwelcher Teil alles verbindet",
"crumbs": [
"<span class='chapter-number'>1</span>  <span class='chapter-title'>[Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html",
"href": "01-part-i-calls.html",
"title": "2  Teil I — Mit dem beginnen, was man schon kennt",
"section": "",
"text": "2.1 Schritt 1 — Ganz unten: einfach aufrufen\nDie Schritte 1 bis 10 bleiben in einer JVM. Das System wird dreimal gebaut: als direkte Aufrufe, als drei Fähigkeiten, die einander nicht kennen wollen, und als dieselben Fähigkeiten, von Vermittlern zusammengeklebt. Nichts ist bisher verteilt, und genau das ist der Punkt: das Einzige, was sich ändert, ist wer wen kennt.\nProceduralRot13.java ist das ganze System in einer kompakten Quelldatei: eine Schleife, die eine Zeile liest, und eine Anweisung, die den rotierten Text ausgibt.\nIO.readln() steht in einer eigenen Zeile, rot13(text) aber ist kein eigener Schritt: es wird innerhalb des Arguments von IO.println aufgerufen. Weder rot13 noch IO.println weiss etwas vom anderen. Wer beide kennt, ist main(): es nennt sie und legt ihre Reihenfolge fest.\nWas main() über rot13 weiss: dass es existiert, wie man es aufruft (ein blosser Name, beide liegen in derselben implizit erzeugten Klasse), welches Argument es nimmt, was es zurückgibt, dass es jetzt sofort verfügbar ist und dass die Ausführung nach der Rückkehr weiterläuft. Nicht bekannt ist, wie rot13 implementiert ist — das Einzige, was es ignorieren darf.\nDie Verfügbarkeitsgarantie lohnt eine eigene Erwähnung, denn sie verschwindet später: main() und rot13 sind zwei Methoden einer bereits geladenen Klasse, aufgerufen im selben Thread, im selben Prozess. Nichts muss zuerst starten, keine Nachricht reist irgendwohin, kein Empfänger muss abonniert sein.\nBeobachtet: eine getippte Zeile erscheint rotiert; Ctrl+D beendet das Programm still, weil IO.readln() null zurückgibt und main() zurückkehrt.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-1",
"href": "01-part-i-calls.html#sec-step-1",
"title": "2  Teil I — Mit dem beginnen, was man schon kennt",
"section": "",
"text": "void main() {\n while (true) {\n var text = IO.readln();\n\n if (text == null)\n return;\n\n IO.println(rot13(text));\n }\n}\n\n\n\n\n\n\n\n\n\n\nAbbildung 2.1: Die prozedurale Fassung. Die Verdrahtung steht im Code: main() nennt alle drei Teile und legt ihre Reihenfolge fest.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-2",
"href": "01-part-i-calls.html#sec-step-2",
"title": "2  Teil I — Mit dem beginnen, was man schon kennt",
"section": "2.2 Schritt 2 — Drei egoistische Fähigkeiten",
"text": "2.2 Schritt 2 — Drei egoistische Fähigkeiten\nEine egoistische Komponente sagt: ich weiss, was ich kann, welche Daten ich annehme und welche ich erzeuge — und den Geschäftsprozess um mich herum möchte ich lieber nicht kennen. Konkret: ConsoleIn darf kein rot13(...) enthalten, und ROT13 kein consoleOut(...).\nDas Entfernen dieser Aufrufe schafft sofort ein Problem, das das Tutorial als Frage stellt: wenn niemand niemanden kennt, wer macht daraus ein System? Zu beachten ist, was die Frage nicht sagt: das Wissen ist nicht verschwunden, es muss woandershin. Es fehlen zwei Verbindungen, nicht eine — ConsoleIn ↔︎ ROT13 und ROT13 ↔︎ ConsoleOut.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-3",
"href": "01-part-i-calls.html#sec-step-3",
"title": "2  Teil I — Mit dem beginnen, was man schon kennt",
"section": "2.3 Schritt 3 — Jeder Fähigkeit ein Postfach geben",
"text": "2.3 Schritt 3 — Jeder Fähigkeit ein Postfach geben\nDer kleinste Mechanismus für die fehlenden Verbindungen: eine Nachricht und eine benannte Warteschlange.\nrecord Message(String type, String value) {}\n\nMap&lt;String, BlockingQueue&lt;Message&gt;&gt; mailboxes = new ConcurrentHashMap&lt;&gt;();\n\nBlockingQueue&lt;Message&gt; mailbox(String name) {\n return mailboxes.computeIfAbsent(name, _ -&gt; new LinkedBlockingQueue&lt;&gt;());\n}\nDas Tutorial nennt diese bewusst Postfächer (mailboxes) und nicht Topics, mit Begründung: rufen zwei Leser take() auf demselben Postfach auf, konkurrieren sie — jede Nachricht geht an genau einen von ihnen und wird nicht an beide kopiert. Ein Topic in Publish/Subscribe gäbe jedem Abonnenten seine eigene Kopie. Ein Leser pro Nachricht genügt vorläufig, und die Einschränkung bleibt absichtlich bestehen: sie macht später sichtbar, was Publish/Subscribe wirklich hinzufügt.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-steps-4-6",
"href": "01-part-i-calls.html#sec-steps-4-6",
"title": "2  Teil I — Mit dem beginnen, was man schon kennt",
"section": "2.4 Schritte 4–6 — Die drei Fähigkeiten werden egoistisch",
"text": "2.4 Schritte 4–6 — Die drei Fähigkeiten werden egoistisch\nJede Fähigkeit berührt nur noch ihre eigenen Postfachnamen:\n\n\n\nFähigkeit\nliest\nschreibt\n\n\n\n\nConsoleIn\ndie Tastatur\nconsoleIn.outbox\n\n\nROT13\nrot13.inbox\nrot13.outbox\n\n\nConsoleOut\nconsoleOut.inbox\ndie Konsole\n\n\n\nKeine Fähigkeit enthält den Namen einer anderen. Die Zusammenfassung des Tutorials selbst: „drei schön isolierte Fähigkeiten. Und sie tun zusammen absolut nichts.” Nichts bewegt eine Nachricht von consoleIn.outbox nach rot13.inbox oder von rot13.outbox nach consoleOut.inbox.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-7",
"href": "01-part-i-calls.html#sec-step-7",
"title": "2  Teil I — Mit dem beginnen, was man schon kennt",
"section": "2.5 Schritt 7 — Auftritt des Vermittlers",
"text": "2.5 Schritt 7 — Auftritt des Vermittlers\nDer kleinstmögliche Klebstoff: eine Schleife, die aus einem Postfach nimmt und in ein anderes legt, ohne etwas über das Durchlaufende zu wissen.\nvoid mediate(String from, String to) {\n while (true)\n mailbox(to).put(mailbox(from).take());\n}\nmain() startet fünf virtuelle Threads: die drei Fähigkeiten plus zwei Vermittler, deren Routen als Argumente übergeben werden — consoleIn.outbox → rot13.inbox und rot13.outbox → consoleOut.inbox.\nBeobachtet: Hello World hinein, Uryyb Jbeyq heraus, genau wie in Schritt 1. Aber Ctrl+D beendet das Programm nicht mehr. Der Thread von ConsoleIn kehrt zurück (er schleift nicht), und die vier anderen Threads hängen blockiert in take() an leeren Postfächern, ohne CPU zu verbrauchen. Am Leben hält den Prozess tatsächlich die letzte Zeile von main(), Thread.currentThread().join(): der Haupt-Thread wartet auf sich selbst, was nie enden kann. Virtuelle Threads sind Daemon-Threads; die vier wartenden Threads allein hätten die JVM also nicht am Laufen gehalten.\n\n\n\n\n\n\nAbbildung 2.2: Die vermittelte Fassung in einer JVM. In der Webfassung schickt Abspielen eine Nachricht durch alle acht Sprünge.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-8",
"href": "01-part-i-calls.html#sec-step-8",
"title": "2  Teil I — Mit dem beginnen, was man schon kennt",
"section": "2.6 Schritt 8 — Nochmals fragen: wer kennt wen?",
"text": "2.6 Schritt 8 — Nochmals fragen: wer kennt wen?\nKennt ConsoleIn ROT13? Nein. Kennt ROT13 ConsoleIn oder ConsoleOut? Nein. Ist die Topologie verschwunden? Nein — sie steckt in den zwei mediate(...)-Aufrufen innerhalb von main().\nDas ist das erste grosse Ergebnis des Tutorials:\n\nEntkopplung lässt Wissen oft nicht verschwinden. Sie verschiebt Wissen dorthin, wo es hingehört.\n\nDie Fähigkeit „ROT13 transformiert Text” gehört zu ROT13. Die Topologie ConsoleIn → ROT13 → ConsoleOut gehört zur Systemkomposition. Geändert hat sich seit Schritt 1 nicht, dass die Verdrahtung main() verlassen hat — sie ist noch dort —, sondern dass sie nicht mehr innerhalb einer Fähigkeit steht. Sie ist jetzt Daten: zwei Paare von Postfachnamen. Umverdrahten berührt diese zwei Zeilen und keine einzige Fähigkeit.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-9",
"href": "01-part-i-calls.html#sec-step-9",
"title": "2  Teil I — Mit dem beginnen, was man schon kennt",
"section": "2.7 Schritt 9 — Warum virtuelle Threads?",
"text": "2.7 Schritt 9 — Warum virtuelle Threads?\nFünf Schleifen warten nun unbegrenzt: die Tastatur, rot13.inbox, consoleOut.inbox und die Quellen der zwei Vermittler. Virtuelle Threads sind einfach der billige Java-Weg, fünf Wartevorgänge gleichzeitig in einer JVM laufen zu lassen.\nSie sind eine Implementierungsbequemlichkeit, keine Architektur. Die Architektur — wer wen kennt und wo die Verdrahtung liegt — steckt in den Postfachnamen, nicht in den Threads. Der Beleg des Tutorials für die Trennung: dieselbe Architektur läuft in Schritt 11 als getrennte Prozesse, ohne geteilte Threads zwischen den Teilen.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-10",
"href": "01-part-i-calls.html#sec-step-10",
"title": "2  Teil I — Mit dem beginnen, was man schon kennt",
"section": "2.8 Schritt 10 — Die Dienste egoistisch halten",
"text": "2.8 Schritt 10 — Die Dienste egoistisch halten\nDie naheliegende Abkürzung: der erste Vermittler kopiert Nachrichten nur unverändert — warum ihn also nicht löschen und ROT13 direkt take() auf consoleIn.outbox machen lassen?\nWeil ROT13 dann den Namen consoleIn.outbox enthielte, also wüsste, dass ConsoleIn existiert und wohin es veröffentlicht. Die Topologie wanderte in ROT13 hinein, und ROT13 wäre keine egoistische Fähigkeit mehr. Der Test, der das konkret macht: die Eingabe komme künftig von einer neuen Fähigkeit FileIn, die in fileIn.outbox veröffentlicht.\n\n\n\n\n\n\n\n\n\nmit Vermittler\nmit der Abkürzung\n\n\n\n\nwas sich ändert\nein Argument des Vermittlers\nrunRot13 selbst\n\n\nwer berührt wird\nkeine Fähigkeit\nROT13, dessen Aufgabe unverändert blieb\n\n\n\nDas Tutorial ist ehrlich über den Preis: dieses Design „mag indirekt wirken — sogar etwas eigenartig”, und es verspricht einen anderen Weg, Dienste egoistisch zu halten, ohne Vermittler im Pfad jeder Nachricht.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-part-i-result",
"href": "01-part-i-calls.html#sec-part-i-result",
"title": "2  Teil I — Mit dem beginnen, was man schon kennt",
"section": "2.9 Was Teil I verschoben hat",
"text": "2.9 Was Teil I verschoben hat\n\n\n\n\n\n\n\n\nStufe\nwo die Topologie liegt\nwer umverdrahten kann\n\n\n\n\nSchritt 1\nim Code der Fähigkeit (IO.println(rot13(text)))\nwer diesen Code ändert\n\n\nSchritte 7–8\nin main(), als Paare von Postfachnamen\nwer main() ändert\n\n\n\nFunktionalität: unverändert. Codezeilen: mehr. Teile, die einander kennen: keine. Das ist der Tauschhandel, den das restliche Tutorial immer wieder prüft.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html",
"href": "02-part-ii-processes.html",
"title": "3  Teil II — Die Prozessgrenze überschreiten",
"section": "",
"text": "3.1 Schritt 11 — Die Komponenten trennen\nDie Schritte 11 bis 18 nehmen die Architektur aus Teil I und verteilen sie auf fünf Betriebssystemprozesse auf einem Rechner. Die Fähigkeiten behalten ihre Postfachnamen; nur der Transport darunter wechselt, von Java-Objekten zu Dateien in Verzeichnissen. Das erste wirklich verteilte Problem tritt hier auf, und es hat nichts mit ROT13 zu tun.\nDrei Prozesse können keine BlockingQueue teilen: jeder java-Befehl startet seine eigene JVM mit eigenem Speicher, die mailboxes-Map existierte also dreimal, und jede Kopie sähe nur ihre eigenen Nachrichten. Ein externer Transport ist nötig.\nTCP würde gehen, MQTT würde gehen. Das Tutorial wählt absichtlich die primitivste Möglichkeit, das Dateisystem, mit einer einzeiligen Begründung: weil man es sehen kann. Nachrichten werden Dateien, die man mit ls auflisten und mit cat lesen kann, während das System läuft. Primitiv heisst hier nicht schlechter; Teil VIII kommt darauf zurück, was das Dateisystem wirklich gut und wirklich schlecht kann.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html#sec-steps-12-13",
"href": "02-part-ii-processes.html#sec-steps-12-13",
"title": "3  Teil II — Die Prozessgrenze überschreiten",
"section": "3.2 Schritte 12–13 — Ein Verzeichnis wird zum Postfach",
"text": "3.2 Schritte 12–13 — Ein Verzeichnis wird zum Postfach\nDie Zuordnung ist eine Zeile lang:\ndirectory = mailbox file = message\npublish = create file receive = watch directory\nmessageBoard/\n├── consoleIn/outbox/\n├── rot13/inbox/\n├── rot13/outbox/\n└── consoleOut/inbox/\nDer Message-Record erhält einen optionalen Zeitstempel, und das Dateiformat bleibt zwei Zeilen plus eine optionale dritte:\nTEXT\nHello World\nTIMESTAMP: 2026-09-22T10:42:12.123Z\nEine handgeschriebene Nachricht darf den Zeitstempel weglassen. Die Marke TIMESTAMP: verhindert, dass eine Inhaltszeile, die zufällig wie ein Datum aussieht, für Metadaten gehalten wird; in diesem winzigen Format ist eine letzte Zeile, die mit TIMESTAMP: beginnt, reserviert.\nJackson könnte hier eingeführt werden und wird es absichtlich nicht. Der Sinn eines lächerlich einfachen Formats ist, dass fast nichts die Architektur verdeckt — die ganze Nachricht ist in jedem Texteditor lesbar, was die Aufmerksamkeit darauf hält, wer mit wem spricht.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html#sec-step-14",
"href": "02-part-ii-processes.html#sec-step-14",
"title": "3  Teil II — Die Prozessgrenze überschreiten",
"section": "3.3 Schritt 14 — Das erste Problem verteilter Systeme: die Veröffentlichung",
"text": "3.3 Schritt 14 — Das erste Problem verteilter Systeme: die Veröffentlichung\nEin Leser, der ein Verzeichnis beobachtet, kann eine Datei entdecken, bevor der Schreiber sie fertig geschrieben hat. Daher ein Veröffentlichungsprotokoll:\n\neine private temporäre Datei erzeugen;\ndie vollständige Nachricht schreiben;\nsie schliessen;\nsie atomar auf ihren endgültigen .msg-Namen umbenennen;\nKonsumenten reagieren nur auf endgültige Dateien.\n\nFiles.writeString(temporary, content);\nFiles.move(temporary, published, StandardCopyOption.ATOMIC_MOVE);\nBeide Hälften sind nötig. Das Umbenennen ist atomar — ein Leser sieht entweder keine .msg-Datei oder die vollständige —, aber es schützt nichts, wenn Leser auch .tmp-Dateien aufgreifen. .tmp und .msg bleiben im selben Verzeichnis, damit der Verschiebevorgang kein Dateisystem überschreitet, wo die Atomarität verloren ginge.\n\nSchreiben und Veröffentlichen sind nicht dieselbe Operation.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html#sec-step-15",
"href": "02-part-ii-processes.html#sec-step-15",
"title": "3  Teil II — Die Prozessgrenze überschreiten",
"section": "3.4 Schritt 15 — Ein Postfach mit WatchService beobachten",
"text": "3.4 Schritt 15 — Ein Postfach mit WatchService beobachten\nJavas eigener Dateisystem-Beobachter liefert die Konsumentenhälfte: ein Verzeichnis für ENTRY_CREATE registrieren, in watcher.take() blockieren und jeden Dateinamen ignorieren, der nicht auf .msg endet.\nDas ergibt auch ein sehr einfaches Einspeisewerkzeug. Mit ActuatorService als laufendem Konsumenten:\nprintf 'TEXT\\nHello from a file' &gt; messageBoard/consoleOut/inbox/manual.tmp\nmv messageBoard/consoleOut/inbox/manual.tmp messageBoard/consoleOut/inbox/manual.msg\nBeobachtet: beim Auftauchen der .tmp-Datei geschieht nichts; die Zeile erscheint in dem Moment, in dem das Umbenennen den .msg-Namen erzeugt. Beide erlaubten Formate funktionieren, mit und ohne abschliessenden Zeitstempel.\nDie architektonische Lehre ist die, die das Tutorial als producer → filesystem → consumer zieht: der Konsument konnte einen Menschen, der mv tippt, nicht von einem echten Dienst unterscheiden. Er kennt sein eigenes Eingangspostfach, nicht den, der hineinschreibt. Der Egoismus hat die Prozessgrenze überlebt.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html#sec-steps-16-17",
"href": "02-part-ii-processes.html#sec-steps-16-17",
"title": "3  Teil II — Die Prozessgrenze überschreiten",
"section": "3.5 Schritte 16–17 — Dienste und Vermittler werden Prozesse",
"text": "3.5 Schritte 16–17 — Dienste und Vermittler werden Prozesse\nDie drei Fähigkeiten werden drei Programme, und der Vermittler eine vierte Art Programm:\n\n\n\n\n\n\n\n\n\nProgramm\nspielt\nliest\nschreibt\n\n\n\n\nSensorService.java\nConsoleIn\ndie Tastatur\nconsoleIn/outbox\n\n\nProcessorService.java\nROT13\nrot13/inbox\nrot13/outbox\n\n\nActuatorService.java\nConsoleOut\nconsoleOut/inbox\ndie Konsole\n\n\nMediator.java &lt;from&gt; &lt;to&gt;\nder Klebstoff\n&lt;from&gt;\n&lt;to&gt;\n\n\n\nDer Vermittler ist generisch: seine Route ist nicht einkompiliert, sie kommt als zwei Startargumente. Doch das Tutorial weist auf eine Asymmetrie hin, die man im Kopf behalten sollte: die drei Fähigkeiten erhalten ihre Arbeit als Nachrichten in einem Postfach, der Vermittler dagegen seine Route als Startkonfiguration — und er hat keinen Namen und kein eigenes Steuerpostfach, in das jemand schreiben könnte.\nPraktische Folge: Argumente werden einmal gelesen, das Ändern der Route eines laufenden Vermittlers heisst also: anhalten und neu starten. Eine Konfigurationsdatei wäre nicht anders — auch sie wird beim Start gelesen. Das Tutorial lässt diesen Punkt absichtlich offen, bis die Kosten der verteilten Vermittler zu spüren waren.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html#sec-step-18",
"href": "02-part-ii-processes.html#sec-step-18",
"title": "3  Teil II — Die Prozessgrenze überschreiten",
"section": "3.6 Schritt 18 — Die vollständig externe lokale Fassung ausführen",
"text": "3.6 Schritt 18 — Die vollständig externe lokale Fassung ausführen\nFünf Terminals, fünf Prozesse, ein lokales Dateisystem dazwischen:\njava SensorService.java # terminal 1\njava Mediator.java consoleIn/outbox rot13/inbox # terminal 2\njava ProcessorService.java # terminal 3\njava Mediator.java rot13/outbox consoleOut/inbox # terminal 4\njava ActuatorService.java # terminal 5\nBeobachtet: Hello World, in Terminal 1 getippt, erschien als Uryyb Jbeyq in Terminal 5. Die drei mittleren Terminals zeigten nichts Neues — jeder Vermittler gibt beim Start eine Zeile „Mediating: …” aus, und ProcessorService gibt überhaupt nichts aus. Danach enthielt jedes der vier Postfachverzeichnisse eine .msg-Datei: dieselbe Zeile, entlang der Kette kopiert.\nNachzählen: fünf Prozesse für das, was Schritt 1 in einer Anweisung tat. Die Anweisung des Tutorials an dieser Stelle lautet nicht, zu optimieren: „We are not done making it painful.”\n\n\n\n\n\n\nAbbildung 3.1: Die fünf Prozesse und die vier Postfachverzeichnisse. In der Webfassung folgt Abspielen einer Textzeile von der Tastatur zur Konsole.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html#sec-part-ii-result",
"href": "02-part-ii-processes.html#sec-part-ii-result",
"title": "3  Teil II — Die Prozessgrenze überschreiten",
"section": "3.7 Was Teil II verschoben hat",
"text": "3.7 Was Teil II verschoben hat\n\n\n\n\n\n\n\n\nStufe\nwo die Topologie liegt\nwer umverdrahten kann\n\n\n\n\nSchritt 1\nim Code der Fähigkeit\nwer diesen Code ändert\n\n\nSchritte 7–8\nin main(), als Postfachnamen\nwer main() ändert\n\n\nSchritt 18\nin den zwei Befehlszeilen Mediator.java &lt;from&gt; &lt;to&gt;\nwer die Prozesse startet\n\n\n\nDie Topologie hat den Quellcode nun ganz verlassen: keine .java-Datei enthält die Route. Sie steckt in dem, was der Bediener getippt hat — damit ist derzeit ein Mensch der Orchestrator. Was die Fünf-Prozess-Fassung einbringt, ist echt: die Verdrahtung kann sich ändern, ohne ein Programm anzufassen. Was sie kostet, ist ebenso echt: fünf Prozesse, vier Kopien jeder Nachricht und ein Programm, das bei Ctrl+D nicht mehr stehen bleibt.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
}
]
@@ -0,0 +1,12 @@
/*!
* Bootstrap v5.3.1 (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/@import"https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Serif:ital,wght@0,400;0,600;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap";:root,[data-bs-theme=light]{--bs-blue: #2780e3;--bs-indigo: #6610f2;--bs-purple: #613d7c;--bs-pink: #e83e8c;--bs-red: #ff0039;--bs-orange: #f0ad4e;--bs-yellow: #ff7518;--bs-green: #3fb618;--bs-teal: #20c997;--bs-cyan: #9954bb;--bs-black: #000;--bs-white: #fff;--bs-gray: #6c757d;--bs-gray-dark: #343a40;--bs-gray-100: #f8f9fa;--bs-gray-200: #e9ecef;--bs-gray-300: #dee2e6;--bs-gray-400: #ced4da;--bs-gray-500: #adb5bd;--bs-gray-600: #6c757d;--bs-gray-700: #495057;--bs-gray-800: #343a40;--bs-gray-900: #212529;--bs-default: #5a6879;--bs-primary: #20666f;--bs-secondary: #5a6879;--bs-success: #3fb618;--bs-info: #9954bb;--bs-warning: #ff7518;--bs-danger: #ff0039;--bs-light: #f8f9fa;--bs-dark: #343a40;--bs-default-rgb: 90, 104, 121;--bs-primary-rgb: 32, 102, 111;--bs-secondary-rgb: 90, 104, 121;--bs-success-rgb: 63, 182, 24;--bs-info-rgb: 153, 84, 187;--bs-warning-rgb: 255, 117, 24;--bs-danger-rgb: 255, 0, 57;--bs-light-rgb: 248, 249, 250;--bs-dark-rgb: 52, 58, 64;--bs-primary-text-emphasis: rgb(12.8, 40.8, 44.4);--bs-secondary-text-emphasis: rgb(36, 41.6, 48.4);--bs-success-text-emphasis: rgb(25.2, 72.8, 9.6);--bs-info-text-emphasis: rgb(61.2, 33.6, 74.8);--bs-warning-text-emphasis: rgb(102, 46.8, 9.6);--bs-danger-text-emphasis: rgb(102, 0, 22.8);--bs-light-text-emphasis: #495057;--bs-dark-text-emphasis: #495057;--bs-primary-bg-subtle: rgb(210.4, 224.4, 226.2);--bs-secondary-bg-subtle: rgb(222, 224.8, 228.2);--bs-success-bg-subtle: rgb(216.6, 240.4, 208.8);--bs-info-bg-subtle: rgb(234.6, 220.8, 241.4);--bs-warning-bg-subtle: rgb(255, 227.4, 208.8);--bs-danger-bg-subtle: rgb(255, 204, 215.4);--bs-light-bg-subtle: rgb(251.5, 252, 252.5);--bs-dark-bg-subtle: #ced4da;--bs-primary-border-subtle: rgb(165.8, 193.8, 197.4);--bs-secondary-border-subtle: rgb(189, 194.6, 201.4);--bs-success-border-subtle: rgb(178.2, 225.8, 162.6);--bs-info-border-subtle: rgb(214.2, 186.6, 227.8);--bs-warning-border-subtle: rgb(255, 199.8, 162.6);--bs-danger-border-subtle: rgb(255, 153, 175.8);--bs-light-border-subtle: #e9ecef;--bs-dark-border-subtle: #adb5bd;--bs-white-rgb: 255, 255, 255;--bs-black-rgb: 0, 0, 0;--bs-font-sans-serif: "IBM Plex Sans", system-ui, -apple-system, sans-serif;--bs-font-monospace: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-root-font-size: 17px;--bs-body-font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;--bs-body-font-size:1rem;--bs-body-font-weight: 400;--bs-body-line-height: 1.66;--bs-body-color: #1b2430;--bs-body-color-rgb: 27, 36, 48;--bs-body-bg: #fbfcfd;--bs-body-bg-rgb: 251, 252, 253;--bs-emphasis-color: #000;--bs-emphasis-color-rgb: 0, 0, 0;--bs-secondary-color: rgba(27, 36, 48, 0.75);--bs-secondary-color-rgb: 27, 36, 48;--bs-secondary-bg: #e9ecef;--bs-secondary-bg-rgb: 233, 236, 239;--bs-tertiary-color: rgba(27, 36, 48, 0.5);--bs-tertiary-color-rgb: 27, 36, 48;--bs-tertiary-bg: #f8f9fa;--bs-tertiary-bg-rgb: 248, 249, 250;--bs-heading-color: inherit;--bs-link-color: #20666f;--bs-link-color-rgb: 32, 102, 111;--bs-link-decoration: underline;--bs-link-hover-color: rgb(25.6, 81.6, 88.8);--bs-link-hover-color-rgb: 26, 82, 89;--bs-code-color: #1b2430;--bs-highlight-bg: rgb(255, 227.4, 208.8);--bs-border-width: 1px;--bs-border-style: solid;--bs-border-color: #dae0e8;--bs-border-color-translucent: rgba(0, 0, 0, 0.175);--bs-border-radius: 0.25rem;--bs-border-radius-sm: 0.2em;--bs-border-radius-lg: 0.5rem;--bs-border-radius-xl: 1rem;--bs-border-radius-xxl: 2rem;--bs-border-radius-2xl: var(--bs-border-radius-xxl);--bs-border-radius-pill: 50rem;--bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.075);--bs-focus-ring-width: 0.25rem;--bs-focus-ring-opacity: 0.25;--bs-focus-ring-color: rgba(32, 102, 111, 0.25);--bs-form-valid-color: #3fb618;--bs-form-valid-border-color: #3fb618;--bs-form-invalid-color: #ff0039;--bs-form-invalid-border-color: #ff0039}[data-bs-theme=dark]{color-scheme:dark;--bs-body-color: #dee2e6;--bs-body-color-rgb: 222, 226, 230;--bs-body-bg: #212529;--bs-body-bg-rgb: 33, 37, 41;--bs-emphasis-color: #fff;--bs-emphasis-color-rgb: 255, 255, 255;--bs-secondary-color: rgba(222, 226, 230, 0.75);--bs-secondary-color-rgb: 222, 226, 230;--bs-secondary-bg: #343a40;--bs-secondary-bg-rgb: 52, 58, 64;--bs-tertiary-color: rgba(222, 226, 230, 0.5);--bs-tertiary-color-rgb: 222, 226, 230;--bs-tertiary-bg: rgb(42.5, 47.5, 52.5);--bs-tertiary-bg-rgb: 43, 48, 53;--bs-primary-text-emphasis: rgb(121.2, 163.2, 168.6);--bs-secondary-text-emphasis: rgb(156, 164.4, 174.6);--bs-success-text-emphasis: rgb(139.8, 211.2, 116.4);--bs-info-text-emphasis: rgb(193.8, 152.4,Line truncated
*
* ansi colors from IPython notebook's
*
* we also add `bright-[color]-` synonyms for the `-[color]-intense` classes since
* that seems to be what ansi_up emits
*
*/.ansi-black-fg{color:#3e424d}.ansi-black-bg{background-color:#3e424d}.ansi-black-intense-black,.ansi-bright-black-fg{color:#282c36}.ansi-black-intense-black,.ansi-bright-black-bg{background-color:#282c36}.ansi-red-fg{color:#e75c58}.ansi-red-bg{background-color:#e75c58}.ansi-red-intense-red,.ansi-bright-red-fg{color:#b22b31}.ansi-red-intense-red,.ansi-bright-red-bg{background-color:#b22b31}.ansi-green-fg{color:#00a250}.ansi-green-bg{background-color:#00a250}.ansi-green-intense-green,.ansi-bright-green-fg{color:#007427}.ansi-green-intense-green,.ansi-bright-green-bg{background-color:#007427}.ansi-yellow-fg{color:#ddb62b}.ansi-yellow-bg{background-color:#ddb62b}.ansi-yellow-intense-yellow,.ansi-bright-yellow-fg{color:#b27d12}.ansi-yellow-intense-yellow,.ansi-bright-yellow-bg{background-color:#b27d12}.ansi-blue-fg{color:#208ffb}.ansi-blue-bg{background-color:#208ffb}.ansi-blue-intense-blue,.ansi-bright-blue-fg{color:#0065ca}.ansi-blue-intense-blue,.ansi-bright-blue-bg{background-color:#0065ca}.ansi-magenta-fg{color:#d160c4}.ansi-magenta-bg{background-color:#d160c4}.ansi-magenta-intense-magenta,.ansi-bright-magenta-fg{color:#a03196}.ansi-magenta-intense-magenta,.ansi-bright-magenta-bg{background-color:#a03196}.ansi-cyan-fg{color:#60c6c8}.ansi-cyan-bg{background-color:#60c6c8}.ansi-cyan-intense-cyan,.ansi-bright-cyan-fg{color:#258f8f}.ansi-cyan-intense-cyan,.ansi-bright-cyan-bg{background-color:#258f8f}.ansi-white-fg{color:#c5c1b4}.ansi-white-bg{background-color:#c5c1b4}.ansi-white-intense-white,.ansi-bright-white-fg{color:#a1a6b2}.ansi-white-intense-white,.ansi-bright-white-bg{background-color:#a1a6b2}.ansi-default-inverse-fg{color:#fff}.ansi-default-inverse-bg{background-color:#000}.ansi-bold{font-weight:bold}.ansi-underline{text-decoration:underline}:root{--quarto-body-bg: #fbfcfd;--quarto-body-color: #1b2430;--quarto-text-muted: #6c757d;--quarto-border-color: #dae0e8;--quarto-border-width: 1px}table.gt_table{color:var(--quarto-body-color);font-size:1em;width:100%;background-color:rgba(0,0,0,0);border-top-width:inherit;border-bottom-width:inherit;border-color:var(--quarto-border-color)}table.gt_table th.gt_column_spanner_outer{color:var(--quarto-body-color);background-color:rgba(0,0,0,0);border-top-width:inherit;border-bottom-width:inherit;border-color:var(--quarto-border-color)}table.gt_table th.gt_col_heading{color:var(--quarto-body-color);font-weight:bold;background-color:rgba(0,0,0,0)}table.gt_table thead.gt_col_headings{border-bottom:1px solid currentColor;border-top-width:inherit;border-top-color:var(--quarto-border-color)}table.gt_table thead.gt_col_headings:not(:first-child){border-top-width:1px;border-top-color:var(--quarto-border-color)}table.gt_table td.gt_row{border-bottom-width:1px;border-bottom-color:var(--quarto-border-color);border-top-width:0px}table.gt_table tbody.gt_table_body{border-top-width:1px;border-bottom-width:1px;border-bottom-color:var(--quarto-border-color);border-top-color:currentColor}div.columns{display:initial;gap:initial}div.column{display:inline-block;overflow-x:initial;vertical-align:top;width:50%}.code-annotation-tip-content{word-wrap:break-word}.code-annotation-container-hidden{display:none !important}dl.code-annotation-container-grid{display:grid;grid-template-columns:min-content auto}dl.code-annotation-container-grid dt{grid-column:1}dl.code-annotation-container-grid dd{grid-column:2}pre.sourceCode.code-annotation-code{padding-right:0}code.sourceCode .code-annotation-anchor{z-index:100;position:relative;float:right;background-color:rgba(0,0,0,0)}input[type=checkbox]{margin-right:.5ch}:root{--mermaid-bg-color: #fbfcfd;--mermaid-edge-color: #5a6879;--mermaid-node-fg-color: #1b2430;--mermaid-fg-color: #1b2430;--mermaid-fg-color--lighter: rgb(45.36, 60.48, 80.64);--mermaid-fg-color--lightest: rgb(63.72, 84.96, 113.28);--mermaid-font-family: IBM Plex Sans, system-ui, -apple-system, sans-serif;--mermaid-label-bg-color: #fbfcfd;--mermaid-label-fg-color: #20666f;--mermaid-node-bg-color: rgba(32, 102, 111, 0.1);--mermaid-node-fg-color: #1b2430}@media print{:root{font-size:11pt}#quarto-sidebar,#TOC,.nav-page{display:none}.page-columns .content{grid-column-start:page-start}.fixed-top{position:relative}.panel-caption,.figure-caption,figcaption{color:#666}}body.quarto-light .dark-content{display:none !important}body.quarto-dark .light-content{display:none !important}.code-copy-button{position:absolute;top:0;right:0;border:0;margin-top:5px;margin-right:5px;background-color:rgba(0,0,0,0);z-index:3}.code-copy-button-tooltip{font-size:.75em}.code-copy-button>.bi::before{display:inline-block;height:1rem;width:1rem;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="rgb(94, 94, 94)" viewBox="0 0 16 16"><path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"/><path d="M9.5 1a.5.5 0 0 1 .5.5vLine truncated
File diff suppressed because it is too large. Load diff
Binary file not shown.
+7
View File
@@ -0,0 +1,7 @@
/*!
* Bootstrap v5.3.1 (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).bootstrap=e()}(this,(function(){"use strict";const t=new Map,e={set(e,i,n){t.has(e)||t.set(e,new Map);const s=t.get(e);s.has(i)||0===s.size?s.set(i,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`)},get:(e,i)=>t.has(e)&&t.get(e).get(i)||null,remove(e,i){if(!t.has(e))return;const n=t.get(e);n.delete(i),0===n.size&&t.delete(e)}},i="transitionend",n=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),s=t=>{t.dispatchEvent(new Event(i))},o=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),r=t=>o(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(n(t)):null,a=t=>{if(!o(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(!i)return e;if(i!==t){const e=t.closest("summary");if(e&&e.parentNode!==i)return!1;if(null===e)return!1}return e},l=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),c=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?c(t.parentNode):null},h=()=>{},d=t=>{t.offsetHeight},u=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,f=[],p=()=>"rtl"===document.documentElement.dir,m=t=>{var e;e=()=>{const e=u();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}},"loading"===document.readyState?(f.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of f)t()})),f.push(e)):e()},g=(t,e=[],i=t)=>"function"==typeof t?t(...e):i,_=(t,e,n=!0)=>{if(!n)return void g(t);const o=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const n=Number.parseFloat(e),s=Number.parseFloat(i);return n||s?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(e)+5;let r=!1;const a=({target:n})=>{n===e&&(r=!0,e.removeEventListener(i,a),g(t))};e.addEventListener(i,a),setTimeout((()=>{r||s(e)}),o)},b=(t,e,i,n)=>{const s=t.length;let o=t.indexOf(e);return-1===o?!i&&n?t[s-1]:t[0]:(o+=i?1:-1,n&&(o=(o+s)%s),t[Math.max(0,Math.min(o,s-1))])},v=/[^.]*(?=\..*)\.|.*/,y=/\..*/,w=/::\d+$/,A={};let E=1;const T={mouseenter:"mouseover",mouseleave:"mouseout"},C=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function O(t,e){return e&&`${e}::${E++}`||t.uidEvent||E++}function x(t){const e=O(t);return t.uidEvent=e,A[e]=A[e]||{},A[e]}function k(t,e,i=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===i))}function L(t,e,i){const n="string"==typeof e,s=n?i:e||i;let o=I(t);return C.has(o)||(o=t),[n,s,o]}function S(t,e,i,n,s){if("string"!=typeof e||!t)return;let[o,r,a]=L(e,i,n);if(e in T){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};r=t(r)}const l=x(t),c=l[a]||(l[a]={}),h=k(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=O(r,e.replace(v,"")),u=o?function(t,e,i){return function n(s){const o=t.querySelectorAll(e);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return P(s,{delegateTarget:r}),n.oneOff&&N.off(t,s.type,e,i),i.apply(r,[s])}}(t,i,r):function(t,e){return function i(n){return P(n,{delegateTarget:t}),i.oneOff&&N.off(t,n.type,e),e.apply(t,[n])}}(t,r);u.delegationSelector=o?i:null,u.callable=r,u.oneOff=s,u.uidEvent=d,c[d]=u,t.addEventListener(a,u,o)}function D(t,e,i,n,s){const o=k(e[i],n,s);o&&(t.removeEventListener(i,o,Boolean(s)),delete e[i][o.uidEvent])}function $(t,e,i,n){const s=e[i]||{};for(const[o,r]of Object.entries(s))o.includes(n)&&D(t,e,i,r.callable,r.delegationSelector)}function I(t){return t=t.replace(y,""),T[t]||t}const N={on(t,e,i,n){S(t,e,i,n,!1)},one(t,e,i,n){S(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[s,o,r]=L(e,i,n),a=r!==e,l=x(t),c=l[r]||{},h=e.startsWith(".");if(void 0===o){if(h)for(const i of Object.keys(l))$(t,l,i,e.slLine truncated
//# sourceMappingURL=bootstrap.bundle.min.js.map
+7
View File
@@ -0,0 +1,7 @@
/*!
* clipboard.js v2.0.11
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return b}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),r=n.n(e);function c(t){try{return document.execCommand(t)}catch(t){return}}var a=function(t){t=r()(t);return c("cut"),t};function o(t,e){var n,o,t=(n=t,o="rtl"===document.documentElement.getAttribute("dir"),(t=document.createElement("textarea")).style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0",t.style.position="absolute",t.style[o?"right":"left"]="-9999px",o=window.pageYOffset||document.documentElement.scrollTop,t.style.top="".concat(o,"px"),t.setAttribute("readonly",""),t.value=n,t);return e.container.appendChild(t),e=r()(t),c("copy"),t.remove(),e}var f=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return"string"==typeof t?n=o(t,e):t instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==t?void 0:t.type)?n=o(t.value,e):(n=r()(t),c("copy")),n};function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.action,n=void 0===e?"copy":e,o=t.container,e=t.target,t=t.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==e){if(!e||"object"!==l(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return t?f(t,{container:o}):e?"cut"===n?a(e):f(e,{container:o}):void 0};function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function y(t,e){return(y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(n){var o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=v(n);return t=o?(t=v(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments),e=this,!(t=t)||"object"!==p(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(t,e){t="data-clipboard-".concat(t);if(e.hasAttribute(t))return e.getAttribute(t)}var b=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)}(r,i());var t,e,n,o=h(r);function r(t,e){var n;return function(t){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this),(n=o.call(this)).resolveOptions(e),n.listenClick(t),n}return t=r,n=[{key:"copy",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body};return f(t,e)}},{key:"cut",value:function(t){return a(t)}},{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof t?[t]:t,e=!!document.queryCommandSupported;return t.forEach(function(t){e=e&&!!document.queryCommandSupported(t)}),e}}],(e=[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===p(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=u()(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget,n=this.action(e)||"copy",t=s({action:n,container:thLine truncated
@@ -0,0 +1,86 @@
/* exo — exercise cards, hint folds (sequential unlock), solution fold */
.exo {
margin: 1.2rem 0;
padding: 0.6rem 0.9rem;
border: 1px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 35%, transparent);
border-left: 3px solid var(--calc-notecolor, #B45309);
border-radius: 0.35rem;
scroll-margin-top: 5rem;
}
/* keep wide content inside the card: display math (and tables/code) scroll
on their own rather than spilling past the border. overflow-y stays hidden
so Firefox doesn't add a phantom vertical bar, as in .calc */
.exo mjx-container[display="true"],
.exo .katex-display {
max-width: 100%;
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 0.35em; /* keep descenders clear of a horizontal bar */
/* a centred overflowing box clips its left side out of reach, so centre
only while the formula fits (browsers without `safe` keep plain centring) */
display: flex;
justify-content: center;
justify-content: safe center;
}
.exo .math.display { display: block; max-width: 100%; }
.exo :is(pre, table) { max-width: 100%; overflow-x: auto; }
.exo img, .exo svg { max-width: 100%; }
.exo-head p { margin: 0 0 0.4rem; }
.exo-head strong { color: var(--calc-notecolor, #B45309); }
.exo details {
margin: 0.45rem 0;
border-radius: 0.3rem;
}
.exo details > summary {
cursor: pointer;
list-style: none;
user-select: none;
font-size: 0.9em;
font-weight: 600;
}
.exo details > summary::-webkit-details-marker { display: none; }
.exo details > summary::before { content: "▸ "; }
.exo details[open] > summary::before { content: "▾ "; }
/* hints: small highlight boxes */
.exo-hint {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 6%, transparent);
border: 1px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 30%, transparent);
padding: 0.25rem 0.6rem;
}
.exo-hint > summary { color: var(--calc-notecolor, #B45309); }
/* locked hints: unlock one by one */
.exo-hint.exo-locked > summary {
cursor: not-allowed;
opacity: 0.45;
}
.exo-hint.exo-locked > summary::before { content: "🔒 "; }
/* solution: closed by default, visually separated */
.exo-sol {
border-top: 1px dashed color-mix(in srgb, var(--calc-notecolor, #B45309) 40%, transparent);
padding: 0.35rem 0.1rem 0.1rem;
scroll-margin-top: 5rem;
}
/* in a numbered part, the fold lines up with the part's text */
.exo li > details { margin-left: 0; }
/* hand-in extracts (handin.sh, html output) */
.exo-handin-sol, .exo-handin-hint {
margin: 0.6rem 0;
padding: 0.2rem 0 0.2rem 0.8rem;
border-left: 2px solid var(--calc-notecolor, #B45309);
}
.exo-fold-body { margin-top: 0.3rem; }
.exo-fold-body > p:first-child { margin-top: 0; }
.exo-fold-body > p:last-child { margin-bottom: 0; }
@media print {
.exo details > summary::before { content: ""; }
.exo-hint.exo-locked > summary { opacity: 1; cursor: default; }
}
@@ -0,0 +1,39 @@
// exo — hints unlock one by one within a part; everything unfolds for printing
(function () {
// block opening a locked hint
document.addEventListener("click", function (e) {
var s = e.target.closest ? e.target.closest("details.exo-hint.exo-locked > summary") : null;
if (s) e.preventDefault();
});
// opening hint n of a part unlocks hint n+1 of the same part, wherever it
// sits in the exercise (toggle doesn't bubble: use capture)
document.addEventListener("toggle", function (e) {
var d = e.target;
if (!d.classList || !d.classList.contains("exo-hint") || !d.open) return;
var chain = d.getAttribute("data-exo-chain");
var n = parseInt(d.getAttribute("data-exo-hint"), 10);
if (!chain || isNaN(n)) return;
var hints = document.querySelectorAll("details.exo-hint[data-exo-chain]");
for (var i = 0; i < hints.length; i++) {
if (hints[i].getAttribute("data-exo-chain") === chain &&
parseInt(hints[i].getAttribute("data-exo-hint"), 10) === n + 1) {
hints[i].classList.remove("exo-locked");
}
}
}, true);
// print: open all hints/solutions, restore afterwards
window.addEventListener("beforeprint", function () {
document.querySelectorAll(".exo details").forEach(function (d) {
d.dataset.exoWasOpen = d.open ? "1" : "0";
d.open = true;
});
});
window.addEventListener("afterprint", function () {
document.querySelectorAll(".exo details").forEach(function (d) {
d.open = d.dataset.exoWasOpen === "1";
delete d.dataset.exoWasOpen;
});
});
})();
@@ -0,0 +1,77 @@
/* glossary — usages, entries, hover tooltip */
/* usages: dotted underline, keep math color */
a.gls-sym,
mjx-container a {
color: inherit;
text-decoration: none;
}
.gls-sym {
border-bottom: 1px dotted currentColor;
cursor: help;
}
/* rendered glossary list */
.glossary .gls-entry {
margin: 0.8rem 0;
padding: 0.35rem 0.7rem;
border-left: 3px solid var(--calc-notecolor, #B45309);
scroll-margin-top: 5rem; /* don't hide behind Quarto's sticky header */
}
.glossary .gls-entry p { margin: 0 0 0.2rem; }
.glossary .gls-entry:target {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 10%, transparent);
border-radius: 0.25rem;
}
/* floating hover tooltip (filled by glossary.js) */
.gls-float {
position: absolute;
z-index: 1000;
max-width: 26rem;
padding: 0.5rem 0.75rem;
border: 1px solid var(--calc-notecolor, #B45309);
border-radius: 0.4rem;
background: var(--bs-body-bg, #fff);
color: var(--bs-body-color, #1a1a1a);
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
font-size: 0.9em;
line-height: 1.4;
}
.gls-float p { margin: 0 0 0.25rem; }
.gls-float p:last-child { margin-bottom: 0; }
/* in-place definition cards and property sub-entries */
.gls-inline {
margin: 1rem 0;
padding: 0.4rem 0.8rem;
border-left: 3px solid var(--calc-notecolor, #B45309);
scroll-margin-top: 5rem;
}
.gls-inline p { margin: 0 0 0.3rem; }
.gls-inline:target,
.gls-prop-entry:target {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 10%, transparent);
border-radius: 0.25rem;
}
.gls-prop-entry {
margin: 0.5rem 0 0.5rem 1.2rem;
padding: 0.25rem 0.6rem;
border-left: 2px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 45%, transparent);
font-size: 0.95em;
scroll-margin-top: 5rem;
}
.gls-back {
font-size: 0.85em;
opacity: 0.75;
}
/* standalone property cards keep the section flow (no indent) */
.gls-prop-entry.gls-standalone {
margin-left: 0;
font-size: 1em;
}
.glossary .gls-prop-line {
margin: 0.1rem 0 0.1rem 1.2rem;
font-size: 0.9em;
}
@@ -0,0 +1,68 @@
// glossary — hover tooltip for .gls-sym usages (prose links and MathJax \class nodes)
(function () {
var tip = null;
function ensureTip() {
if (tip === null) {
tip = document.createElement("div");
tip.className = "gls-float";
tip.style.display = "none";
document.body.appendChild(tip);
}
return tip;
}
function keyOf(el) {
if (el.dataset && el.dataset.glsKey) return el.dataset.glsKey;
for (var i = 0; i < el.classList.length; i++) {
var c = el.classList[i];
if (c.indexOf("gls-key-") === 0) return c.slice(8);
}
return null;
}
function show(target) {
var key = keyOf(target);
if (!key) return;
var entry = document.getElementById("gls-" + key);
var t = ensureTip();
if (entry) {
// for a main entry, don't drag every property into the popup
var node = entry.cloneNode(true);
node.querySelectorAll(".gls-prop-entry").forEach(function (n) { n.remove(); });
t.innerHTML = node.innerHTML;
} else if (window.__glsData && window.__glsData[key]) {
// entry lives on another page (book chapters render separately)
t.innerHTML = window.__glsData[key];
} else {
return;
}
t.style.display = "block";
if (window.MathJax && window.MathJax.typesetPromise) {
window.MathJax.typesetPromise([t]).catch(function () {});
}
var r = target.getBoundingClientRect();
var x = r.left + window.scrollX;
var y = r.bottom + window.scrollY + 6;
// keep it on screen horizontally
var w = t.offsetWidth;
var maxX = window.scrollX + document.documentElement.clientWidth - w - 12;
t.style.left = Math.max(window.scrollX + 8, Math.min(x, maxX)) + "px";
t.style.top = y + "px";
}
function hide() {
if (tip !== null) tip.style.display = "none";
}
document.addEventListener("mouseover", function (e) {
var el = e.target.closest ? e.target.closest(".gls-sym") : null;
if (el) show(el);
});
document.addEventListener("mouseout", function (e) {
var el = e.target.closest ? e.target.closest(".gls-sym") : null;
if (el) hide();
});
document.addEventListener("click", hide);
window.addEventListener("scroll", hide, { passive: true });
})();
@@ -0,0 +1,45 @@
/* latex-tables — HTML rendering of LaTeX tabular environments */
.ltx-table {
border-collapse: collapse;
margin: 1rem auto;
max-width: 100%;
overflow-x: auto;
display: table;
}
.ltx-table th,
.ltx-table td {
padding: 0.35em 0.7em;
vertical-align: top;
line-height: 1.4;
}
.ltx-table th {
font-weight: 600;
}
/* alignment */
.ltx-l { text-align: left; }
.ltx-c { text-align: center; }
.ltx-r { text-align: right; }
/* vertical rules (from | in the column spec) */
.ltx-bl { border-left: 1px solid currentColor; }
.ltx-br { border-right: 1px solid currentColor; }
/* horizontal rules: t = above the row, b = below.
1 = \hline / \midrule / \cline, 2 = booktabs \toprule / \bottomrule,
d = doubled rule (\hline\hline) */
.ltx-t1 { border-top: 1px solid currentColor; }
.ltx-b1 { border-bottom: 1px solid currentColor; }
.ltx-t2 { border-top: 1.6px solid currentColor; }
.ltx-b2 { border-bottom: 1.6px solid currentColor; }
.ltx-td { border-top: 3px double currentColor; }
.ltx-bd { border-bottom: 3px double currentColor; }
/* keep wide tables usable on narrow screens */
@media (max-width: 700px) {
.ltx-table { font-size: 0.9em; }
.ltx-table th, .ltx-table td { padding: 0.25em 0.45em; }
}
@@ -0,0 +1,100 @@
/* calc-notes — HTML layout for the calc / calc* environments */
.calc {
display: grid;
/* lhs | rhs | notes | equation number */
grid-template-columns: max-content max-content minmax(8rem, 1fr) auto;
column-gap: 0.35rem;
row-gap: 0.6rem;
align-items: baseline;
margin: 1rem 0 1.4rem;
/* allow horizontal scrolling for very wide equations, but never show a
vertical bar (Firefox computes phantom vertical overflow otherwise) */
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 0.4em; /* keep descenders clear of a horizontal bar */
}
.calc-row { display: contents; }
.calc-lhs { grid-column: 1; justify-self: end; }
.calc-rhs { grid-column: 2; justify-self: start; }
.calc-full { grid-column: 1 / 3; justify-self: start; }
/* ---- notes ------------------------------------------------------- */
.calc-notes {
grid-column: 3;
display: flex;
flex-wrap: wrap;
gap: 0.35rem 0.75rem;
align-items: baseline;
min-width: 0;
padding-left: 0.9rem;
}
.calc-note {
color: var(--calc-notecolor, #B45309);
font-size: 0.85em;
line-height: 1.35;
}
.calc-note > summary {
cursor: pointer;
list-style: none; /* remove the default triangle ... */
user-select: none;
opacity: 0.7;
font-style: italic;
}
.calc-note > summary::-webkit-details-marker { display: none; }
.calc-note > summary::before { content: "▸ "; font-style: normal; }
.calc-note[open] > summary::before { content: "▾ "; }
.calc-note > summary:hover { opacity: 1; }
.calc-note[open] {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 8%, transparent);
border-left: 2px solid var(--calc-notecolor, #B45309);
border-radius: 0.25rem;
padding: 0.15rem 0.45rem;
}
.calc-note-body { margin-top: 0.1rem; }
.calc-note-body p { margin: 0; }
/* \mnote: math note (no extra styling needed — body is typeset math) */
.calc-note-math .calc-note-body { padding: 0.1rem 0; }
/* ---- calc*: boxed final result ----------------------------------- */
.calc-box {
display: inline-block;
border: 1.5px solid currentColor;
border-radius: 0.3em;
padding: 0.3em 0.65em;
margin-top: 0.15em;
background: color-mix(in srgb, currentColor 4%, transparent);
}
/* ---- labelled blocks: equation number on the last line ----------- */
.calc-tag {
grid-column: 4;
justify-self: end;
padding-left: 1rem;
white-space: nowrap;
}
/* ---- printing: show notes unfolded, like the PDF ------------------ */
@media print {
.calc-note > summary { display: none; }
.calc-note[open] { background: none; border: none; padding: 0; }
}
/* small screens: notes drop under the equation line */
@media (max-width: 560px) {
.calc { grid-template-columns: max-content 1fr; }
.calc-notes { grid-column: 1 / 3; padding-left: 1.5rem; }
.calc-full { grid-column: 1 / 3; }
.calc-tag { grid-column: 1 / -1; }
}
@@ -0,0 +1,15 @@
// calc-notes — open every note before printing, restore afterwards
(function () {
window.addEventListener("beforeprint", function () {
document.querySelectorAll("details.calc-note").forEach(function (d) {
d.dataset.calcWasOpen = d.open ? "1" : "0";
d.open = true;
});
});
window.addEventListener("afterprint", function () {
document.querySelectorAll("details.calc-note").forEach(function (d) {
d.open = d.dataset.calcWasOpen === "1";
delete d.dataset.calcWasOpen;
});
});
})();
+9
View File
@@ -0,0 +1,9 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
//
// AnchorJS - v5.0.0 - 2023-01-18
// https://www.bryanbraun.com/anchorjs/
// Copyright (c) 2023 Bryan Braun; Licensed MIT
//
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
!function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(globalThis,function(){"use strict";return function(A){function u(A){A.icon=Object.prototype.hasOwnProperty.call(A,"icon")?A.icon:"",A.visible=Object.prototype.hasOwnProperty.call(A,"visible")?A.visible:"hover",A.placement=Object.prototype.hasOwnProperty.call(A,"placement")?A.placement:"right",A.ariaLabel=Object.prototype.hasOwnProperty.call(A,"ariaLabel")?A.ariaLabel:"Anchor",A.class=Object.prototype.hasOwnProperty.call(A,"class")?A.class:"",A.base=Object.prototype.hasOwnProperty.call(A,"base")?A.base:"",A.truncate=Object.prototype.hasOwnProperty.call(A,"truncate")?Math.floor(A.truncate):64,A.titleText=Object.prototype.hasOwnProperty.call(A,"titleText")?A.titleText:""}function d(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new TypeError("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],u(this.options),this.add=function(A){var e,t,o,i,n,s,a,r,l,c,h,p=[];if(u(this.options),0!==(e=d(A=A||"h2, h3, h4, h5, h6")).length){for(null===document.head.querySelector("style.anchorjs")&&((A=document.createElement("style")).className="anchorjs",A.appendChild(document.createTextNode("")),void 0===(h=document.head.querySelector('[rel="stylesheet"],style'))?document.head.appendChild(A):document.head.insertBefore(A,h),A.sheet.insertRule(".anchorjs-link{opacity:0;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}",A.sheet.cssRules.length),A.sheet.insertRule(":hover>.anchorjs-link,.anchorjs-link:focus{opacity:1}",A.sheet.cssRules.length),A.sheet.insertRule("[data-anchorjs-icon]::after{content:attr(data-anchorjs-icon)}",A.sheet.cssRules.length),A.sheet.insertRule('@font-face{font-family:anchorjs-icons;src:url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype")}',A.sheet.cssRules.length)),h=document.querySelectorAll("[id]"),t=[].map.call(h,function(A){return A.id}),i=0;i<e.length;i++)if(this.hasAnchorJSLink(e[i]))p.push(i);else{if(e[i].hasAttribute("id"))o=e[i].getAttribute("id");else if(e[i].hasAttribute("data-anchor-id"))o=e[i].getAttribute("data-anchor-id");else{for(r=a=this.urlify(e[i].textContent),s=0;n=t.indexOf(r=void 0!==n?a+"-"+s:r),s+=1,-1!==n;);n=void 0,t.push(r),e[i].setAttribute("id",r),o=r}(l=document.createElement("a")).className="anchorjs-link "+this.options.class,l.setAttribute("aria-label",this.options.ariaLabel),l.setAttribute("data-anchorjs-icon",this.options.icon),this.options.titleText&&(l.title=this.options.titleText),c=document.querySelector("base")?window.location.pathname+window.location.search:"",c=this.options.base||c,l.href=c+"#"+o,"always"===this.options.visible&&(l.style.opacity="1"),""===this.options.icon&&(l.style.font="1em/1 anchorjs-icons","left"===this.options.placement)&&(l.style.lineHeight="inherit"),"left"===this.options.placement?(l.style.position="absolute",l.style.marginLeft="-1.25em",l.style.paddingRight=".25em",l.style.paddingLeft=".25em",e[i].insertBefore(l,e[i].firstChild)):(l.style.marginLeft=".1875em",l.style.paddingRight=".1875em",l.style.paddingLeft=".1875em",e[i].appendChild(l))}for(i=0;i<p.length;i++)e.splice(p[i]-i,1);this.elements=this.elements.concat(e)}return this},this.remove=function(A){for(var e,t,o=d(A),i=0;i<o.length;i++)(t=o[i].querySelector(".anchorjs-link"))&&(-1!==(e=this.elements.indexOf(o[i]))&&this.elements.splice(e,1),o[i].removeChild(t));return this},this.removeAll=function(){thisLine truncated
// @license-end
+6
View File
@@ -0,0 +1,6 @@
/**
* @popperjs/core v2.11.7 - MIT License
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,(function(e){"use strict";function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function n(e){return e instanceof t(e).Element||e instanceof Element}function r(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}var i=Math.max,a=Math.min,s=Math.round;function f(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function c(){return!/^((?!chrome|android).)*safari/i.test(f())}function p(e,o,i){void 0===o&&(o=!1),void 0===i&&(i=!1);var a=e.getBoundingClientRect(),f=1,p=1;o&&r(e)&&(f=e.offsetWidth>0&&s(a.width)/e.offsetWidth||1,p=e.offsetHeight>0&&s(a.height)/e.offsetHeight||1);var u=(n(e)?t(e):window).visualViewport,l=!c()&&i,d=(a.left+(l&&u?u.offsetLeft:0))/f,h=(a.top+(l&&u?u.offsetTop:0))/p,m=a.width/f,v=a.height/p;return{width:m,height:v,top:h,right:d+m,bottom:h+v,left:d,x:d,y:h}}function u(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function l(e){return e?(e.nodeName||"").toLowerCase():null}function d(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function h(e){return p(d(e)).left+u(e).scrollLeft}function m(e){return t(e).getComputedStyle(e)}function v(e){var t=m(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function y(e,n,o){void 0===o&&(o=!1);var i,a,f=r(n),c=r(n)&&function(e){var t=e.getBoundingClientRect(),n=s(t.width)/e.offsetWidth||1,r=s(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(n),m=d(n),y=p(e,c,o),g={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(f||!f&&!o)&&(("body"!==l(n)||v(m))&&(g=(i=n)!==t(i)&&r(i)?{scrollLeft:(a=i).scrollLeft,scrollTop:a.scrollTop}:u(i)),r(n)?((b=p(n,!0)).x+=n.clientLeft,b.y+=n.clientTop):m&&(b.x=h(m))),{x:y.left+g.scrollLeft-b.x,y:y.top+g.scrollTop-b.y,width:y.width,height:y.height}}function g(e){var t=p(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function b(e){return"html"===l(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||d(e)}function x(e){return["html","body","#document"].indexOf(l(e))>=0?e.ownerDocument.body:r(e)&&v(e)?e:x(b(e))}function w(e,n){var r;void 0===n&&(n=[]);var o=x(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=t(o),s=i?[a].concat(a.visualViewport||[],v(o)?o:[]):o,f=n.concat(s);return i?f:f.concat(w(b(s)))}function O(e){return["table","td","th"].indexOf(l(e))>=0}function j(e){return r(e)&&"fixed"!==m(e).position?e.offsetParent:null}function E(e){for(var n=t(e),i=j(e);i&&O(i)&&"static"===m(i).position;)i=j(i);return i&&("html"===l(i)||"body"===l(i)&&"static"===m(i).position)?n:i||function(e){var t=/firefox/i.test(f());if(/Trident/i.test(f())&&r(e)&&"fixed"===m(e).position)return null;var n=b(e);for(o(n)&&(n=n.host);r(n)&&["html","body"].indexOf(l(n))<0;){var i=m(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||n}var D="top",A="bottom",L="right",P="left",M="auto",k=[D,A,L,P],W="start",B="end",H="viewport",T="popper",R=k.reduce((function(e,t){return e.concat([t+"-"+W,t+"-"+B])}),[]),S=[].concat(k,[M]).reduce((function(e,t){return e.concat([t,t+"-"+W,t+"-"+B])}),[]),V=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function q(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function C(e){return e.split("-")[0]}function N(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function I(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function _(e,r,o){return r===H?I(function(e,n){var r=t(e),o=d(e),i=r.visualViewport,a=o.clientWidth,s=o.clientHeight,f=0,p=0;if(i){a=i.width,s=i.height;var u=c();(u||!u&&"fixed"===n)&&(f=i.offsetLeft,p=i.offsetTop)}return{width:a,height:s,x:f+h(e),y:p}}(e,o)):n(r)?function(e,t){var n=p(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.lLine truncated
@@ -0,0 +1,236 @@
/* quarto syntax highlight colors */
:root {
--quarto-hl-ot-color: #003B4F;
--quarto-hl-at-color: #657422;
--quarto-hl-ss-color: #20794D;
--quarto-hl-an-color: #5E5E5E;
--quarto-hl-fu-color: #4758AB;
--quarto-hl-st-color: #20794D;
--quarto-hl-cf-color: #003B4F;
--quarto-hl-op-color: #5E5E5E;
--quarto-hl-er-color: #AD0000;
--quarto-hl-bn-color: #AD0000;
--quarto-hl-al-color: #AD0000;
--quarto-hl-va-color: #111111;
--quarto-hl-bu-color: inherit;
--quarto-hl-ex-color: inherit;
--quarto-hl-pp-color: #AD0000;
--quarto-hl-in-color: #5E5E5E;
--quarto-hl-vs-color: #20794D;
--quarto-hl-wa-color: #5E5E5E;
--quarto-hl-do-color: #5E5E5E;
--quarto-hl-im-color: #00769E;
--quarto-hl-ch-color: #20794D;
--quarto-hl-dt-color: #AD0000;
--quarto-hl-fl-color: #AD0000;
--quarto-hl-co-color: #5E5E5E;
--quarto-hl-cv-color: #5E5E5E;
--quarto-hl-cn-color: #8f5902;
--quarto-hl-sc-color: #5E5E5E;
--quarto-hl-dv-color: #AD0000;
--quarto-hl-kw-color: #003B4F;
}
/* other quarto variables */
:root {
--quarto-font-monospace: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
/* syntax highlight based on Pandoc's rules */
pre > code.sourceCode > span {
color: #003B4F;
}
code.sourceCode > span {
color: #003B4F;
}
div.sourceCode,
div.sourceCode pre.sourceCode {
color: #003B4F;
}
/* Normal */
code span {
color: #003B4F;
}
/* Alert */
code span.al {
color: #AD0000;
font-style: inherit;
}
/* Annotation */
code span.an {
color: #5E5E5E;
font-style: inherit;
}
/* Attribute */
code span.at {
color: #657422;
font-style: inherit;
}
/* BaseN */
code span.bn {
color: #AD0000;
font-style: inherit;
}
/* BuiltIn */
code span.bu {
font-style: inherit;
}
/* ControlFlow */
code span.cf {
color: #003B4F;
font-weight: bold;
font-style: inherit;
}
/* Char */
code span.ch {
color: #20794D;
font-style: inherit;
}
/* Constant */
code span.cn {
color: #8f5902;
font-style: inherit;
}
/* Comment */
code span.co {
color: #5E5E5E;
font-style: inherit;
}
/* CommentVar */
code span.cv {
color: #5E5E5E;
font-style: italic;
}
/* Documentation */
code span.do {
color: #5E5E5E;
font-style: italic;
}
/* DataType */
code span.dt {
color: #AD0000;
font-style: inherit;
}
/* DecVal */
code span.dv {
color: #AD0000;
font-style: inherit;
}
/* Error */
code span.er {
color: #AD0000;
font-style: inherit;
}
/* Extension */
code span.ex {
font-style: inherit;
}
/* Float */
code span.fl {
color: #AD0000;
font-style: inherit;
}
/* Function */
code span.fu {
color: #4758AB;
font-style: inherit;
}
/* Import */
code span.im {
color: #00769E;
font-style: inherit;
}
/* Information */
code span.in {
color: #5E5E5E;
font-style: inherit;
}
/* Keyword */
code span.kw {
color: #003B4F;
font-weight: bold;
font-style: inherit;
}
/* Operator */
code span.op {
color: #5E5E5E;
font-style: inherit;
}
/* Other */
code span.ot {
color: #003B4F;
font-style: inherit;
}
/* Preprocessor */
code span.pp {
color: #AD0000;
font-style: inherit;
}
/* SpecialChar */
code span.sc {
color: #5E5E5E;
font-style: inherit;
}
/* SpecialString */
code span.ss {
color: #20794D;
font-style: inherit;
}
/* String */
code span.st {
color: #20794D;
font-style: inherit;
}
/* Variable */
code span.va {
color: #111111;
font-style: inherit;
}
/* VerbatimString */
code span.vs {
color: #20794D;
font-style: inherit;
}
/* Warning */
code span.wa {
color: #5E5E5E;
font-style: italic;
}
.prevent-inlining {
content: "</";
}
/*# sourceMappingURL=39d13593ecb7db6d02e40e1582482a0e.css.map */
+845
View File
@@ -0,0 +1,845 @@
import * as tabsets from "./tabsets/tabsets.js";
const sectionChanged = new CustomEvent("quarto-sectionChanged", {
detail: {},
bubbles: true,
cancelable: false,
composed: false,
});
const layoutMarginEls = () => {
// Find any conflicting margin elements and add margins to the
// top to prevent overlap
const marginChildren = window.document.querySelectorAll(
".column-margin.column-container > *, .margin-caption, .aside"
);
let lastBottom = 0;
for (const marginChild of marginChildren) {
if (marginChild.offsetParent !== null) {
// clear the top margin so we recompute it
marginChild.style.marginTop = null;
const top = marginChild.getBoundingClientRect().top + window.scrollY;
if (top < lastBottom) {
const marginChildStyle = window.getComputedStyle(marginChild);
const marginBottom = parseFloat(marginChildStyle["marginBottom"]);
const margin = lastBottom - top + marginBottom;
marginChild.style.marginTop = `${margin}px`;
}
const styles = window.getComputedStyle(marginChild);
const marginTop = parseFloat(styles["marginTop"]);
lastBottom = top + marginChild.getBoundingClientRect().height + marginTop;
}
}
};
window.document.addEventListener("DOMContentLoaded", function (_event) {
// Recompute the position of margin elements anytime the body size changes
if (window.ResizeObserver) {
const resizeObserver = new window.ResizeObserver(
throttle(() => {
layoutMarginEls();
if (
window.document.body.getBoundingClientRect().width < 990 &&
isReaderMode()
) {
quartoToggleReader();
}
}, 50)
);
resizeObserver.observe(window.document.body);
}
const tocEl = window.document.querySelector('nav.toc-active[role="doc-toc"]');
const sidebarEl = window.document.getElementById("quarto-sidebar");
const leftTocEl = window.document.getElementById("quarto-sidebar-toc-left");
const marginSidebarEl = window.document.getElementById(
"quarto-margin-sidebar"
);
// function to determine whether the element has a previous sibling that is active
const prevSiblingIsActiveLink = (el) => {
const sibling = el.previousElementSibling;
if (sibling && sibling.tagName === "A") {
return sibling.classList.contains("active");
} else {
return false;
}
};
// dispatch for htmlwidgets
// they use slideenter event to trigger resize
function fireSlideEnter() {
const event = window.document.createEvent("Event");
event.initEvent("slideenter", true, true);
window.document.dispatchEvent(event);
}
const tabs = window.document.querySelectorAll('a[data-bs-toggle="tab"]');
tabs.forEach((tab) => {
tab.addEventListener("shown.bs.tab", fireSlideEnter);
});
// dispatch for shiny
// they use BS shown and hidden events to trigger rendering
function distpatchShinyEvents(previous, current) {
if (window.jQuery) {
if (previous) {
window.jQuery(previous).trigger("hidden");
}
if (current) {
window.jQuery(current).trigger("shown");
}
}
}
// tabby.js listener: Trigger event for htmlwidget and shiny
document.addEventListener(
"tabby",
function (event) {
fireSlideEnter();
distpatchShinyEvents(event.detail.previousTab, event.detail.tab);
},
false
);
// Track scrolling and mark TOC links as active
// get table of contents and sidebar (bail if we don't have at least one)
const tocLinks = tocEl
? [...tocEl.querySelectorAll("a[data-scroll-target]")]
: [];
const makeActive = (link) => tocLinks[link].classList.add("active");
const removeActive = (link) => tocLinks[link].classList.remove("active");
const removeAllActive = () =>
[...Array(tocLinks.length).keys()].forEach((link) => removeActive(link));
// activate the anchor for a section associated with this TOC entry
tocLinks.forEach((link) => {
link.addEventListener("click", () => {
if (link.href.indexOf("#") !== -1) {
const anchor = link.href.split("#")[1];
const heading = window.document.querySelector(
`[data-anchor-id="${anchor}"]`
);
if (heading) {
// Add the class
heading.classList.add("reveal-anchorjs-link");
// function to show the anchor
const handleMouseout = () => {
heading.classList.remove("reveal-anchorjs-link");
heading.removeEventListener("mouseout", handleMouseout);
};
// add a function to clear the anchor when the user mouses out of it
heading.addEventListener("mouseout", handleMouseout);
}
}
});
});
const sections = tocLinks.map((link) => {
const target = link.getAttribute("data-scroll-target");
if (target.startsWith("#")) {
return window.document.getElementById(decodeURI(`${target.slice(1)}`));
} else {
return window.document.querySelector(decodeURI(`${target}`));
}
});
const sectionMargin = 200;
let currentActive = 0;
// track whether we've initialized state the first time
let init = false;
const updateActiveLink = () => {
// The index from bottom to top (e.g. reversed list)
let sectionIndex = -1;
if (
window.innerHeight + window.pageYOffset >=
window.document.body.offsetHeight
) {
// This is the no-scroll case where last section should be the active one
sectionIndex = 0;
} else {
// This finds the last section visible on screen that should be made active
sectionIndex = [...sections].reverse().findIndex((section) => {
if (section) {
return window.pageYOffset >= section.offsetTop - sectionMargin;
} else {
return false;
}
});
}
if (sectionIndex > -1) {
const current = sections.length - sectionIndex - 1;
if (current !== currentActive) {
removeAllActive();
currentActive = current;
makeActive(current);
if (init) {
window.dispatchEvent(sectionChanged);
}
init = true;
}
}
};
const inHiddenRegion = (top, bottom, hiddenRegions) => {
for (const region of hiddenRegions) {
if (top <= region.bottom && bottom >= region.top) {
return true;
}
}
return false;
};
const categorySelector = "header.quarto-title-block .quarto-category";
const activateCategories = (href) => {
// Find any categories
// Surround them with a link pointing back to:
// #category=Authoring
try {
const categoryEls = window.document.querySelectorAll(categorySelector);
for (const categoryEl of categoryEls) {
const categoryText = categoryEl.textContent;
if (categoryText) {
const link = `${href}#category=${encodeURIComponent(categoryText)}`;
const linkEl = window.document.createElement("a");
linkEl.setAttribute("href", link);
for (const child of categoryEl.childNodes) {
linkEl.append(child);
}
categoryEl.appendChild(linkEl);
}
}
} catch {
// Ignore errors
}
};
function hasTitleCategories() {
return window.document.querySelector(categorySelector) !== null;
}
function offsetRelativeUrl(url) {
const offset = getMeta("quarto:offset");
return offset ? offset + url : url;
}
function offsetAbsoluteUrl(url) {
const offset = getMeta("quarto:offset");
const baseUrl = new URL(offset, window.location);
const projRelativeUrl = url.replace(baseUrl, "");
if (projRelativeUrl.startsWith("/")) {
return projRelativeUrl;
} else {
return "/" + projRelativeUrl;
}
}
// read a meta tag value
function getMeta(metaName) {
const metas = window.document.getElementsByTagName("meta");
for (let i = 0; i < metas.length; i++) {
if (metas[i].getAttribute("name") === metaName) {
return metas[i].getAttribute("content");
}
}
return "";
}
async function findAndActivateCategories() {
// Categories search with listing only use path without query
const currentPagePath = offsetAbsoluteUrl(
window.location.origin + window.location.pathname
);
const response = await fetch(offsetRelativeUrl("listings.json"));
if (response.status == 200) {
return response.json().then(function (listingPaths) {
const listingHrefs = [];
for (const listingPath of listingPaths) {
const pathWithoutLeadingSlash = listingPath.listing.substring(1);
for (const item of listingPath.items) {
const encodedItem = encodeURI(item);
if (
encodedItem === currentPagePath ||
encodedItem === currentPagePath + "index.html"
) {
// Resolve this path against the offset to be sure
// we already are using the correct path to the listing
// (this adjusts the listing urls to be rooted against
// whatever root the page is actually running against)
const relative = offsetRelativeUrl(pathWithoutLeadingSlash);
const baseUrl = window.location;
const resolvedPath = new URL(relative, baseUrl);
listingHrefs.push(resolvedPath.pathname);
break;
}
}
}
// Look up the tree for a nearby linting and use that if we find one
const nearestListing = findNearestParentListing(
offsetAbsoluteUrl(window.location.pathname),
listingHrefs
);
if (nearestListing) {
activateCategories(nearestListing);
} else {
// See if the referrer is a listing page for this item
const referredRelativePath = offsetAbsoluteUrl(document.referrer);
const referrerListing = listingHrefs.find((listingHref) => {
const isListingReferrer =
listingHref === referredRelativePath ||
listingHref === referredRelativePath + "index.html";
return isListingReferrer;
});
if (referrerListing) {
// Try to use the referrer if possible
activateCategories(referrerListing);
} else if (listingHrefs.length > 0) {
// Otherwise, just fall back to the first listing
activateCategories(listingHrefs[0]);
}
}
});
}
}
if (hasTitleCategories()) {
findAndActivateCategories();
}
const findNearestParentListing = (href, listingHrefs) => {
if (!href || !listingHrefs) {
return undefined;
}
// Look up the tree for a nearby linting and use that if we find one
const relativeParts = href.substring(1).split("/");
while (relativeParts.length > 0) {
const path = relativeParts.join("/");
for (const listingHref of listingHrefs) {
if (listingHref.startsWith(path)) {
return listingHref;
}
}
relativeParts.pop();
}
return undefined;
};
const manageSidebarVisiblity = (el, placeholderDescriptor) => {
let isVisible = true;
let elRect;
return (hiddenRegions) => {
if (el === null) {
return;
}
// Find the last element of the TOC
const lastChildEl = el.lastElementChild;
if (lastChildEl) {
// Converts the sidebar to a menu
const convertToMenu = () => {
for (const child of el.children) {
child.style.opacity = 0;
child.style.overflow = "hidden";
child.style.pointerEvents = "none";
}
nexttick(() => {
const toggleContainer = window.document.createElement("div");
toggleContainer.style.width = "100%";
toggleContainer.classList.add("zindex-over-content");
toggleContainer.classList.add("quarto-sidebar-toggle");
toggleContainer.classList.add("headroom-target"); // Marks this to be managed by headeroom
toggleContainer.id = placeholderDescriptor.id;
toggleContainer.style.position = "fixed";
const toggleIcon = window.document.createElement("i");
toggleIcon.classList.add("quarto-sidebar-toggle-icon");
toggleIcon.classList.add("bi");
toggleIcon.classList.add("bi-caret-down-fill");
const toggleTitle = window.document.createElement("div");
const titleEl = window.document.body.querySelector(
placeholderDescriptor.titleSelector
);
if (titleEl) {
toggleTitle.append(
titleEl.textContent || titleEl.innerText,
toggleIcon
);
}
toggleTitle.classList.add("zindex-over-content");
toggleTitle.classList.add("quarto-sidebar-toggle-title");
toggleContainer.append(toggleTitle);
const toggleContents = window.document.createElement("div");
toggleContents.classList = el.classList;
toggleContents.classList.add("zindex-over-content");
toggleContents.classList.add("quarto-sidebar-toggle-contents");
for (const child of el.children) {
if (child.id === "toc-title") {
continue;
}
const clone = child.cloneNode(true);
clone.style.opacity = 1;
clone.style.pointerEvents = null;
clone.style.display = null;
toggleContents.append(clone);
}
toggleContents.style.height = "0px";
const positionToggle = () => {
// position the element (top left of parent, same width as parent)
if (!elRect) {
elRect = el.getBoundingClientRect();
}
toggleContainer.style.left = `${elRect.left}px`;
toggleContainer.style.top = `${elRect.top}px`;
toggleContainer.style.width = `${elRect.width}px`;
};
positionToggle();
toggleContainer.append(toggleContents);
el.parentElement.prepend(toggleContainer);
// Process clicks
let tocShowing = false;
// Allow the caller to control whether this is dismissed
// when it is clicked (e.g. sidebar navigation supports
// opening and closing the nav tree, so don't dismiss on click)
const clickEl = placeholderDescriptor.dismissOnClick
? toggleContainer
: toggleTitle;
const closeToggle = () => {
if (tocShowing) {
toggleContainer.classList.remove("expanded");
toggleContents.style.height = "0px";
tocShowing = false;
}
};
// Get rid of any expanded toggle if the user scrolls
window.document.addEventListener(
"scroll",
throttle(() => {
closeToggle();
}, 50)
);
// Handle positioning of the toggle
window.addEventListener(
"resize",
throttle(() => {
elRect = undefined;
positionToggle();
}, 50)
);
window.addEventListener("quarto-hrChanged", () => {
elRect = undefined;
});
// Process the click
clickEl.onclick = () => {
if (!tocShowing) {
toggleContainer.classList.add("expanded");
toggleContents.style.height = null;
tocShowing = true;
} else {
closeToggle();
}
};
});
};
// Converts a sidebar from a menu back to a sidebar
const convertToSidebar = () => {
for (const child of el.children) {
child.style.opacity = 1;
child.style.overflow = null;
child.style.pointerEvents = null;
}
const placeholderEl = window.document.getElementById(
placeholderDescriptor.id
);
if (placeholderEl) {
placeholderEl.remove();
}
el.classList.remove("rollup");
};
if (isReaderMode()) {
convertToMenu();
isVisible = false;
} else {
// Find the top and bottom o the element that is being managed
const elTop = el.offsetTop;
const elBottom =
elTop + lastChildEl.offsetTop + lastChildEl.offsetHeight;
if (!isVisible) {
// If the element is current not visible reveal if there are
// no conflicts with overlay regions
if (!inHiddenRegion(elTop, elBottom, hiddenRegions)) {
convertToSidebar();
isVisible = true;
}
} else {
// If the element is visible, hide it if it conflicts with overlay regions
// and insert a placeholder toggle (or if we're in reader mode)
if (inHiddenRegion(elTop, elBottom, hiddenRegions)) {
convertToMenu();
isVisible = false;
}
}
}
}
};
};
const tabEls = document.querySelectorAll('a[data-bs-toggle="tab"]');
for (const tabEl of tabEls) {
const id = tabEl.getAttribute("data-bs-target");
if (id) {
const columnEl = document.querySelector(
`${id} .column-margin, .tabset-margin-content`
);
if (columnEl)
tabEl.addEventListener("shown.bs.tab", function (event) {
const el = event.srcElement;
if (el) {
const visibleCls = `${el.id}-margin-content`;
// walk up until we find a parent tabset
let panelTabsetEl = el.parentElement;
while (panelTabsetEl) {
if (panelTabsetEl.classList.contains("panel-tabset")) {
break;
}
panelTabsetEl = panelTabsetEl.parentElement;
}
if (panelTabsetEl) {
const prevSib = panelTabsetEl.previousElementSibling;
if (
prevSib &&
prevSib.classList.contains("tabset-margin-container")
) {
const childNodes = prevSib.querySelectorAll(
".tabset-margin-content"
);
for (const childEl of childNodes) {
if (childEl.classList.contains(visibleCls)) {
childEl.classList.remove("collapse");
} else {
childEl.classList.add("collapse");
}
}
}
}
}
layoutMarginEls();
});
}
}
// Manage the visibility of the toc and the sidebar
const marginScrollVisibility = manageSidebarVisiblity(marginSidebarEl, {
id: "quarto-toc-toggle",
titleSelector: "#toc-title",
dismissOnClick: true,
});
const sidebarScrollVisiblity = manageSidebarVisiblity(sidebarEl, {
id: "quarto-sidebarnav-toggle",
titleSelector: ".title",
dismissOnClick: false,
});
let tocLeftScrollVisibility;
if (leftTocEl) {
tocLeftScrollVisibility = manageSidebarVisiblity(leftTocEl, {
id: "quarto-lefttoc-toggle",
titleSelector: "#toc-title",
dismissOnClick: true,
});
}
// Find the first element that uses formatting in special columns
const conflictingEls = window.document.body.querySelectorAll(
'[class^="column-"], [class*=" column-"], aside, [class*="margin-caption"], [class*=" margin-caption"], [class*="margin-ref"], [class*=" margin-ref"]'
);
// Filter all the possibly conflicting elements into ones
// the do conflict on the left or ride side
const arrConflictingEls = Array.from(conflictingEls);
const leftSideConflictEls = arrConflictingEls.filter((el) => {
if (el.tagName === "ASIDE") {
return false;
}
return Array.from(el.classList).find((className) => {
return (
className !== "column-body" &&
className.startsWith("column-") &&
!className.endsWith("right") &&
!className.endsWith("container") &&
className !== "column-margin"
);
});
});
const rightSideConflictEls = arrConflictingEls.filter((el) => {
if (el.tagName === "ASIDE") {
return true;
}
const hasMarginCaption = Array.from(el.classList).find((className) => {
return className == "margin-caption";
});
if (hasMarginCaption) {
return true;
}
return Array.from(el.classList).find((className) => {
return (
className !== "column-body" &&
!className.endsWith("container") &&
className.startsWith("column-") &&
!className.endsWith("left")
);
});
});
const kOverlapPaddingSize = 10;
function toRegions(els) {
return els.map((el) => {
const boundRect = el.getBoundingClientRect();
const top =
boundRect.top +
document.documentElement.scrollTop -
kOverlapPaddingSize;
return {
top,
bottom: top + el.scrollHeight + 2 * kOverlapPaddingSize,
};
});
}
let hasObserved = false;
const visibleItemObserver = (els) => {
let visibleElements = [...els];
const intersectionObserver = new IntersectionObserver(
(entries, _observer) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
if (visibleElements.indexOf(entry.target) === -1) {
visibleElements.push(entry.target);
}
} else {
visibleElements = visibleElements.filter((visibleEntry) => {
return visibleEntry !== entry;
});
}
});
if (!hasObserved) {
hideOverlappedSidebars();
}
hasObserved = true;
},
{}
);
els.forEach((el) => {
intersectionObserver.observe(el);
});
return {
getVisibleEntries: () => {
return visibleElements;
},
};
};
const rightElementObserver = visibleItemObserver(rightSideConflictEls);
const leftElementObserver = visibleItemObserver(leftSideConflictEls);
const hideOverlappedSidebars = () => {
marginScrollVisibility(toRegions(rightElementObserver.getVisibleEntries()));
sidebarScrollVisiblity(toRegions(leftElementObserver.getVisibleEntries()));
if (tocLeftScrollVisibility) {
tocLeftScrollVisibility(
toRegions(leftElementObserver.getVisibleEntries())
);
}
};
window.quartoToggleReader = () => {
// Applies a slow class (or removes it)
// to update the transition speed
const slowTransition = (slow) => {
const manageTransition = (id, slow) => {
const el = document.getElementById(id);
if (el) {
if (slow) {
el.classList.add("slow");
} else {
el.classList.remove("slow");
}
}
};
manageTransition("TOC", slow);
manageTransition("quarto-sidebar", slow);
};
const readerMode = !isReaderMode();
setReaderModeValue(readerMode);
// If we're entering reader mode, slow the transition
if (readerMode) {
slowTransition(readerMode);
}
highlightReaderToggle(readerMode);
hideOverlappedSidebars();
// If we're exiting reader mode, restore the non-slow transition
if (!readerMode) {
slowTransition(!readerMode);
}
};
const highlightReaderToggle = (readerMode) => {
const els = document.querySelectorAll(".quarto-reader-toggle");
if (els) {
els.forEach((el) => {
if (readerMode) {
el.classList.add("reader");
} else {
el.classList.remove("reader");
}
});
}
};
const setReaderModeValue = (val) => {
if (window.location.protocol !== "file:") {
window.localStorage.setItem("quarto-reader-mode", val);
} else {
localReaderMode = val;
}
};
const isReaderMode = () => {
if (window.location.protocol !== "file:") {
return window.localStorage.getItem("quarto-reader-mode") === "true";
} else {
return localReaderMode;
}
};
let localReaderMode = null;
const tocOpenDepthStr = tocEl?.getAttribute("data-toc-expanded");
const tocOpenDepth = tocOpenDepthStr ? Number(tocOpenDepthStr) : 1;
// Walk the TOC and collapse/expand nodes
// Nodes are expanded if:
// - they are top level
// - they have children that are 'active' links
// - they are directly below an link that is 'active'
const walk = (el, depth) => {
// Tick depth when we enter a UL
if (el.tagName === "UL") {
depth = depth + 1;
}
// It this is active link
let isActiveNode = false;
if (el.tagName === "A" && el.classList.contains("active")) {
isActiveNode = true;
}
// See if there is an active child to this element
let hasActiveChild = false;
for (const child of el.children) {
hasActiveChild = walk(child, depth) || hasActiveChild;
}
// Process the collapse state if this is an UL
if (el.tagName === "UL") {
if (tocOpenDepth === -1 && depth > 1) {
// toc-expand: false
el.classList.add("collapse");
} else if (
depth <= tocOpenDepth ||
hasActiveChild ||
prevSiblingIsActiveLink(el)
) {
el.classList.remove("collapse");
} else {
el.classList.add("collapse");
}
// untick depth when we leave a UL
depth = depth - 1;
}
return hasActiveChild || isActiveNode;
};
// walk the TOC and expand / collapse any items that should be shown
if (tocEl) {
updateActiveLink();
walk(tocEl, 0);
}
// Throttle the scroll event and walk peridiocally
window.document.addEventListener(
"scroll",
throttle(() => {
if (tocEl) {
updateActiveLink();
walk(tocEl, 0);
}
if (!isReaderMode()) {
hideOverlappedSidebars();
}
}, 5)
);
window.addEventListener(
"resize",
throttle(() => {
if (tocEl) {
updateActiveLink();
walk(tocEl, 0);
}
if (!isReaderMode()) {
hideOverlappedSidebars();
}
}, 10)
);
hideOverlappedSidebars();
highlightReaderToggle(isReaderMode());
});
tabsets.init();
function throttle(func, wait) {
let waiting = false;
return function () {
if (!waiting) {
func.apply(this, arguments);
waiting = true;
setTimeout(function () {
waiting = false;
}, wait);
}
};
}
function nexttick(func) {
return setTimeout(func, 0);
}
@@ -0,0 +1,95 @@
// grouped tabsets
export function init() {
window.addEventListener("pageshow", (_event) => {
function getTabSettings() {
const data = localStorage.getItem("quarto-persistent-tabsets-data");
if (!data) {
localStorage.setItem("quarto-persistent-tabsets-data", "{}");
return {};
}
if (data) {
return JSON.parse(data);
}
}
function setTabSettings(data) {
localStorage.setItem(
"quarto-persistent-tabsets-data",
JSON.stringify(data)
);
}
function setTabState(groupName, groupValue) {
const data = getTabSettings();
data[groupName] = groupValue;
setTabSettings(data);
}
function toggleTab(tab, active) {
const tabPanelId = tab.getAttribute("aria-controls");
const tabPanel = document.getElementById(tabPanelId);
if (active) {
tab.classList.add("active");
tabPanel.classList.add("active");
} else {
tab.classList.remove("active");
tabPanel.classList.remove("active");
}
}
function toggleAll(selectedGroup, selectorsToSync) {
for (const [thisGroup, tabs] of Object.entries(selectorsToSync)) {
const active = selectedGroup === thisGroup;
for (const tab of tabs) {
toggleTab(tab, active);
}
}
}
function findSelectorsToSyncByLanguage() {
const result = {};
const tabs = Array.from(
document.querySelectorAll(`div[data-group] a[id^='tabset-']`)
);
for (const item of tabs) {
const div = item.parentElement.parentElement.parentElement;
const group = div.getAttribute("data-group");
if (!result[group]) {
result[group] = {};
}
const selectorsToSync = result[group];
const value = item.innerHTML;
if (!selectorsToSync[value]) {
selectorsToSync[value] = [];
}
selectorsToSync[value].push(item);
}
return result;
}
function setupSelectorSync() {
const selectorsToSync = findSelectorsToSyncByLanguage();
Object.entries(selectorsToSync).forEach(([group, tabSetsByValue]) => {
Object.entries(tabSetsByValue).forEach(([value, items]) => {
items.forEach((item) => {
item.addEventListener("click", (_event) => {
setTabState(group, value);
toggleAll(value, selectorsToSync[group]);
});
});
});
});
return selectorsToSync;
}
const selectorsToSync = setupSelectorSync();
for (const [group, selectedName] of Object.entries(getTabSettings())) {
const selectors = selectorsToSync[group];
// it's possible that stale state gives us empty selections, so we explicitly check here.
if (selectors) {
toggleAll(selectedName, selectors);
}
}
});
}
+1
View File
@@ -0,0 +1 @@
.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}
+2
View File
@@ -0,0 +1,2 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],t):(e=e||self).tippy=t(e.Popper)}(this,(function(e){"use strict";var t={passive:!0,capture:!0},n=function(){return document.body};function r(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function o(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function i(e,t){return"function"==typeof e?e.apply(void 0,t):e}function a(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function s(e,t){var n=Object.assign({},e);return t.forEach((function(e){delete n[e]})),n}function u(e){return[].concat(e)}function c(e,t){-1===e.indexOf(t)&&e.push(t)}function p(e){return e.split("-")[0]}function f(e){return[].slice.call(e)}function l(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function d(){return document.createElement("div")}function v(e){return["Element","Fragment"].some((function(t){return o(e,t)}))}function m(e){return o(e,"MouseEvent")}function g(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function h(e){return v(e)?[e]:function(e){return o(e,"NodeList")}(e)?f(e):Array.isArray(e)?e:f(document.querySelectorAll(e))}function b(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function y(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function w(e){var t,n=u(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function E(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function O(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var x={isTouch:!1},C=0;function T(){x.isTouch||(x.isTouch=!0,window.performance&&document.addEventListener("mousemove",A))}function A(){var e=performance.now();e-C<20&&(x.isTouch=!1,document.removeEventListener("mousemove",A)),C=e}function L(){var e=document.activeElement;if(g(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var D=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,R=Object.assign({appendTo:n,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),k=Object.keys(R);function P(e){var t=(e.plugins||[]).reduce((function(t,n){var r,o=n.name,i=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(r=R[o])?r:i);return t}),{});return Object.assign({},e,t)}function j(e,t){var n=Object.assign({},t,{content:i(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(P(Object.assign({},R,{plugins:t}))):k).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},R.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function M(e,t){e.innerHTML=t}function V(e){var t=d();return!0===e?t.className="tippy-arrow":(t.className="tippy-svg-arrow",v(e)?t.appendChild(e):M(t,e)),t}function I(e,t){v(t.content)?(M(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?M(e,t.content):e.textContent=t.content)}function S(e){var t=e.firstElementChild,n=f(t.children);return{box:t,content:n.find((function(e){return e.classList.contains("tippy-content")})),arrow:n.find((function(e){return e.classList.contains("tippy-arrow")||e.classList.contains("tippy-svg-arrow")})),backdrop:n.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function N(e){var t=d(),n=d();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=d();function o(n,r){var o=S(t),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==tyLine truncated
+1
View File
@@ -0,0 +1 @@
!function(t,e){"function"==typeof define&&define.amd?define([],e()):"object"==typeof module&&module.exports?module.exports=e():function n(){document&&document.body?t.zenscroll=e():setTimeout(n,9)}()}(this,function(){"use strict";var t=function(t){return t&&"getComputedStyle"in window&&"smooth"===window.getComputedStyle(t)["scroll-behavior"]};if("undefined"==typeof window||!("document"in window))return{};var e=function(e,n,o){n=n||999,o||0===o||(o=9);var i,r=function(t){i=t},u=function(){clearTimeout(i),r(0)},c=function(t){return Math.max(0,e.getTopOf(t)-o)},a=function(o,i,c){if(u(),0===i||i&&i<0||t(e.body))e.toY(o),c&&c();else{var a=e.getY(),f=Math.max(0,o)-a,s=(new Date).getTime();i=i||Math.min(Math.abs(f),n),function t(){r(setTimeout(function(){var n=Math.min(1,((new Date).getTime()-s)/i),o=Math.max(0,Math.floor(a+f*(n<.5?2*n*n:n*(4-2*n)-1)));e.toY(o),n<1&&e.getHeight()+o<e.body.scrollHeight?t():(setTimeout(u,99),c&&c())},9))}()}},f=function(t,e,n){a(c(t),e,n)},s=function(t,n,i){var r=t.getBoundingClientRect().height,u=e.getTopOf(t)+r,s=e.getHeight(),l=e.getY(),d=l+s;c(t)<l||r+o>s?f(t,n,i):u+o>d?a(u-s+o,n,i):i&&i()},l=function(t,n,o,i){a(Math.max(0,e.getTopOf(t)-e.getHeight()/2+(o||t.getBoundingClientRect().height/2)),n,i)};return{setup:function(t,e){return(0===t||t)&&(n=t),(0===e||e)&&(o=e),{defaultDuration:n,edgeOffset:o}},to:f,toY:a,intoView:s,center:l,stop:u,moving:function(){return!!i},getY:e.getY,getTopOf:e.getTopOf}},n=document.documentElement,o=function(){return window.scrollY||n.scrollTop},i=e({body:document.scrollingElement||document.body,toY:function(t){window.scrollTo(0,t)},getY:o,getHeight:function(){return window.innerHeight||n.clientHeight},getTopOf:function(t){return t.getBoundingClientRect().top+o()-n.offsetTop}});if(i.createScroller=function(t,o,i){return e({body:t,toY:function(e){t.scrollTop=e},getY:function(){return t.scrollTop},getHeight:function(){return Math.min(t.clientHeight,window.innerHeight||n.clientHeight)},getTopOf:function(t){return t.offsetTop}},o,i)},"addEventListener"in window&&!window.noZensmooth&&!t(document.body)){var r="history"in window&&"pushState"in history,u=r&&"scrollRestoration"in history;u&&(history.scrollRestoration="auto"),window.addEventListener("load",function(){u&&(setTimeout(function(){history.scrollRestoration="manual"},9),window.addEventListener("popstate",function(t){t.state&&"zenscrollY"in t.state&&i.toY(t.state.zenscrollY)},!1)),window.location.hash&&setTimeout(function(){var t=i.setup().edgeOffset;if(t){var e=document.getElementById(window.location.href.split("#")[1]);if(e){var n=Math.max(0,i.getTopOf(e)-t),o=i.getY()-n;0<=o&&o<9&&window.scrollTo(0,n)}}},9)},!1);var c=new RegExp("(^|\\s)noZensmooth(\\s|$)");window.addEventListener("click",function(t){for(var e=t.target;e&&"A"!==e.tagName;)e=e.parentNode;if(!(!e||1!==t.which||t.shiftKey||t.metaKey||t.ctrlKey||t.altKey)){if(u){var n=history.state&&"object"==typeof history.state?history.state:{};n.zenscrollY=i.getY();try{history.replaceState(n,"")}catch(t){}}var o=e.getAttribute("href")||"";if(0===o.indexOf("#")&&!c.test(e.className)){var a=0,f=document.getElementById(o.substring(1));if("#"!==o){if(!f)return;a=i.getTopOf(f)}t.preventDefault();var s=function(){window.location=o},l=i.setup().edgeOffset;l&&(a=Math.max(0,a-l),r&&(s=function(){history.pushState({},"",o)})),i.toY(a,null,s)}}},!1)}return i});
+7
View File
@@ -0,0 +1,7 @@
/*!
* headroom.js v0.12.0 - Give your page some headroom. Hide your header until you need it
* Copyright (c) 2020 Nick Williams - http://wicky.nillia.ms/headroom.js
* License: MIT
*/
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).Headroom=n()}(this,function(){"use strict";function t(){return"undefined"!=typeof window}function d(t){return function(t){return t&&t.document&&function(t){return 9===t.nodeType}(t.document)}(t)?function(t){var n=t.document,o=n.body,s=n.documentElement;return{scrollHeight:function(){return Math.max(o.scrollHeight,s.scrollHeight,o.offsetHeight,s.offsetHeight,o.clientHeight,s.clientHeight)},height:function(){return t.innerHeight||s.clientHeight||o.clientHeight},scrollY:function(){return void 0!==t.pageYOffset?t.pageYOffset:(s||o.parentNode||o).scrollTop}}}(t):function(t){return{scrollHeight:function(){return Math.max(t.scrollHeight,t.offsetHeight,t.clientHeight)},height:function(){return Math.max(t.offsetHeight,t.clientHeight)},scrollY:function(){return t.scrollTop}}}(t)}function n(t,s,e){var n,o=function(){var n=!1;try{var t={get passive(){n=!0}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){n=!1}return n}(),i=!1,r=d(t),l=r.scrollY(),a={};function c(){var t=Math.round(r.scrollY()),n=r.height(),o=r.scrollHeight();a.scrollY=t,a.lastScrollY=l,a.direction=l<t?"down":"up",a.distance=Math.abs(t-l),a.isOutOfBounds=t<0||o<t+n,a.top=t<=s.offset[a.direction],a.bottom=o<=t+n,a.toleranceExceeded=a.distance>s.tolerance[a.direction],e(a),l=t,i=!1}function h(){i||(i=!0,n=requestAnimationFrame(c))}var u=!!o&&{passive:!0,capture:!1};return t.addEventListener("scroll",h,u),c(),{destroy:function(){cancelAnimationFrame(n),t.removeEventListener("scroll",h,u)}}}function o(t){return t===Object(t)?t:{down:t,up:t}}function s(t,n){n=n||{},Object.assign(this,s.options,n),this.classes=Object.assign({},s.options.classes,n.classes),this.elem=t,this.tolerance=o(this.tolerance),this.offset=o(this.offset),this.initialised=!1,this.frozen=!1}return s.prototype={constructor:s,init:function(){return s.cutsTheMustard&&!this.initialised&&(this.addClass("initial"),this.initialised=!0,setTimeout(function(t){t.scrollTracker=n(t.scroller,{offset:t.offset,tolerance:t.tolerance},t.update.bind(t))},100,this)),this},destroy:function(){this.initialised=!1,Object.keys(this.classes).forEach(this.removeClass,this),this.scrollTracker.destroy()},unpin:function(){!this.hasClass("pinned")&&this.hasClass("unpinned")||(this.addClass("unpinned"),this.removeClass("pinned"),this.onUnpin&&this.onUnpin.call(this))},pin:function(){this.hasClass("unpinned")&&(this.addClass("pinned"),this.removeClass("unpinned"),this.onPin&&this.onPin.call(this))},freeze:function(){this.frozen=!0,this.addClass("frozen")},unfreeze:function(){this.frozen=!1,this.removeClass("frozen")},top:function(){this.hasClass("top")||(this.addClass("top"),this.removeClass("notTop"),this.onTop&&this.onTop.call(this))},notTop:function(){this.hasClass("notTop")||(this.addClass("notTop"),this.removeClass("top"),this.onNotTop&&this.onNotTop.call(this))},bottom:function(){this.hasClass("bottom")||(this.addClass("bottom"),this.removeClass("notBottom"),this.onBottom&&this.onBottom.call(this))},notBottom:function(){this.hasClass("notBottom")||(this.addClass("notBottom"),this.removeClass("bottom"),this.onNotBottom&&this.onNotBottom.call(this))},shouldUnpin:function(t){return"down"===t.direction&&!t.top&&t.toleranceExceeded},shouldPin:function(t){return"up"===t.direction&&t.toleranceExceeded||t.top},addClass:function(t){this.elem.classList.add.apply(this.elem.classList,this.classes[t].split(" "))},removeClass:function(t){this.elem.classList.remove.apply(this.elem.classList,this.classes[t].split(" "))},hasClass:function(t){return this.classes[t].split(" ").every(function(t){return this.classList.contains(t)},this.elem)},update:function(t){t.isOutOfBounds||!0!==this.frozen&&(t.top?this.top():this.notTop(),t.bottom?this.bottom():this.notBottom(),this.shouldUnpin(t)?this.unpin():this.shouldPin(t)&&this.pin())}},s.options={tolerance:{up:0,down:0},offset:0,scroller:t()?window:null,classes:{frozen:"headroom--frozen",pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},s.cutsTheMustard=!!(t()&&function(){}.bind&&"classList"in document.documentElement&&Object.assign&&Object.keys&&requestAnimationFrame),s});
+328
View File
@@ -0,0 +1,328 @@
const headroomChanged = new CustomEvent("quarto-hrChanged", {
detail: {},
bubbles: true,
cancelable: false,
composed: false,
});
const announceDismiss = () => {
const annEl = window.document.getElementById("quarto-announcement");
if (annEl) {
annEl.remove();
const annId = annEl.getAttribute("data-announcement-id");
window.localStorage.setItem(`quarto-announce-${annId}`, "true");
}
};
const announceRegister = () => {
const annEl = window.document.getElementById("quarto-announcement");
if (annEl) {
const annId = annEl.getAttribute("data-announcement-id");
const isDismissed =
window.localStorage.getItem(`quarto-announce-${annId}`) || false;
if (isDismissed) {
announceDismiss();
return;
} else {
annEl.classList.remove("hidden");
}
const actionEl = annEl.querySelector(".quarto-announcement-action");
if (actionEl) {
actionEl.addEventListener("click", function (e) {
e.preventDefault();
// Hide the bar immediately
announceDismiss();
});
}
}
};
window.document.addEventListener("DOMContentLoaded", function () {
let init = false;
announceRegister();
// Manage the back to top button, if one is present.
let lastScrollTop = window.pageYOffset || document.documentElement.scrollTop;
const scrollDownBuffer = 5;
const scrollUpBuffer = 35;
const btn = document.getElementById("quarto-back-to-top");
const hideBackToTop = () => {
btn.style.display = "none";
};
const showBackToTop = () => {
btn.style.display = "inline-block";
};
if (btn) {
window.document.addEventListener(
"scroll",
function () {
const currentScrollTop =
window.pageYOffset || document.documentElement.scrollTop;
// Shows and hides the button 'intelligently' as the user scrolls
if (currentScrollTop - scrollDownBuffer > lastScrollTop) {
hideBackToTop();
lastScrollTop = currentScrollTop <= 0 ? 0 : currentScrollTop;
} else if (currentScrollTop < lastScrollTop - scrollUpBuffer) {
showBackToTop();
lastScrollTop = currentScrollTop <= 0 ? 0 : currentScrollTop;
}
// Show the button at the bottom, hides it at the top
if (currentScrollTop <= 0) {
hideBackToTop();
} else if (
window.innerHeight + currentScrollTop >=
document.body.offsetHeight
) {
showBackToTop();
}
},
false
);
}
function throttle(func, wait) {
var timeout;
return function () {
const context = this;
const args = arguments;
const later = function () {
clearTimeout(timeout);
timeout = null;
func.apply(context, args);
};
if (!timeout) {
timeout = setTimeout(later, wait);
}
};
}
function headerOffset() {
// Set an offset if there is are fixed top navbar
const headerEl = window.document.querySelector("header.fixed-top");
if (headerEl) {
return headerEl.clientHeight;
} else {
return 0;
}
}
function footerOffset() {
const footerEl = window.document.querySelector("footer.footer");
if (footerEl) {
return footerEl.clientHeight;
} else {
return 0;
}
}
function dashboardOffset() {
const dashboardNavEl = window.document.getElementById(
"quarto-dashboard-header"
);
if (dashboardNavEl !== null) {
return dashboardNavEl.clientHeight;
} else {
return 0;
}
}
function updateDocumentOffsetWithoutAnimation() {
updateDocumentOffset(false);
}
function updateDocumentOffset(animated) {
// set body offset
const topOffset = headerOffset();
const bodyOffset = topOffset + footerOffset() + dashboardOffset();
const bodyEl = window.document.body;
bodyEl.setAttribute("data-bs-offset", topOffset);
bodyEl.style.paddingTop = topOffset + "px";
// deal with sidebar offsets
const sidebars = window.document.querySelectorAll(
".sidebar, .headroom-target"
);
sidebars.forEach((sidebar) => {
if (!animated) {
sidebar.classList.add("notransition");
// Remove the no transition class after the animation has time to complete
setTimeout(function () {
sidebar.classList.remove("notransition");
}, 201);
}
if (window.Headroom && sidebar.classList.contains("sidebar-unpinned")) {
sidebar.style.top = "0";
sidebar.style.maxHeight = "100vh";
} else {
sidebar.style.top = topOffset + "px";
sidebar.style.maxHeight = "calc(100vh - " + topOffset + "px)";
}
});
// allow space for footer
const mainContainer = window.document.querySelector(".quarto-container");
if (mainContainer) {
mainContainer.style.minHeight = "calc(100vh - " + bodyOffset + "px)";
}
// link offset
let linkStyle = window.document.querySelector("#quarto-target-style");
if (!linkStyle) {
linkStyle = window.document.createElement("style");
linkStyle.setAttribute("id", "quarto-target-style");
window.document.head.appendChild(linkStyle);
}
while (linkStyle.firstChild) {
linkStyle.removeChild(linkStyle.firstChild);
}
if (topOffset > 0) {
linkStyle.appendChild(
window.document.createTextNode(`
section:target::before {
content: "";
display: block;
height: ${topOffset}px;
margin: -${topOffset}px 0 0;
}`)
);
}
if (init) {
window.dispatchEvent(headroomChanged);
}
init = true;
}
// initialize headroom
var header = window.document.querySelector("#quarto-header");
if (header && window.Headroom) {
const headroom = new window.Headroom(header, {
tolerance: 5,
onPin: function () {
const sidebars = window.document.querySelectorAll(
".sidebar, .headroom-target"
);
sidebars.forEach((sidebar) => {
sidebar.classList.remove("sidebar-unpinned");
});
updateDocumentOffset();
},
onUnpin: function () {
const sidebars = window.document.querySelectorAll(
".sidebar, .headroom-target"
);
sidebars.forEach((sidebar) => {
sidebar.classList.add("sidebar-unpinned");
});
updateDocumentOffset();
},
});
headroom.init();
let frozen = false;
window.quartoToggleHeadroom = function () {
if (frozen) {
headroom.unfreeze();
frozen = false;
} else {
headroom.freeze();
frozen = true;
}
};
}
window.addEventListener(
"hashchange",
function (e) {
if (
getComputedStyle(document.documentElement).scrollBehavior !== "smooth"
) {
window.scrollTo(0, window.pageYOffset - headerOffset());
}
},
false
);
// Observe size changed for the header
const headerEl = window.document.querySelector("header.fixed-top");
if (headerEl && window.ResizeObserver) {
const observer = new window.ResizeObserver(() => {
setTimeout(updateDocumentOffsetWithoutAnimation, 0);
});
observer.observe(headerEl, {
attributes: true,
childList: true,
characterData: true,
});
} else {
window.addEventListener(
"resize",
throttle(updateDocumentOffsetWithoutAnimation, 50)
);
}
setTimeout(updateDocumentOffsetWithoutAnimation, 250);
// fixup index.html links if we aren't on the filesystem
if (window.location.protocol !== "file:") {
const links = window.document.querySelectorAll("a");
for (let i = 0; i < links.length; i++) {
if (links[i].href) {
links[i].dataset.originalHref = links[i].href;
// only strip index.html at the end of the path (optionally followed
// by a query or fragment) so that files like index.html.md
// (alternate-format twins) are left alone (#14667)
links[i].href = links[i].href.replace(/\/index\.html(?=[?#]|$)/, "/");
}
}
// Fixup any sharing links that require urls
// Append url to any sharing urls
const sharingLinks = window.document.querySelectorAll(
"a.sidebar-tools-main-item, a.quarto-navigation-tool, a.quarto-navbar-tools, a.quarto-navbar-tools-item"
);
for (let i = 0; i < sharingLinks.length; i++) {
const sharingLink = sharingLinks[i];
const href = sharingLink.getAttribute("href");
if (href) {
sharingLink.setAttribute(
"href",
href.replace("|url|", window.location.href)
);
}
}
// Scroll the active navigation item into view, if necessary
const navSidebar = window.document.querySelector("nav#quarto-sidebar");
if (navSidebar) {
// Find the active item
const activeItem = navSidebar.querySelector("li.sidebar-item a.active");
if (activeItem) {
// Wait for the scroll height and height to resolve by observing size changes on the
// nav element that is scrollable
const resizeObserver = new ResizeObserver((_entries) => {
// The bottom of the element
const elBottom = activeItem.offsetTop;
const viewBottom = navSidebar.scrollTop + navSidebar.clientHeight;
// The element height and scroll height are the same, then we are still loading
if (viewBottom !== navSidebar.scrollHeight) {
// Determine if the item isn't visible and scroll to it
if (elBottom >= viewBottom) {
navSidebar.scrollTop = elBottom;
}
// stop observing now since we've completed the scroll
resizeObserver.unobserve(navSidebar);
}
});
resizeObserver.observe(navSidebar);
}
}
}
});
@@ -0,0 +1,3 @@
/*! @algolia/autocomplete-js 1.19.1 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/autocomplete-js"]={})}(this,(function(e){"use strict";function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}function u(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,u,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(c)throw o}}return a}}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e){return{current:e}}function p(e,t){var n=void 0;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];n&&clearTimeout(n),n=setTimeout((function(){return e.apply(void 0,o)}),t)}}function m(e){return e.reduce((function(e,t){return e.concat(t)}),[])}var v=0;function d(){return"autocomplete-".concat(v++)}function y(e,t){return t.reduce((function(e,t){return e&&e[t]}),e)}function b(e){return 0===e.collections.length?0:e.collections.reduce((function(e,t){return e+t.items.length}),0)}function g(e){return e!==Object(e)}function h(e,t){if(e===t)return!0;if(g(e)||g(t)||"function"==typeof e||"function"==typeof t)return e===t;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];if(!(o in t))return!1;if(!h(e[o],t[o]))return!1}return!0}var _=function(){};var O="1.19.1",S=[{segment:"autocomplete-core",version:O}];function j(e){var t=e.item,n=e.items,r=void 0===n?[]:n;return{index:t.__autocomplete_indexName,items:[t],positions:[1+r.findIndex((function(e){return e.objectID===t.objectID}))],queryID:t.__autocomplete_queryID,algoliaSource:["autocomplete"]}}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,u,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.pLine truncated
+9
View File
@@ -0,0 +1,9 @@
/**
* Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io)
*
* Copyright (c) 2022 Kiro Risk (http://kiro.me)
* All Rights Reserved. Apache Software License 2.0
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
var e,t;e=this,t=function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){c(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(e,"prototype",{value:Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),writable:!1}),t&&u(e,t)}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function h(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return h(this,n)}}function f(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e){return Array.isArray?Array.isArray(e):"[object Array]"===b(e)}function g(e){return"string"==typeof e}function y(e){return"number"==typeof e}function p(e){return!0===e||!1===e||function(e){return m(e)&&null!==e}(e)&&"[object Boolean]"==b(e)}function m(e){return"object"===n(e)}function k(e){return null!=e}function M(e){return!e.trim().length}function b(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var x=function(e){return"Invalid value for key ".concat(e)},w=function(e){return"Pattern length exceeds max of ".concat(e,".")},L=Object.prototype.hasOwnProperty,S=function(){function e(t){var n=this;r(this,e),this._keys=[],this._keyMap={};var i=0;t.forEach((function(e){var t=_(e);i+=t.weight,n._keys.push(t),n._keyMap[t.id]=t,i+=t.weight})),this._keys.forEach((function(e){e.weight/=i}))}return o(e,[{key:"get",value:function(e){return this._keyMap[e]}},{key:"keys",value:function(){return this._keys}},{key:"toJSON",value:function(){return JSON.stringify(this._keys)}}]),e}();function _(e){var t=null,n=null,r=null,i=1,o=null;if(g(e)||v(e))r=e,t=O(e),n=j(e);else{if(!L.call(e,"name"))throw new Error(function(e){return"Missing ".concat(e," property in key")}("name"));var c=e.name;if(r=c,L.call(e,"weight")&&(i=e.weight)<=0)throw new Error(function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")}(c));t=O(c),n=j(c),o=e.getFn}return{path:t,id:n,weight:i,src:r,getFn:o}}function O(e){return v(e)?e:e.split(".")}function j(e){return v(e)?e.join("."):e}var A={useExtendedSearch:!1,getFn:function(e,t){var n=[],r=!1;return function e(t,i,o){if(k(t))if(i[o]){var c=t[i[o]];if(!k(c))return;if(o===i.Line truncated
File diff suppressed because it is too large. Load diff
+156
View File
@@ -0,0 +1,156 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 230" width="760" height="230"
role="img" aria-labelledby="dc-title">
<title id="dc-title">The procedural version: inside one main(), IO.readln() is called, its result is passed to rot13(), and that result is passed to IO.println(). One thread, one process, three direct calls.</title>
<style><![CDATA[
/* figures/diagram.css -- shared look of every built figure.
*
* build-figures.py drops this file into the style element of every built
* svg, so a figure carries its own styling and stays self-contained.
* Classes, not per-element fills, do the work: one edit here restyles the
* whole book.
*
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
*
* Dark theme: the @media block follows the reader's system setting. librsvg
* ignores media queries when it makes the pdf, so print always gets the light
* theme -- which is what a printed page wants.
*/
svg {
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
/* the figure sits on the page, not on a white card of its own */
background: transparent;
}
/* ---- surfaces ------------------------------------------------------- */
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
/* ---- lines ---------------------------------------------------------- */
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
.rule { stroke: #dae0e8; stroke-width: 1; }
/* ---- text ----------------------------------------------------------- */
.t { fill: #1b2430; font-size: 13px; }
.t-sm { fill: #1b2430; font-size: 11px; }
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
.t-mut { fill: #5a6879; font-size: 11px; }
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
.t-mono { fill: #1b2430; font-size: 11.5px;
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
.mid { text-anchor: middle; }
.end { text-anchor: end; }
/* ---- interaction ====================================================
* A .node groups one box with its labels. Hovering it lifts the whole group
* a little, which is enough to follow a path through a busy diagram without
* any script. Pointer events stay off the decorative layers so the hover
* target is the shape itself.
*/
.node { transition: opacity .12s ease; }
.node:hover .box,
.node:hover .box-accent,
.node:hover .diamond { stroke-width: 2.6; }
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
svg:hover .node:not(:hover) { opacity: .55; }
/* a figure that marks no nodes must not dim on hover */
svg:not(:has(.node)) .node { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
.node { transition: none; }
}
/* ---- dark theme ------------------------------------------------------ */
@media (prefers-color-scheme: dark) {
.box { fill: #1d2b33; stroke: #4c9aa5; }
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
.box-accent { fill: #24363d; stroke: #4c9aa5; }
.box-warn { fill: #332a18; stroke: #c99a3a; }
.box-plain { fill: #161b22; stroke: #30363d; }
.diamond { fill: #24363d; stroke: #4c9aa5; }
.ellipse { fill: #161b22; stroke: #8b98a8; }
.edge { stroke: #8b98a8; }
.edge-strong{ stroke: #4c9aa5; }
.edge-warn { stroke: #c99a3a; }
.edge-dash { stroke: #8b98a8; }
.rule { stroke: #30363d; }
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
.t-mut { fill: #8b98a8; }
.t-accent { fill: #4c9aa5; }
.t-warn { fill: #c99a3a; }
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
.arrow { fill: #8b98a8; }
.arrow-strong { fill: #4c9aa5; }
.arrow-warn { fill: #c99a3a; }
}
/* ---- arrowheads ======================================================
* marker contents cannot inherit the referencing element's fill, so each
* arrowhead is its own class and is themed alongside the line it ends.
*/
.arrow { fill: #5a6879; }
.arrow-strong { fill: #20666f; }
.arrow-warn { fill: #8a5a08; }
]]></style>
<defs>
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
</marker>
</defs>
<!-- everything happens inside one main(), on one thread -->
<rect class="box-plain" x="14" y="16" width="732" height="126" rx="4"/>
<text class="t-mut" data-label="frame" x="26" y="36">one process · one thread · one main()</text>
<g class="node" data-flow-node="read">
<rect class="box" x="40" y="58" width="170" height="52" rx="3"/>
<text class="t-mono mid" data-label="read" x="125" y="90">IO.readln()</text>
</g>
<path class="edge" data-flow="1" data-flow-to="rot" d="M210,84 H298" marker-end="url(#a)"/>
<text class="t-accent mid" data-label="call1" x="254" y="72">call</text>
<g class="node" data-flow-node="rot">
<rect class="box" x="300" y="58" width="170" height="52" rx="3"/>
<text class="t-mono mid" data-label="rot" x="385" y="90">rot13(text)</text>
</g>
<path class="edge" data-flow="2" data-flow-to="print" d="M470,84 H558" marker-end="url(#a)"/>
<text class="t-accent mid" data-label="call2" x="514" y="72">call</text>
<g class="node" data-flow-node="print">
<rect class="box" x="560" y="58" width="170" height="52" rx="3"/>
<text class="t-mono mid" data-label="print" x="645" y="90">IO.println(…)</text>
</g>
<!-- who knows whom -->
<text class="t-sm" data-label="knows" x="14" y="176">main() knows all three: their names, argument and result types, and that they are available right now.</text>
<text class="t-mut" data-label="cost" x="14" y="202">The wiring is written into the code itself — step 1 of the tutorial.</text>
</svg>

After

Width:  |  Height:  |  Size: 6.5 KiB

+211
View File
@@ -0,0 +1,211 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 700" width="620" height="700"
role="img" aria-labelledby="fp-title">
<title id="fp-title">The same chain as five separate processes on one computer: SensorService publishes a .msg file into consoleIn/outbox, a Mediator process watches that directory and publishes a copy into rot13/inbox, ProcessorService publishes its result into rot13/outbox, a second Mediator process moves it into consoleOut/inbox, and ActuatorService prints it. The four directories form the message board on one local filesystem.</title>
<style><![CDATA[
/* figures/diagram.css -- shared look of every built figure.
*
* build-figures.py drops this file into the style element of every built
* svg, so a figure carries its own styling and stays self-contained.
* Classes, not per-element fills, do the work: one edit here restyles the
* whole book.
*
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
*
* Dark theme: the @media block follows the reader's system setting. librsvg
* ignores media queries when it makes the pdf, so print always gets the light
* theme -- which is what a printed page wants.
*/
svg {
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
/* the figure sits on the page, not on a white card of its own */
background: transparent;
}
/* ---- surfaces ------------------------------------------------------- */
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
/* ---- lines ---------------------------------------------------------- */
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
.rule { stroke: #dae0e8; stroke-width: 1; }
/* ---- text ----------------------------------------------------------- */
.t { fill: #1b2430; font-size: 13px; }
.t-sm { fill: #1b2430; font-size: 11px; }
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
.t-mut { fill: #5a6879; font-size: 11px; }
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
.t-mono { fill: #1b2430; font-size: 11.5px;
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
.mid { text-anchor: middle; }
.end { text-anchor: end; }
/* ---- interaction ====================================================
* A .node groups one box with its labels. Hovering it lifts the whole group
* a little, which is enough to follow a path through a busy diagram without
* any script. Pointer events stay off the decorative layers so the hover
* target is the shape itself.
*/
.node { transition: opacity .12s ease; }
.node:hover .box,
.node:hover .box-accent,
.node:hover .diamond { stroke-width: 2.6; }
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
svg:hover .node:not(:hover) { opacity: .55; }
/* a figure that marks no nodes must not dim on hover */
svg:not(:has(.node)) .node { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
.node { transition: none; }
}
/* ---- dark theme ------------------------------------------------------ */
@media (prefers-color-scheme: dark) {
.box { fill: #1d2b33; stroke: #4c9aa5; }
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
.box-accent { fill: #24363d; stroke: #4c9aa5; }
.box-warn { fill: #332a18; stroke: #c99a3a; }
.box-plain { fill: #161b22; stroke: #30363d; }
.diamond { fill: #24363d; stroke: #4c9aa5; }
.ellipse { fill: #161b22; stroke: #8b98a8; }
.edge { stroke: #8b98a8; }
.edge-strong{ stroke: #4c9aa5; }
.edge-warn { stroke: #c99a3a; }
.edge-dash { stroke: #8b98a8; }
.rule { stroke: #30363d; }
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
.t-mut { fill: #8b98a8; }
.t-accent { fill: #4c9aa5; }
.t-warn { fill: #c99a3a; }
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
.arrow { fill: #8b98a8; }
.arrow-strong { fill: #4c9aa5; }
.arrow-warn { fill: #c99a3a; }
}
/* ---- arrowheads ======================================================
* marker contents cannot inherit the referencing element's fill, so each
* arrowhead is its own class and is themed alongside the line it ends.
*/
.arrow { fill: #5a6879; }
.arrow-strong { fill: #20666f; }
.arrow-warn { fill: #8a5a08; }
]]></style>
<defs>
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
</marker>
</defs>
<!-- 1. SensorService (terminal 1) ==================================== -->
<g class="node" data-flow-node="sensor">
<rect class="box" x="120" y="24" width="300" height="46" rx="3"/>
<text class="t-lead mid" data-label="sensor" x="270" y="46">SensorService — ConsoleIn</text>
<text class="t-mut mid" data-label="t1" x="270" y="62">terminal 1</text>
</g>
<path class="edge" data-flow="1" data-flow-to="outbox1" d="M270,70 V96" marker-end="url(#a)"/>
<text class="t-accent" data-label="publish1" x="286" y="88">publish (.tmp → .msg)</text>
<!-- 2. consoleIn/outbox ============================================= -->
<g class="node" data-flow-node="outbox1">
<rect class="box-plain" x="120" y="98" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="126">consoleIn/outbox/*.msg</text>
</g>
<path class="edge" data-flow="2" data-flow-to="mediator1" d="M270,142 V168" marker-end="url(#a)"/>
<text class="t-accent" data-label="watch1" x="286" y="160">WatchService</text>
<!-- 3. first mediator process (terminal 2) =========================== -->
<g class="node" data-flow-node="mediator1">
<rect class="box-accent" x="120" y="170" width="300" height="46" rx="3"/>
<text class="t-lead mid" data-label="mediator1" x="270" y="192">Mediator.java consoleIn/outbox rot13/inbox</text>
<text class="t-mut mid" data-label="t2" x="270" y="208">terminal 2</text>
</g>
<path class="edge" data-flow="3" data-flow-to="inbox2" d="M270,216 V242" marker-end="url(#a)"/>
<text class="t-accent" data-label="publish2" x="286" y="234">publish</text>
<!-- 4. rot13/inbox =================================================== -->
<g class="node" data-flow-node="inbox2">
<rect class="box-plain" x="120" y="244" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="272">rot13/inbox/*.msg</text>
</g>
<path class="edge" data-flow="4" data-flow-to="processor" d="M270,288 V314" marker-end="url(#a)"/>
<text class="t-accent" data-label="watch2" x="286" y="306">WatchService</text>
<!-- 5. ProcessorService (terminal 3) ================================= -->
<g class="node" data-flow-node="processor">
<rect class="box" x="120" y="316" width="300" height="46" rx="3"/>
<text class="t-lead mid" data-label="processor" x="270" y="338">ProcessorService — ROT13</text>
<text class="t-mut mid" data-label="t3" x="270" y="354">terminal 3</text>
</g>
<path class="edge" data-flow="5" data-flow-to="outbox2" d="M270,362 V388" marker-end="url(#a)"/>
<text class="t-accent" data-label="publish3" x="286" y="380">publish</text>
<!-- 6. rot13/outbox ================================================== -->
<g class="node" data-flow-node="outbox2">
<rect class="box-plain" x="120" y="390" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="418">rot13/outbox/*.msg</text>
</g>
<path class="edge" data-flow="6" data-flow-to="mediator2" d="M270,434 V460" marker-end="url(#a)"/>
<text class="t-accent" data-label="watch3" x="286" y="452">WatchService</text>
<!-- 7. second mediator process (terminal 4) ========================== -->
<g class="node" data-flow-node="mediator2">
<rect class="box-accent" x="120" y="462" width="300" height="46" rx="3"/>
<text class="t-lead mid" data-label="mediator2" x="270" y="484">Mediator.java rot13/outbox consoleOut/inbox</text>
<text class="t-mut mid" data-label="t4" x="270" y="500">terminal 4</text>
</g>
<path class="edge" data-flow="7" data-flow-to="inbox3" d="M270,508 V534" marker-end="url(#a)"/>
<text class="t-accent" data-label="publish4" x="286" y="526">publish</text>
<!-- 8. consoleOut/inbox ============================================== -->
<g class="node" data-flow-node="inbox3">
<rect class="box-plain" x="120" y="536" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="564">consoleOut/inbox/*.msg</text>
</g>
<path class="edge" data-flow="8" data-flow-to="actuator" d="M270,580 V606" marker-end="url(#a)"/>
<text class="t-accent" data-label="watch4" x="286" y="598">WatchService</text>
<!-- 9. ActuatorService (terminal 5) ================================== -->
<g class="node" data-flow-node="actuator">
<rect class="box" x="120" y="608" width="300" height="46" rx="3"/>
<text class="t-lead mid" data-label="actuator" x="270" y="630">ActuatorService — ConsoleOut</text>
<text class="t-mut mid" data-label="t5" x="270" y="646">terminal 5</text>
</g>
<!-- the four directories belong to one message board on one filesystem -->
<path class="edge-dash" d="M436,98 H452 V580 H436"/>
<text class="t-mono" x="460" y="330">messageBoard/</text>
<text class="t-mut" data-label="board" x="460" y="348">directory = mailbox, file = message</text>
<!-- the five processes are started by hand, one terminal each -->
<path class="edge-dash" d="M104,24 H88 V654 H104"/>
<text class="t-warn" data-label="topology" x="14" y="686">Five processes started by hand. The topology now lives in the two Mediator command lines — in whoever typed them.</text>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

+206
View File
@@ -0,0 +1,206 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 700" width="560" height="700"
role="img" aria-labelledby="mj-title">
<title id="mj-title">The mediated version inside one JVM: ConsoleIn puts a message into consoleIn.outbox, a mediator takes it and puts it into rot13.inbox, ROT13 takes it and puts its result into rot13.outbox, a second mediator moves that into consoleOut.inbox, and ConsoleOut takes it and prints it.</title>
<style><![CDATA[
/* figures/diagram.css -- shared look of every built figure.
*
* build-figures.py drops this file into the style element of every built
* svg, so a figure carries its own styling and stays self-contained.
* Classes, not per-element fills, do the work: one edit here restyles the
* whole book.
*
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
*
* Dark theme: the @media block follows the reader's system setting. librsvg
* ignores media queries when it makes the pdf, so print always gets the light
* theme -- which is what a printed page wants.
*/
svg {
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
/* the figure sits on the page, not on a white card of its own */
background: transparent;
}
/* ---- surfaces ------------------------------------------------------- */
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
/* ---- lines ---------------------------------------------------------- */
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
.rule { stroke: #dae0e8; stroke-width: 1; }
/* ---- text ----------------------------------------------------------- */
.t { fill: #1b2430; font-size: 13px; }
.t-sm { fill: #1b2430; font-size: 11px; }
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
.t-mut { fill: #5a6879; font-size: 11px; }
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
.t-mono { fill: #1b2430; font-size: 11.5px;
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
.mid { text-anchor: middle; }
.end { text-anchor: end; }
/* ---- interaction ====================================================
* A .node groups one box with its labels. Hovering it lifts the whole group
* a little, which is enough to follow a path through a busy diagram without
* any script. Pointer events stay off the decorative layers so the hover
* target is the shape itself.
*/
.node { transition: opacity .12s ease; }
.node:hover .box,
.node:hover .box-accent,
.node:hover .diamond { stroke-width: 2.6; }
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
svg:hover .node:not(:hover) { opacity: .55; }
/* a figure that marks no nodes must not dim on hover */
svg:not(:has(.node)) .node { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
.node { transition: none; }
}
/* ---- dark theme ------------------------------------------------------ */
@media (prefers-color-scheme: dark) {
.box { fill: #1d2b33; stroke: #4c9aa5; }
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
.box-accent { fill: #24363d; stroke: #4c9aa5; }
.box-warn { fill: #332a18; stroke: #c99a3a; }
.box-plain { fill: #161b22; stroke: #30363d; }
.diamond { fill: #24363d; stroke: #4c9aa5; }
.ellipse { fill: #161b22; stroke: #8b98a8; }
.edge { stroke: #8b98a8; }
.edge-strong{ stroke: #4c9aa5; }
.edge-warn { stroke: #c99a3a; }
.edge-dash { stroke: #8b98a8; }
.rule { stroke: #30363d; }
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
.t-mut { fill: #8b98a8; }
.t-accent { fill: #4c9aa5; }
.t-warn { fill: #c99a3a; }
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
.arrow { fill: #8b98a8; }
.arrow-strong { fill: #4c9aa5; }
.arrow-warn { fill: #c99a3a; }
}
/* ---- arrowheads ======================================================
* marker contents cannot inherit the referencing element's fill, so each
* arrowhead is its own class and is themed alongside the line it ends.
*/
.arrow { fill: #5a6879; }
.arrow-strong { fill: #20666f; }
.arrow-warn { fill: #8a5a08; }
]]></style>
<defs>
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
</marker>
</defs>
<!-- one JVM, five virtual threads: the frame the whole chain lives in -->
<rect class="box-plain" x="10" y="10" width="540" height="676" rx="4"/>
<text class="t-mut" data-label="frame" x="22" y="30">one JVM · five virtual threads · BlockingQueue mailboxes</text>
<!-- 1. ConsoleIn ==================================================== -->
<g class="node" data-flow-node="consolein">
<rect class="box" x="120" y="44" width="300" height="44" rx="3"/>
<text class="t-lead mid" data-label="consolein" x="270" y="72">ConsoleIn — “I read”</text>
</g>
<path class="edge" data-flow="1" data-flow-to="outbox1" d="M270,88 V114" marker-end="url(#a)"/>
<text class="t-accent" data-label="put1" x="286" y="106">put</text>
<!-- 2. consoleIn.outbox ============================================= -->
<g class="node" data-flow-node="outbox1">
<rect class="box-plain" x="120" y="116" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="144">consoleIn.outbox</text>
</g>
<path class="edge" data-flow="2" data-flow-to="mediator1" d="M270,160 V186" marker-end="url(#a)"/>
<text class="t-accent" data-label="take1" x="286" y="178">take</text>
<!-- 3. first mediator =============================================== -->
<g class="node" data-flow-node="mediator1">
<rect class="box-accent" x="120" y="188" width="300" height="44" rx="3"/>
<text class="t-lead mid" data-label="mediator1" x="270" y="211">Mediator</text>
<text class="t-mut mid" data-label="route1" x="270" y="226">consoleIn.outbox → rot13.inbox</text>
</g>
<path class="edge" data-flow="3" data-flow-to="inbox2" d="M270,232 V258" marker-end="url(#a)"/>
<text class="t-accent" data-label="put2" x="286" y="250">put</text>
<!-- 4. rot13.inbox =================================================== -->
<g class="node" data-flow-node="inbox2">
<rect class="box-plain" x="120" y="260" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="288">rot13.inbox</text>
</g>
<path class="edge" data-flow="4" data-flow-to="rot13" d="M270,304 V330" marker-end="url(#a)"/>
<text class="t-accent" data-label="take2" x="286" y="322">take</text>
<!-- 5. ROT13 ========================================================= -->
<g class="node" data-flow-node="rot13">
<rect class="box" x="120" y="332" width="300" height="44" rx="3"/>
<text class="t-lead mid" data-label="rot13" x="270" y="360">ROT13 — “I rotate”</text>
</g>
<path class="edge" data-flow="5" data-flow-to="outbox2" d="M270,376 V402" marker-end="url(#a)"/>
<text class="t-accent" data-label="put3" x="286" y="394">put</text>
<!-- 6. rot13.outbox ================================================== -->
<g class="node" data-flow-node="outbox2">
<rect class="box-plain" x="120" y="404" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="432">rot13.outbox</text>
</g>
<path class="edge" data-flow="6" data-flow-to="mediator2" d="M270,448 V474" marker-end="url(#a)"/>
<text class="t-accent" data-label="take3" x="286" y="466">take</text>
<!-- 7. second mediator =============================================== -->
<g class="node" data-flow-node="mediator2">
<rect class="box-accent" x="120" y="476" width="300" height="44" rx="3"/>
<text class="t-lead mid" data-label="mediator2" x="270" y="499">Mediator</text>
<text class="t-mut mid" data-label="route2" x="270" y="514">rot13.outbox → consoleOut.inbox</text>
</g>
<path class="edge" data-flow="7" data-flow-to="inbox3" d="M270,520 V546" marker-end="url(#a)"/>
<text class="t-accent" data-label="put4" x="286" y="538">put</text>
<!-- 8. consoleOut.inbox ============================================== -->
<g class="node" data-flow-node="inbox3">
<rect class="box-plain" x="120" y="548" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="576">consoleOut.inbox</text>
</g>
<path class="edge" data-flow="8" data-flow-to="consoleout" d="M270,592 V618" marker-end="url(#a)"/>
<text class="t-accent" data-label="take4" x="286" y="610">take</text>
<!-- 9. ConsoleOut ==================================================== -->
<g class="node" data-flow-node="consoleout">
<rect class="box" x="120" y="620" width="300" height="44" rx="3"/>
<text class="t-lead mid" data-label="consoleout" x="270" y="648">ConsoleOut — “I print”</text>
</g>
<!-- side note: who holds the topology -->
<text class="t-warn" data-label="topology" x="22" y="672">No capability names another one. The topology lives only in the two mediators, started in main().</text>
</svg>

After

Width:  |  Height:  |  Size: 9.6 KiB

File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
Binary file not shown.
+156
View File
@@ -0,0 +1,156 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 230" width="760" height="230"
role="img" aria-labelledby="dc-title">
<title id="dc-title">La version procédurale : dans un seul main(), IO.readln() est appelé, son résultat est passé à rot13(), et ce résultat est passé à IO.println(). Un seul fil d'exécution, un seul processus, trois appels directs.</title>
<style><![CDATA[
/* figures/diagram.css -- shared look of every built figure.
*
* build-figures.py drops this file into the style element of every built
* svg, so a figure carries its own styling and stays self-contained.
* Classes, not per-element fills, do the work: one edit here restyles the
* whole book.
*
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
*
* Dark theme: the @media block follows the reader's system setting. librsvg
* ignores media queries when it makes the pdf, so print always gets the light
* theme -- which is what a printed page wants.
*/
svg {
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
/* the figure sits on the page, not on a white card of its own */
background: transparent;
}
/* ---- surfaces ------------------------------------------------------- */
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
/* ---- lines ---------------------------------------------------------- */
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
.rule { stroke: #dae0e8; stroke-width: 1; }
/* ---- text ----------------------------------------------------------- */
.t { fill: #1b2430; font-size: 13px; }
.t-sm { fill: #1b2430; font-size: 11px; }
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
.t-mut { fill: #5a6879; font-size: 11px; }
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
.t-mono { fill: #1b2430; font-size: 11.5px;
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
.mid { text-anchor: middle; }
.end { text-anchor: end; }
/* ---- interaction ====================================================
* A .node groups one box with its labels. Hovering it lifts the whole group
* a little, which is enough to follow a path through a busy diagram without
* any script. Pointer events stay off the decorative layers so the hover
* target is the shape itself.
*/
.node { transition: opacity .12s ease; }
.node:hover .box,
.node:hover .box-accent,
.node:hover .diamond { stroke-width: 2.6; }
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
svg:hover .node:not(:hover) { opacity: .55; }
/* a figure that marks no nodes must not dim on hover */
svg:not(:has(.node)) .node { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
.node { transition: none; }
}
/* ---- dark theme ------------------------------------------------------ */
@media (prefers-color-scheme: dark) {
.box { fill: #1d2b33; stroke: #4c9aa5; }
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
.box-accent { fill: #24363d; stroke: #4c9aa5; }
.box-warn { fill: #332a18; stroke: #c99a3a; }
.box-plain { fill: #161b22; stroke: #30363d; }
.diamond { fill: #24363d; stroke: #4c9aa5; }
.ellipse { fill: #161b22; stroke: #8b98a8; }
.edge { stroke: #8b98a8; }
.edge-strong{ stroke: #4c9aa5; }
.edge-warn { stroke: #c99a3a; }
.edge-dash { stroke: #8b98a8; }
.rule { stroke: #30363d; }
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
.t-mut { fill: #8b98a8; }
.t-accent { fill: #4c9aa5; }
.t-warn { fill: #c99a3a; }
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
.arrow { fill: #8b98a8; }
.arrow-strong { fill: #4c9aa5; }
.arrow-warn { fill: #c99a3a; }
}
/* ---- arrowheads ======================================================
* marker contents cannot inherit the referencing element's fill, so each
* arrowhead is its own class and is themed alongside the line it ends.
*/
.arrow { fill: #5a6879; }
.arrow-strong { fill: #20666f; }
.arrow-warn { fill: #8a5a08; }
]]></style>
<defs>
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
</marker>
</defs>
<!-- everything happens inside one main(), on one thread -->
<rect class="box-plain" x="14" y="16" width="732" height="126" rx="4"/>
<text class="t-mut" data-label="frame" x="26" y="36">un processus · un fil · un seul main()</text>
<g class="node" data-flow-node="read">
<rect class="box" x="40" y="58" width="170" height="52" rx="3"/>
<text class="t-mono mid" data-label="read" x="125" y="90">IO.readln()</text>
</g>
<path class="edge" data-flow="1" data-flow-to="rot" d="M210,84 H298" marker-end="url(#a)"/>
<text class="t-accent mid" data-label="call1" x="254" y="72">appel</text>
<g class="node" data-flow-node="rot">
<rect class="box" x="300" y="58" width="170" height="52" rx="3"/>
<text class="t-mono mid" data-label="rot" x="385" y="90">rot13(text)</text>
</g>
<path class="edge" data-flow="2" data-flow-to="print" d="M470,84 H558" marker-end="url(#a)"/>
<text class="t-accent mid" data-label="call2" x="514" y="72">appel</text>
<g class="node" data-flow-node="print">
<rect class="box" x="560" y="58" width="170" height="52" rx="3"/>
<text class="t-mono mid" data-label="print" x="645" y="90">IO.println(…)</text>
</g>
<!-- who knows whom -->
<text class="t-sm" data-label="knows" x="14" y="176">main() les connaît tous les trois : leurs noms, les types d'arguments et de résultats, et le fait qu'ils sont disponibles immédiatement.</text>
<text class="t-mut" data-label="cost" x="14" y="202">Le câblage est écrit dans le code lui-même — étape 1 du tutoriel.</text>
</svg>

After

Width:  |  Height:  |  Size: 6.6 KiB

@@ -0,0 +1,211 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 700" width="620" height="700"
role="img" aria-labelledby="fp-title">
<title id="fp-title">La même chaîne sous forme de cinq processus distincts sur un seul ordinateur : SensorService publie un fichier .msg dans consoleIn/outbox, un processus Mediator surveille ce répertoire et publie une copie dans rot13/inbox, ProcessorService publie son résultat dans rot13/outbox, un second processus Mediator le déplace vers consoleOut/inbox, et ActuatorService l'affiche. Les quatre répertoires forment le tableau de messages sur un seul système de fichiers local.</title>
<style><![CDATA[
/* figures/diagram.css -- shared look of every built figure.
*
* build-figures.py drops this file into the style element of every built
* svg, so a figure carries its own styling and stays self-contained.
* Classes, not per-element fills, do the work: one edit here restyles the
* whole book.
*
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
*
* Dark theme: the @media block follows the reader's system setting. librsvg
* ignores media queries when it makes the pdf, so print always gets the light
* theme -- which is what a printed page wants.
*/
svg {
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
/* the figure sits on the page, not on a white card of its own */
background: transparent;
}
/* ---- surfaces ------------------------------------------------------- */
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
/* ---- lines ---------------------------------------------------------- */
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
.rule { stroke: #dae0e8; stroke-width: 1; }
/* ---- text ----------------------------------------------------------- */
.t { fill: #1b2430; font-size: 13px; }
.t-sm { fill: #1b2430; font-size: 11px; }
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
.t-mut { fill: #5a6879; font-size: 11px; }
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
.t-mono { fill: #1b2430; font-size: 11.5px;
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
.mid { text-anchor: middle; }
.end { text-anchor: end; }
/* ---- interaction ====================================================
* A .node groups one box with its labels. Hovering it lifts the whole group
* a little, which is enough to follow a path through a busy diagram without
* any script. Pointer events stay off the decorative layers so the hover
* target is the shape itself.
*/
.node { transition: opacity .12s ease; }
.node:hover .box,
.node:hover .box-accent,
.node:hover .diamond { stroke-width: 2.6; }
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
svg:hover .node:not(:hover) { opacity: .55; }
/* a figure that marks no nodes must not dim on hover */
svg:not(:has(.node)) .node { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
.node { transition: none; }
}
/* ---- dark theme ------------------------------------------------------ */
@media (prefers-color-scheme: dark) {
.box { fill: #1d2b33; stroke: #4c9aa5; }
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
.box-accent { fill: #24363d; stroke: #4c9aa5; }
.box-warn { fill: #332a18; stroke: #c99a3a; }
.box-plain { fill: #161b22; stroke: #30363d; }
.diamond { fill: #24363d; stroke: #4c9aa5; }
.ellipse { fill: #161b22; stroke: #8b98a8; }
.edge { stroke: #8b98a8; }
.edge-strong{ stroke: #4c9aa5; }
.edge-warn { stroke: #c99a3a; }
.edge-dash { stroke: #8b98a8; }
.rule { stroke: #30363d; }
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
.t-mut { fill: #8b98a8; }
.t-accent { fill: #4c9aa5; }
.t-warn { fill: #c99a3a; }
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
.arrow { fill: #8b98a8; }
.arrow-strong { fill: #4c9aa5; }
.arrow-warn { fill: #c99a3a; }
}
/* ---- arrowheads ======================================================
* marker contents cannot inherit the referencing element's fill, so each
* arrowhead is its own class and is themed alongside the line it ends.
*/
.arrow { fill: #5a6879; }
.arrow-strong { fill: #20666f; }
.arrow-warn { fill: #8a5a08; }
]]></style>
<defs>
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
</marker>
</defs>
<!-- 1. SensorService (terminal 1) ==================================== -->
<g class="node" data-flow-node="sensor">
<rect class="box" x="120" y="24" width="300" height="46" rx="3"/>
<text class="t-lead mid" data-label="sensor" x="270" y="46">SensorService — ConsoleIn</text>
<text class="t-mut mid" data-label="t1" x="270" y="62">terminal 1</text>
</g>
<path class="edge" data-flow="1" data-flow-to="outbox1" d="M270,70 V96" marker-end="url(#a)"/>
<text class="t-accent" data-label="publish1" x="286" y="88">publier (.tmp → .msg)</text>
<!-- 2. consoleIn/outbox ============================================= -->
<g class="node" data-flow-node="outbox1">
<rect class="box-plain" x="120" y="98" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="126">consoleIn/outbox/*.msg</text>
</g>
<path class="edge" data-flow="2" data-flow-to="mediator1" d="M270,142 V168" marker-end="url(#a)"/>
<text class="t-accent" data-label="watch1" x="286" y="160">WatchService</text>
<!-- 3. first mediator process (terminal 2) =========================== -->
<g class="node" data-flow-node="mediator1">
<rect class="box-accent" x="120" y="170" width="300" height="46" rx="3"/>
<text class="t-lead mid" data-label="mediator1" x="270" y="192">Mediator.java consoleIn/outbox rot13/inbox</text>
<text class="t-mut mid" data-label="t2" x="270" y="208">terminal 2</text>
</g>
<path class="edge" data-flow="3" data-flow-to="inbox2" d="M270,216 V242" marker-end="url(#a)"/>
<text class="t-accent" data-label="publish2" x="286" y="234">publier</text>
<!-- 4. rot13/inbox =================================================== -->
<g class="node" data-flow-node="inbox2">
<rect class="box-plain" x="120" y="244" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="272">rot13/inbox/*.msg</text>
</g>
<path class="edge" data-flow="4" data-flow-to="processor" d="M270,288 V314" marker-end="url(#a)"/>
<text class="t-accent" data-label="watch2" x="286" y="306">WatchService</text>
<!-- 5. ProcessorService (terminal 3) ================================= -->
<g class="node" data-flow-node="processor">
<rect class="box" x="120" y="316" width="300" height="46" rx="3"/>
<text class="t-lead mid" data-label="processor" x="270" y="338">ProcessorService — ROT13</text>
<text class="t-mut mid" data-label="t3" x="270" y="354">terminal 3</text>
</g>
<path class="edge" data-flow="5" data-flow-to="outbox2" d="M270,362 V388" marker-end="url(#a)"/>
<text class="t-accent" data-label="publish3" x="286" y="380">publier</text>
<!-- 6. rot13/outbox ================================================== -->
<g class="node" data-flow-node="outbox2">
<rect class="box-plain" x="120" y="390" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="418">rot13/outbox/*.msg</text>
</g>
<path class="edge" data-flow="6" data-flow-to="mediator2" d="M270,434 V460" marker-end="url(#a)"/>
<text class="t-accent" data-label="watch3" x="286" y="452">WatchService</text>
<!-- 7. second mediator process (terminal 4) ========================== -->
<g class="node" data-flow-node="mediator2">
<rect class="box-accent" x="120" y="462" width="300" height="46" rx="3"/>
<text class="t-lead mid" data-label="mediator2" x="270" y="484">Mediator.java rot13/outbox consoleOut/inbox</text>
<text class="t-mut mid" data-label="t4" x="270" y="500">terminal 4</text>
</g>
<path class="edge" data-flow="7" data-flow-to="inbox3" d="M270,508 V534" marker-end="url(#a)"/>
<text class="t-accent" data-label="publish4" x="286" y="526">publier</text>
<!-- 8. consoleOut/inbox ============================================== -->
<g class="node" data-flow-node="inbox3">
<rect class="box-plain" x="120" y="536" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="564">consoleOut/inbox/*.msg</text>
</g>
<path class="edge" data-flow="8" data-flow-to="actuator" d="M270,580 V606" marker-end="url(#a)"/>
<text class="t-accent" data-label="watch4" x="286" y="598">WatchService</text>
<!-- 9. ActuatorService (terminal 5) ================================== -->
<g class="node" data-flow-node="actuator">
<rect class="box" x="120" y="608" width="300" height="46" rx="3"/>
<text class="t-lead mid" data-label="actuator" x="270" y="630">ActuatorService — ConsoleOut</text>
<text class="t-mut mid" data-label="t5" x="270" y="646">terminal 5</text>
</g>
<!-- the four directories belong to one message board on one filesystem -->
<path class="edge-dash" d="M436,98 H452 V580 H436"/>
<text class="t-mono" x="460" y="330">messageBoard/</text>
<text class="t-mut" data-label="board" x="460" y="348">répertoire = boîte, fichier = message</text>
<!-- the five processes are started by hand, one terminal each -->
<path class="edge-dash" d="M104,24 H88 V654 H104"/>
<text class="t-warn" data-label="topology" x="14" y="686">Cinq processus lancés à la main. La topologie vit désormais dans les deux lignes de commande Mediator — chez celui qui les a tapées.</text>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

+206
View File
@@ -0,0 +1,206 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 700" width="560" height="700"
role="img" aria-labelledby="mj-title">
<title id="mj-title">La version médiatisée dans une seule JVM : ConsoleIn dépose un message dans consoleIn.outbox, un médiateur le retire et le dépose dans rot13.inbox, ROT13 le retire et dépose son résultat dans rot13.outbox, un second médiateur le déplace vers consoleOut.inbox, et ConsoleOut le retire et l'affiche.</title>
<style><![CDATA[
/* figures/diagram.css -- shared look of every built figure.
*
* build-figures.py drops this file into the style element of every built
* svg, so a figure carries its own styling and stays self-contained.
* Classes, not per-element fills, do the work: one edit here restyles the
* whole book.
*
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
*
* Dark theme: the @media block follows the reader's system setting. librsvg
* ignores media queries when it makes the pdf, so print always gets the light
* theme -- which is what a printed page wants.
*/
svg {
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
/* the figure sits on the page, not on a white card of its own */
background: transparent;
}
/* ---- surfaces ------------------------------------------------------- */
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
/* ---- lines ---------------------------------------------------------- */
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
.rule { stroke: #dae0e8; stroke-width: 1; }
/* ---- text ----------------------------------------------------------- */
.t { fill: #1b2430; font-size: 13px; }
.t-sm { fill: #1b2430; font-size: 11px; }
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
.t-mut { fill: #5a6879; font-size: 11px; }
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
.t-mono { fill: #1b2430; font-size: 11.5px;
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
.mid { text-anchor: middle; }
.end { text-anchor: end; }
/* ---- interaction ====================================================
* A .node groups one box with its labels. Hovering it lifts the whole group
* a little, which is enough to follow a path through a busy diagram without
* any script. Pointer events stay off the decorative layers so the hover
* target is the shape itself.
*/
.node { transition: opacity .12s ease; }
.node:hover .box,
.node:hover .box-accent,
.node:hover .diamond { stroke-width: 2.6; }
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
svg:hover .node:not(:hover) { opacity: .55; }
/* a figure that marks no nodes must not dim on hover */
svg:not(:has(.node)) .node { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
.node { transition: none; }
}
/* ---- dark theme ------------------------------------------------------ */
@media (prefers-color-scheme: dark) {
.box { fill: #1d2b33; stroke: #4c9aa5; }
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
.box-accent { fill: #24363d; stroke: #4c9aa5; }
.box-warn { fill: #332a18; stroke: #c99a3a; }
.box-plain { fill: #161b22; stroke: #30363d; }
.diamond { fill: #24363d; stroke: #4c9aa5; }
.ellipse { fill: #161b22; stroke: #8b98a8; }
.edge { stroke: #8b98a8; }
.edge-strong{ stroke: #4c9aa5; }
.edge-warn { stroke: #c99a3a; }
.edge-dash { stroke: #8b98a8; }
.rule { stroke: #30363d; }
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
.t-mut { fill: #8b98a8; }
.t-accent { fill: #4c9aa5; }
.t-warn { fill: #c99a3a; }
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
.arrow { fill: #8b98a8; }
.arrow-strong { fill: #4c9aa5; }
.arrow-warn { fill: #c99a3a; }
}
/* ---- arrowheads ======================================================
* marker contents cannot inherit the referencing element's fill, so each
* arrowhead is its own class and is themed alongside the line it ends.
*/
.arrow { fill: #5a6879; }
.arrow-strong { fill: #20666f; }
.arrow-warn { fill: #8a5a08; }
]]></style>
<defs>
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
</marker>
</defs>
<!-- one JVM, five virtual threads: the frame the whole chain lives in -->
<rect class="box-plain" x="10" y="10" width="540" height="676" rx="4"/>
<text class="t-mut" data-label="frame" x="22" y="30">une JVM · cinq threads virtuels · boîtes BlockingQueue</text>
<!-- 1. ConsoleIn ==================================================== -->
<g class="node" data-flow-node="consolein">
<rect class="box" x="120" y="44" width="300" height="44" rx="3"/>
<text class="t-lead mid" data-label="consolein" x="270" y="72">ConsoleIn — « je lis »</text>
</g>
<path class="edge" data-flow="1" data-flow-to="outbox1" d="M270,88 V114" marker-end="url(#a)"/>
<text class="t-accent" data-label="put1" x="286" y="106">put</text>
<!-- 2. consoleIn.outbox ============================================= -->
<g class="node" data-flow-node="outbox1">
<rect class="box-plain" x="120" y="116" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="144">consoleIn.outbox</text>
</g>
<path class="edge" data-flow="2" data-flow-to="mediator1" d="M270,160 V186" marker-end="url(#a)"/>
<text class="t-accent" data-label="take1" x="286" y="178">take</text>
<!-- 3. first mediator =============================================== -->
<g class="node" data-flow-node="mediator1">
<rect class="box-accent" x="120" y="188" width="300" height="44" rx="3"/>
<text class="t-lead mid" data-label="mediator1" x="270" y="211">Médiateur</text>
<text class="t-mut mid" data-label="route1" x="270" y="226">consoleIn.outbox → rot13.inbox</text>
</g>
<path class="edge" data-flow="3" data-flow-to="inbox2" d="M270,232 V258" marker-end="url(#a)"/>
<text class="t-accent" data-label="put2" x="286" y="250">put</text>
<!-- 4. rot13.inbox =================================================== -->
<g class="node" data-flow-node="inbox2">
<rect class="box-plain" x="120" y="260" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="288">rot13.inbox</text>
</g>
<path class="edge" data-flow="4" data-flow-to="rot13" d="M270,304 V330" marker-end="url(#a)"/>
<text class="t-accent" data-label="take2" x="286" y="322">take</text>
<!-- 5. ROT13 ========================================================= -->
<g class="node" data-flow-node="rot13">
<rect class="box" x="120" y="332" width="300" height="44" rx="3"/>
<text class="t-lead mid" data-label="rot13" x="270" y="360">ROT13 — « je transforme »</text>
</g>
<path class="edge" data-flow="5" data-flow-to="outbox2" d="M270,376 V402" marker-end="url(#a)"/>
<text class="t-accent" data-label="put3" x="286" y="394">put</text>
<!-- 6. rot13.outbox ================================================== -->
<g class="node" data-flow-node="outbox2">
<rect class="box-plain" x="120" y="404" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="432">rot13.outbox</text>
</g>
<path class="edge" data-flow="6" data-flow-to="mediator2" d="M270,448 V474" marker-end="url(#a)"/>
<text class="t-accent" data-label="take3" x="286" y="466">take</text>
<!-- 7. second mediator =============================================== -->
<g class="node" data-flow-node="mediator2">
<rect class="box-accent" x="120" y="476" width="300" height="44" rx="3"/>
<text class="t-lead mid" data-label="mediator2" x="270" y="499">Médiateur</text>
<text class="t-mut mid" data-label="route2" x="270" y="514">rot13.outbox → consoleOut.inbox</text>
</g>
<path class="edge" data-flow="7" data-flow-to="inbox3" d="M270,520 V546" marker-end="url(#a)"/>
<text class="t-accent" data-label="put4" x="286" y="538">put</text>
<!-- 8. consoleOut.inbox ============================================== -->
<g class="node" data-flow-node="inbox3">
<rect class="box-plain" x="120" y="548" width="300" height="44" rx="3"/>
<text class="t-mono mid" x="270" y="576">consoleOut.inbox</text>
</g>
<path class="edge" data-flow="8" data-flow-to="consoleout" d="M270,592 V618" marker-end="url(#a)"/>
<text class="t-accent" data-label="take4" x="286" y="610">take</text>
<!-- 9. ConsoleOut ==================================================== -->
<g class="node" data-flow-node="consoleout">
<rect class="box" x="120" y="620" width="300" height="44" rx="3"/>
<text class="t-lead mid" data-label="consoleout" x="270" y="648">ConsoleOut — « j'affiche »</text>
</g>
<!-- side note: who holds the topology -->
<text class="t-warn" data-label="topology" x="22" y="672">Aucune capacité ne nomme une autre. La topologie ne vit que dans les deux médiateurs, démarrés dans main().</text>
</svg>

After

Width:  |  Height:  |  Size: 9.7 KiB

+1065
View File
File diff suppressed because it is too large. Load diff
+222
View File
@@ -0,0 +1,222 @@
[
{
"objectID": "index.html",
"href": "index.html",
"title": "De l’appel à l’événement",
"section": "",
"text": "À propos de ces notes\nCes notes résument le tutoriel « SIN.04028 — From Calling to Eventing », parcouru étape par étape. Le tutoriel lui-même se trouve à côté de ce livre, dans SIN.04028-From-Calling-to-Eventing/README.md, et fait partie du cours Process Control donné par Reto Konig à l’Université de Fribourg (semestre d’automne 2026).\nLe programme construit ne change jamais : vous tapez une ligne, elle revient décalée de 13 lettres.\nCe qui change, c’est tout ce qui l’entoure. Le tutoriel reconstruit le même système encore et encore en posant trois questions, dans cet ordre :\nUn résumé est ajouté ici chaque fois qu’une étape est terminée : le livre grandit donc au rythme du travail. Chaque résumé dit ce que l’étape a fait, ce qui a été observé à l’exécution, et ce qui a bougé sur le plan architectural — en général une connaissance qui a changé de mains.",
"crumbs": [
"[About these notes]{.en}[À propos de ces notes]{.fr}[Über diese Notizen]{.de}"
]
},
{
"objectID": "index.html#sec-diagrams",
"href": "index.html#sec-diagrams",
"title": "De l’appel à l’événement",
"section": "Comment lire les figures",
"text": "Comment lire les figures\nChaque figure existe une fois comme dessin et trois fois comme langue. Dans la version web, une figure qui porte un flux de messages possède une petite barre de lecture : Lancer fait parcourir toute la chaîne à un message, Un saut avance d’une seule étape, et Réinitialiser remet tout à zéro. Les boîtes s’allument au passage du message : on voit ainsi quel composant attend et lequel travaille.\nDans le PDF, et dans un navigateur sans JavaScript, la même image est là — simplement immobile. Rien dans ces notes ne dépend de l’animation.",
"crumbs": [
"[About these notes]{.en}[À propos de ces notes]{.fr}[Über diese Notizen]{.de}"
]
},
{
"objectID": "index.html#sec-build",
"href": "index.html#sec-build",
"title": "De l’appel à l’événement",
"section": "Construire ce livre",
"text": "Construire ce livre\nLes trois livres proviennent d’une source unique :\n./render-all.sh # figures, puis html + pdf pour en, fr, de\n./render-all.sh --serve # …puis sert _book/ sur http://localhost:8000\n_book/ contient le livre anglais, _book/fr/ le français et _book/de/ l’allemand ; le menu de langue dans la barre latérale passe de l’un à l’autre et retient le choix. Un simple quarto render ne construit que l’anglais et vide _book/, ce qui supprime les deux autres — utilisez donc le script.",
"crumbs": [
"[About these notes]{.en}[À propos de ces notes]{.fr}[Über diese Notizen]{.de}"
]
},
{
"objectID": "00-orientation.html",
"href": "00-orientation.html",
"title": "1  Étape 0 — De quoi parle le tutoriel",
"section": "",
"text": "1.1 Les trois questions\nL’étape 0 ne contient aucun code. Elle énonce le sujet : non pas ROT13, mais l’architecture autour de lui. La fonctionnalité reste presque inchangée pendant 81 étapes, et c’est précisément ce qui rend visibles les changements alentour.\nDeux règles sont posées ici et valent pour tout le tutoriel :\nC’est pourquoi le tutoriel ne commence ni par MQTT, ni par les abonnements dynamiques. Il construit d’abord un système aux médiateurs délibérément maladroits, le met en service, et demande seulement ensuite s’ils ont mérité leur place.\nLa seconde règle concerne le vocabulaire : Intent, Status/State et Event ne sont nommés qu’après avoir été utilisés. Ils apparaissent vers l’étape 42, pas avant.\nL’itinéraire prévu, dès l’étape 0 :\nLa formulation des trois questions compte, et il est facile de la remplacer par une version plus faible :\n« Connaître » n’est pas « communiquer » : deux composants peuvent échanger des messages toute la journée sans que l’un nomme l’autre. « Décider du câblage » n’est pas « relier » : la partie qui transmet les messages n’est pas forcément celle qui a choisi la route. Les deux distinctions deviennent concrètes plus tard — la première dès l’étape 1, la seconde dans la partie III.",
"crumbs": [
"<span class='chapter-number'>1</span>  <span class='chapter-title'>[Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de}</span>"
]
},
{
"objectID": "00-orientation.html#sec-three-questions",
"href": "00-orientation.html#sec-three-questions",
"title": "1  Étape 0 — De quoi parle le tutoriel",
"section": "",
"text": "Ce que demande le tutoriel\nUne version plus faible\n\n\n\n\nQui connaît qui ?\nqui communique avec qui\n\n\nQui possède quoi ?\nquelles données détient chaque partie\n\n\nQui décide du câblage ?\nquelle partie relie le tout",
"crumbs": [
"<span class='chapter-number'>1</span>  <span class='chapter-title'>[Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html",
"href": "01-part-i-calls.html",
"title": "2  Partie I — Commencer par ce que l’on connaît déjà",
"section": "",
"text": "2.1 Étape 1 — Au plus simple : appeler, point\nLes étapes 1 à 10 restent dans une seule JVM. Le système est construit trois fois : en appels directs, en trois capacités qui refusent de se connaître, puis en ces mêmes capacités reliées par des médiateurs. Rien n’est encore distribué, et c’est bien l’idée : la seule chose qui change est qui connaît qui.\nProceduralRot13.java est le système entier dans un seul fichier source compact : une boucle qui lit une ligne, et une instruction qui affiche le texte transformé.\nIO.readln() occupe sa propre ligne, mais rot13(text) n’est pas une étape distincte : il est appelé dans l’argument de IO.println. Ni rot13 ni IO.println ne sait quoi que ce soit de l’autre. Celui qui connaît les deux, c’est main(), qui les nomme et fixe leur ordre.\nCe que main() sait de rot13 : qu’il existe, comment l’invoquer (un simple nom, tous deux vivent dans la même classe générée implicitement), quel argument il prend, ce qu’il retourne, qu’il est disponible à l’instant, et que l’exécution continue après son retour. Il ne sait pas comment rot13 est implémenté — c’est la seule chose qu’il peut ignorer.\nLa garantie de disponibilité mérite d’être nommée, car elle disparaîtra plus tard : main() et rot13 sont deux méthodes d’une classe déjà chargée, appelées sur le même fil, dans le même processus. Rien n’a besoin d’être démarré d’abord, aucun message ne voyage, aucun auditeur n’a besoin d’être abonné.\nObservé : taper une ligne l’affiche transformée ; Ctrl+D termine le programme sans rien afficher, car IO.readln() retourne null et main() retourne.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-1",
"href": "01-part-i-calls.html#sec-step-1",
"title": "2  Partie I — Commencer par ce que l’on connaît déjà",
"section": "",
"text": "void main() {\n while (true) {\n var text = IO.readln();\n\n if (text == null)\n return;\n\n IO.println(rot13(text));\n }\n}\n\n\n\n\n\n\n\n\n\n\nFigure 2.1: La version procédurale. Le câblage est écrit dans le code : main() nomme les trois parties et fixe leur ordre.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-2",
"href": "01-part-i-calls.html#sec-step-2",
"title": "2  Partie I — Commencer par ce que l’on connaît déjà",
"section": "2.2 Étape 2 — Trois capacités égoïstes",
"text": "2.2 Étape 2 — Trois capacités égoïstes\nUn composant égoïste dit : je sais ce que je peux faire, quelles données j’accepte et quelles données je produis — et je préfère ne pas connaître le processus métier qui m’entoure. Concrètement, ConsoleIn ne doit pas contenir rot13(...), et ROT13 ne doit pas contenir consoleOut(...).\nSupprimer ces appels crée aussitôt un problème, que le tutoriel formule en question : si personne ne connaît personne, qui fait de cela un système ? Notez ce que la question ne dit pas : la connaissance n’a pas disparu, elle doit aller ailleurs. Il manque deux liaisons, pas une — ConsoleIn ↔︎ ROT13 et ROT13 ↔︎ ConsoleOut.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-3",
"href": "01-part-i-calls.html#sec-step-3",
"title": "2  Partie I — Commencer par ce que l’on connaît déjà",
"section": "2.3 Étape 3 — Donner une boîte aux lettres à chaque capacité",
"text": "2.3 Étape 3 — Donner une boîte aux lettres à chaque capacité\nLe plus petit mécanisme pour les liaisons manquantes : un message et une file nommée.\nrecord Message(String type, String value) {}\n\nMap&lt;String, BlockingQueue&lt;Message&gt;&gt; mailboxes = new ConcurrentHashMap&lt;&gt;();\n\nBlockingQueue&lt;Message&gt; mailbox(String name) {\n return mailboxes.computeIfAbsent(name, _ -&gt; new LinkedBlockingQueue&lt;&gt;());\n}\nLe tutoriel insiste pour appeler cela des boîtes aux lettres (mailboxes) et non des sujets (topics), et il en donne la raison : si deux lecteurs appellent take() sur la même boîte, ils sont en concurrence — chaque message va à un seul d’entre eux et n’est pas copié aux deux. Un topic, en Publish/Subscribe, remettrait à chaque abonné sa propre copie. Un lecteur par message suffit pour l’instant, et la limitation est conservée volontairement : c’est elle qui rendra visible plus tard ce que Publish/Subscribe apporte réellement.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-steps-4-6",
"href": "01-part-i-calls.html#sec-steps-4-6",
"title": "2  Partie I — Commencer par ce que l’on connaît déjà",
"section": "2.4 Étapes 4–6 — Les trois capacités deviennent égoïstes",
"text": "2.4 Étapes 4–6 — Les trois capacités deviennent égoïstes\nChaque capacité ne touche plus que ses propres noms de boîtes :\n\n\n\nCapacité\nlit\nécrit\n\n\n\n\nConsoleIn\nle clavier\nconsoleIn.outbox\n\n\nROT13\nrot13.inbox\nrot13.outbox\n\n\nConsoleOut\nconsoleOut.inbox\nla console\n\n\n\nAucune capacité ne contient le nom d’une autre. Le résumé du tutoriel lui-même : « trois capacités bien isolées. Et elles ne font absolument rien ensemble. » Rien ne déplace un message de consoleIn.outbox vers rot13.inbox, ni de rot13.outbox vers consoleOut.inbox.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-7",
"href": "01-part-i-calls.html#sec-step-7",
"title": "2  Partie I — Commencer par ce que l’on connaît déjà",
"section": "2.5 Étape 7 — Entre le médiateur",
"text": "2.5 Étape 7 — Entre le médiateur\nLa colle la plus simple possible : une boucle qui retire d’une boîte et dépose dans une autre, sans rien savoir de ce qui la traverse.\nvoid mediate(String from, String to) {\n while (true)\n mailbox(to).put(mailbox(from).take());\n}\nmain() démarre cinq threads virtuels : les trois capacités, plus deux médiateurs dont les routes sont passées en arguments — consoleIn.outbox → rot13.inbox et rot13.outbox → consoleOut.inbox.\nObservé : Hello World en entrée, Uryyb Jbeyq en sortie, exactement comme à l’étape 1. Mais Ctrl+D ne termine plus le programme. Le thread de ConsoleIn retourne (il ne boucle pas), et les quatre autres threads restent bloqués dans take() sur des boîtes vides, sans consommer de CPU. Ce qui maintient réellement le processus en vie, c’est la dernière ligne de main(), Thread.currentThread().join() : le thread principal s’attend lui-même, ce qui ne peut jamais aboutir. Les threads virtuels sont des threads daemon : ces quatre threads en attente n’auraient donc pas maintenu la JVM en vie à eux seuls.\n\n\n\n\n\n\nFigure 2.2: La version médiatisée dans une seule JVM. Dans la version web, Lancer fait parcourir à un message les huit sauts.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-8",
"href": "01-part-i-calls.html#sec-step-8",
"title": "2  Partie I — Commencer par ce que l’on connaît déjà",
"section": "2.6 Étape 8 — Redemander : qui connaît qui ?",
"text": "2.6 Étape 8 — Redemander : qui connaît qui ?\nConsoleIn connaît-il ROT13 ? Non. ROT13 connaît-il ConsoleIn ou ConsoleOut ? Non. La topologie a-t-elle disparu ? Non — elle se trouve dans les deux appels mediate(...) à l’intérieur de main().\nC’est le premier résultat majeur du tutoriel :\n\nLe découplage ne fait souvent pas disparaître la connaissance. Il la déplace là où elle appartient.\n\nLa capacité « ROT13 transforme du texte » appartient à ROT13. La topologie ConsoleIn → ROT13 → ConsoleOut appartient à la composition du système. Ce qui a changé depuis l’étape 1, ce n’est pas que le câblage a quitté main() — il y est toujours — mais qu’il n’est plus écrit à l’intérieur d’une capacité. C’est désormais une donnée : deux paires de noms de boîtes. Recâbler touche ces deux lignes et aucune capacité.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-9",
"href": "01-part-i-calls.html#sec-step-9",
"title": "2  Partie I — Commencer par ce que l’on connaît déjà",
"section": "2.7 Étape 9 — Pourquoi des threads virtuels ?",
"text": "2.7 Étape 9 — Pourquoi des threads virtuels ?\nCinq boucles attendent désormais indéfiniment : le clavier, rot13.inbox, consoleOut.inbox et les sources des deux médiateurs. Les threads virtuels sont simplement le moyen Java peu coûteux de faire attendre cinq choses à la fois dans une seule JVM.\nC’est une commodité d’implémentation, pas une architecture. L’architecture — qui connaît qui, et où vit le câblage — réside dans les noms de boîtes, pas dans les threads. La preuve que donne le tutoriel : la même architecture tournera en processus séparés à l’étape 11, sans aucun thread partagé entre les parties.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-10",
"href": "01-part-i-calls.html#sec-step-10",
"title": "2  Partie I — Commencer par ce que l’on connaît déjà",
"section": "2.8 Étape 10 — Garder les services égoïstes",
"text": "2.8 Étape 10 — Garder les services égoïstes\nLe raccourci évident : le premier médiateur ne fait que recopier les messages tels quels, alors pourquoi ne pas le supprimer et laisser ROT13 faire take() directement sur consoleIn.outbox ?\nParce que ROT13 contiendrait alors le nom consoleIn.outbox, c’est-à-dire qu’il saurait que ConsoleIn existe et où il publie. La topologie entrerait dans ROT13, et ROT13 cesserait d’être une capacité égoïste. Le test qui rend cela concret : supposons que l’entrée vienne d’une nouvelle capacité FileIn publiant dans fileIn.outbox.\n\n\n\n\n\n\n\n\n\navec le médiateur\navec le raccourci\n\n\n\n\nce qui change\nun argument du médiateur\nrunRot13 lui-même\n\n\nqui est touché\naucune capacité\nROT13, dont le travail n’a pas changé\n\n\n\nLe tutoriel est honnête sur le prix : ce design « peut sembler indirect — voire un peu bizarre », et il promet une autre manière de garder les services égoïstes sans médiateur sur le chemin de chaque message.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-part-i-result",
"href": "01-part-i-calls.html#sec-part-i-result",
"title": "2  Partie I — Commencer par ce que l’on connaît déjà",
"section": "2.9 Ce que la partie I a déplacé",
"text": "2.9 Ce que la partie I a déplacé\n\n\n\n\n\n\n\n\nétape\noù vit la topologie\nqui peut recâbler\n\n\n\n\nétape 1\ndans le code de la capacité (IO.println(rot13(text)))\ncelui qui édite ce code\n\n\nétapes 7–8\ndans main(), en paires de noms de boîtes\ncelui qui édite main()\n\n\n\nFonctionnalité : inchangée. Lignes de code : davantage. Parties qui se connaissent : aucune. C’est le compromis que le reste du tutoriel continue de mettre à l’épreuve.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html",
"href": "02-part-ii-processes.html",
"title": "3  Partie II — Franchir la frontière de processus",
"section": "",
"text": "3.1 Étape 11 — Séparer les composants\nLes étapes 11 à 18 reprennent l’architecture de la partie I et la répartissent sur cinq processus du système d’exploitation, sur un seul ordinateur. Les capacités gardent leurs noms de boîtes ; seul le transport en dessous change, des objets Java vers des fichiers dans des répertoires. Le premier problème réellement distribué apparaît ici, et il n’a rien à voir avec ROT13.\nTrois processus ne peuvent pas partager une BlockingQueue : chaque commande java démarre sa propre JVM avec sa propre mémoire, la carte mailboxes existerait donc en trois exemplaires et chacun ne verrait que ses propres messages. Il faut un transport externe.\nTCP conviendrait, MQTT conviendrait. Le tutoriel choisit délibérément l’option la plus primitive, le système de fichiers, avec une raison en une ligne : parce qu’on peut le voir. Les messages deviennent des fichiers que l’on peut lister avec ls et lire avec cat pendant que le système tourne. Primitif ne veut pas dire inférieur : la partie VIII revient sur ce que le système de fichiers fait vraiment bien et vraiment mal.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html#sec-steps-12-13",
"href": "02-part-ii-processes.html#sec-steps-12-13",
"title": "3  Partie II — Franchir la frontière de processus",
"section": "3.2 Étapes 12–13 — Un répertoire devient une boîte aux lettres",
"text": "3.2 Étapes 12–13 — Un répertoire devient une boîte aux lettres\nLa correspondance tient en une ligne :\ndirectory = mailbox file = message\npublish = create file receive = watch directory\nmessageBoard/\n├── consoleIn/outbox/\n├── rot13/inbox/\n├── rot13/outbox/\n└── consoleOut/inbox/\nLe record Message gagne un horodatage optionnel, et le format de fichier reste deux lignes plus une troisième facultative :\nTEXT\nHello World\nTIMESTAMP: 2026-09-22T10:42:12.123Z\nUn message écrit à la main peut omettre l’horodatage. Le marqueur TIMESTAMP: empêche qu’une ligne de contenu ressemblant à une date soit prise pour une métadonnée ; dans ce format minuscule, une dernière ligne commençant par TIMESTAMP: est réservée.\nJackson pourrait être introduit ici et ne l’est volontairement pas. L’intérêt d’un format ridiculement simple, c’est que presque rien ne cache l’architecture — le message entier est lisible dans n’importe quel éditeur de texte, ce qui maintient l’attention sur qui parle à qui.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html#sec-step-14",
"href": "02-part-ii-processes.html#sec-step-14",
"title": "3  Partie II — Franchir la frontière de processus",
"section": "3.3 Étape 14 — Le premier problème de système distribué : la publication",
"text": "3.3 Étape 14 — Le premier problème de système distribué : la publication\nUn lecteur qui surveille un répertoire peut découvrir un fichier avant que l’écrivain ait fini de l’écrire. D’où un protocole de publication :\n\ncréer un fichier temporaire privé ;\nécrire le message complet ;\nle fermer ;\nle renommer atomiquement vers son nom final .msg ;\nles consommateurs ne réagissent qu’aux fichiers finaux.\n\nFiles.writeString(temporary, content);\nFiles.move(temporary, published, StandardCopyOption.ATOMIC_MOVE);\nLes deux moitiés sont nécessaires. Le renommage est atomique — un lecteur voit soit aucun fichier .msg, soit le fichier complet — mais il ne protège rien si les lecteurs ramassent aussi les .tmp. .tmp et .msg restent dans le même répertoire, pour que le déplacement ne traverse pas de système de fichiers, où l’atomicité serait perdue.\n\nÉcrire et publier ne sont pas la même opération.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html#sec-step-15",
"href": "02-part-ii-processes.html#sec-step-15",
"title": "3  Partie II — Franchir la frontière de processus",
"section": "3.4 Étape 15 — Observer une boîte avec WatchService",
"text": "3.4 Étape 15 — Observer une boîte avec WatchService\nL’observateur de système de fichiers de Java fournit la moitié consommateur : enregistrer un répertoire pour ENTRY_CREATE, se bloquer dans watcher.take(), et ignorer tout nom de fichier qui ne finit pas par .msg.\nCela donne aussi un outil d’injection très rudimentaire. Avec ActuatorService lancé comme consommateur :\nprintf 'TEXT\\nHello from a file' &gt; messageBoard/consoleOut/inbox/manual.tmp\nmv messageBoard/consoleOut/inbox/manual.tmp messageBoard/consoleOut/inbox/manual.msg\nObservé : rien ne se passe à l’apparition du fichier .tmp ; la ligne est affichée à l’instant où le renommage crée le nom .msg. Les deux formats acceptés fonctionnent, avec et sans horodatage final.\nLa leçon architecturale est celle que le tutoriel formule comme producer → filesystem → consumer : le consommateur n’a pas pu distinguer un humain tapant mv d’un véritable service. Il connaît sa propre boîte d’entrée, pas qui y écrit. L’égoïsme a survécu à la frontière de processus.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html#sec-steps-16-17",
"href": "02-part-ii-processes.html#sec-steps-16-17",
"title": "3  Partie II — Franchir la frontière de processus",
"section": "3.5 Étapes 16–17 — Services et médiateur deviennent des processus",
"text": "3.5 Étapes 16–17 — Services et médiateur deviennent des processus\nLes trois capacités deviennent trois programmes, et le médiateur un quatrième type de programme :\n\n\n\n\n\n\n\n\n\nprogramme\njoue\nlit\nécrit\n\n\n\n\nSensorService.java\nConsoleIn\nle clavier\nconsoleIn/outbox\n\n\nProcessorService.java\nROT13\nrot13/inbox\nrot13/outbox\n\n\nActuatorService.java\nConsoleOut\nconsoleOut/inbox\nla console\n\n\nMediator.java &lt;from&gt; &lt;to&gt;\nla colle\n&lt;from&gt;\n&lt;to&gt;\n\n\n\nLe médiateur est générique : sa route n’est pas compilée en dur, elle arrive en deux arguments de démarrage. Mais le tutoriel signale une asymétrie à garder en tête : les trois capacités reçoivent leur travail sous forme de messages dans une boîte, tandis que le médiateur reçoit sa route comme configuration de démarrage, et il n’a ni nom ni boîte de contrôle propre où quelqu’un pourrait écrire.\nConséquence pratique : les arguments sont lus une seule fois, donc changer la route d’un médiateur en cours d’exécution exige de l’arrêter et de le relancer. Un fichier de configuration ne changerait rien — il est lui aussi lu au démarrage. Le tutoriel laisse volontairement ce point ouvert jusqu’à ce que le coût des médiateurs distribués ait été ressenti.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html#sec-step-18",
"href": "02-part-ii-processes.html#sec-step-18",
"title": "3  Partie II — Franchir la frontière de processus",
"section": "3.6 Étape 18 — Exécuter la version entièrement externe, en local",
"text": "3.6 Étape 18 — Exécuter la version entièrement externe, en local\nCinq terminaux, cinq processus, un seul système de fichiers local entre eux :\njava SensorService.java # terminal 1\njava Mediator.java consoleIn/outbox rot13/inbox # terminal 2\njava ProcessorService.java # terminal 3\njava Mediator.java rot13/outbox consoleOut/inbox # terminal 4\njava ActuatorService.java # terminal 5\nObservé : Hello World tapé dans le terminal 1 est apparu comme Uryyb Jbeyq dans le terminal 5. Les trois terminaux du milieu n’ont rien affiché de nouveau — chaque médiateur affiche une ligne « Mediating: … » au démarrage, et ProcessorService n’affiche rien du tout. Ensuite, chacun des quatre répertoires de boîtes contenait un fichier .msg : la même ligne, recopiée le long de la chaîne.\nComptons : cinq processus pour ce que l’étape 1 faisait en une instruction. La consigne du tutoriel à ce stade n’est pas d’optimiser : « We are not done making it painful. »\n\n\n\n\n\n\nFigure 3.1: Les cinq processus et les quatre répertoires de boîtes. Dans la version web, Lancer suit une ligne de texte du clavier à la console.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html#sec-part-ii-result",
"href": "02-part-ii-processes.html#sec-part-ii-result",
"title": "3  Partie II — Franchir la frontière de processus",
"section": "3.7 Ce que la partie II a déplacé",
"text": "3.7 Ce que la partie II a déplacé\n\n\n\n\n\n\n\n\nétape\noù vit la topologie\nqui peut recâbler\n\n\n\n\nétape 1\ndans le code de la capacité\ncelui qui édite ce code\n\n\nétapes 7–8\ndans main(), en noms de boîtes\ncelui qui édite main()\n\n\nétape 18\ndans les deux lignes de commande Mediator.java &lt;from&gt; &lt;to&gt;\ncelui qui lance les processus\n\n\n\nLa topologie a maintenant quitté le code source : aucun fichier .java ne contient la route. Elle vit dans ce que l’opérateur a tapé, ce qui fait d’une personne l’orchestrateur actuel. Ce que la version à cinq processus apporte est réel — le câblage peut changer sans toucher aucun programme — et ce qu’elle coûte l’est tout autant : cinq processus, quatre copies de chaque message, et un programme qui ne s’arrête plus quand on appuie sur Ctrl+D.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
}
]
@@ -0,0 +1,12 @@
/*!
* Bootstrap v5.3.1 (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/@import"https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Serif:ital,wght@0,400;0,600;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap";:root,[data-bs-theme=light]{--bs-blue: #2780e3;--bs-indigo: #6610f2;--bs-purple: #613d7c;--bs-pink: #e83e8c;--bs-red: #ff0039;--bs-orange: #f0ad4e;--bs-yellow: #ff7518;--bs-green: #3fb618;--bs-teal: #20c997;--bs-cyan: #9954bb;--bs-black: #000;--bs-white: #fff;--bs-gray: #6c757d;--bs-gray-dark: #343a40;--bs-gray-100: #f8f9fa;--bs-gray-200: #e9ecef;--bs-gray-300: #dee2e6;--bs-gray-400: #ced4da;--bs-gray-500: #adb5bd;--bs-gray-600: #6c757d;--bs-gray-700: #495057;--bs-gray-800: #343a40;--bs-gray-900: #212529;--bs-default: #5a6879;--bs-primary: #20666f;--bs-secondary: #5a6879;--bs-success: #3fb618;--bs-info: #9954bb;--bs-warning: #ff7518;--bs-danger: #ff0039;--bs-light: #f8f9fa;--bs-dark: #343a40;--bs-default-rgb: 90, 104, 121;--bs-primary-rgb: 32, 102, 111;--bs-secondary-rgb: 90, 104, 121;--bs-success-rgb: 63, 182, 24;--bs-info-rgb: 153, 84, 187;--bs-warning-rgb: 255, 117, 24;--bs-danger-rgb: 255, 0, 57;--bs-light-rgb: 248, 249, 250;--bs-dark-rgb: 52, 58, 64;--bs-primary-text-emphasis: rgb(12.8, 40.8, 44.4);--bs-secondary-text-emphasis: rgb(36, 41.6, 48.4);--bs-success-text-emphasis: rgb(25.2, 72.8, 9.6);--bs-info-text-emphasis: rgb(61.2, 33.6, 74.8);--bs-warning-text-emphasis: rgb(102, 46.8, 9.6);--bs-danger-text-emphasis: rgb(102, 0, 22.8);--bs-light-text-emphasis: #495057;--bs-dark-text-emphasis: #495057;--bs-primary-bg-subtle: rgb(210.4, 224.4, 226.2);--bs-secondary-bg-subtle: rgb(222, 224.8, 228.2);--bs-success-bg-subtle: rgb(216.6, 240.4, 208.8);--bs-info-bg-subtle: rgb(234.6, 220.8, 241.4);--bs-warning-bg-subtle: rgb(255, 227.4, 208.8);--bs-danger-bg-subtle: rgb(255, 204, 215.4);--bs-light-bg-subtle: rgb(251.5, 252, 252.5);--bs-dark-bg-subtle: #ced4da;--bs-primary-border-subtle: rgb(165.8, 193.8, 197.4);--bs-secondary-border-subtle: rgb(189, 194.6, 201.4);--bs-success-border-subtle: rgb(178.2, 225.8, 162.6);--bs-info-border-subtle: rgb(214.2, 186.6, 227.8);--bs-warning-border-subtle: rgb(255, 199.8, 162.6);--bs-danger-border-subtle: rgb(255, 153, 175.8);--bs-light-border-subtle: #e9ecef;--bs-dark-border-subtle: #adb5bd;--bs-white-rgb: 255, 255, 255;--bs-black-rgb: 0, 0, 0;--bs-font-sans-serif: "IBM Plex Sans", system-ui, -apple-system, sans-serif;--bs-font-monospace: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-root-font-size: 17px;--bs-body-font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;--bs-body-font-size:1rem;--bs-body-font-weight: 400;--bs-body-line-height: 1.66;--bs-body-color: #1b2430;--bs-body-color-rgb: 27, 36, 48;--bs-body-bg: #fbfcfd;--bs-body-bg-rgb: 251, 252, 253;--bs-emphasis-color: #000;--bs-emphasis-color-rgb: 0, 0, 0;--bs-secondary-color: rgba(27, 36, 48, 0.75);--bs-secondary-color-rgb: 27, 36, 48;--bs-secondary-bg: #e9ecef;--bs-secondary-bg-rgb: 233, 236, 239;--bs-tertiary-color: rgba(27, 36, 48, 0.5);--bs-tertiary-color-rgb: 27, 36, 48;--bs-tertiary-bg: #f8f9fa;--bs-tertiary-bg-rgb: 248, 249, 250;--bs-heading-color: inherit;--bs-link-color: #20666f;--bs-link-color-rgb: 32, 102, 111;--bs-link-decoration: underline;--bs-link-hover-color: rgb(25.6, 81.6, 88.8);--bs-link-hover-color-rgb: 26, 82, 89;--bs-code-color: #1b2430;--bs-highlight-bg: rgb(255, 227.4, 208.8);--bs-border-width: 1px;--bs-border-style: solid;--bs-border-color: #dae0e8;--bs-border-color-translucent: rgba(0, 0, 0, 0.175);--bs-border-radius: 0.25rem;--bs-border-radius-sm: 0.2em;--bs-border-radius-lg: 0.5rem;--bs-border-radius-xl: 1rem;--bs-border-radius-xxl: 2rem;--bs-border-radius-2xl: var(--bs-border-radius-xxl);--bs-border-radius-pill: 50rem;--bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.075);--bs-focus-ring-width: 0.25rem;--bs-focus-ring-opacity: 0.25;--bs-focus-ring-color: rgba(32, 102, 111, 0.25);--bs-form-valid-color: #3fb618;--bs-form-valid-border-color: #3fb618;--bs-form-invalid-color: #ff0039;--bs-form-invalid-border-color: #ff0039}[data-bs-theme=dark]{color-scheme:dark;--bs-body-color: #dee2e6;--bs-body-color-rgb: 222, 226, 230;--bs-body-bg: #212529;--bs-body-bg-rgb: 33, 37, 41;--bs-emphasis-color: #fff;--bs-emphasis-color-rgb: 255, 255, 255;--bs-secondary-color: rgba(222, 226, 230, 0.75);--bs-secondary-color-rgb: 222, 226, 230;--bs-secondary-bg: #343a40;--bs-secondary-bg-rgb: 52, 58, 64;--bs-tertiary-color: rgba(222, 226, 230, 0.5);--bs-tertiary-color-rgb: 222, 226, 230;--bs-tertiary-bg: rgb(42.5, 47.5, 52.5);--bs-tertiary-bg-rgb: 43, 48, 53;--bs-primary-text-emphasis: rgb(121.2, 163.2, 168.6);--bs-secondary-text-emphasis: rgb(156, 164.4, 174.6);--bs-success-text-emphasis: rgb(139.8, 211.2, 116.4);--bs-info-text-emphasis: rgb(193.8, 152.4,Line truncated
*
* ansi colors from IPython notebook's
*
* we also add `bright-[color]-` synonyms for the `-[color]-intense` classes since
* that seems to be what ansi_up emits
*
*/.ansi-black-fg{color:#3e424d}.ansi-black-bg{background-color:#3e424d}.ansi-black-intense-black,.ansi-bright-black-fg{color:#282c36}.ansi-black-intense-black,.ansi-bright-black-bg{background-color:#282c36}.ansi-red-fg{color:#e75c58}.ansi-red-bg{background-color:#e75c58}.ansi-red-intense-red,.ansi-bright-red-fg{color:#b22b31}.ansi-red-intense-red,.ansi-bright-red-bg{background-color:#b22b31}.ansi-green-fg{color:#00a250}.ansi-green-bg{background-color:#00a250}.ansi-green-intense-green,.ansi-bright-green-fg{color:#007427}.ansi-green-intense-green,.ansi-bright-green-bg{background-color:#007427}.ansi-yellow-fg{color:#ddb62b}.ansi-yellow-bg{background-color:#ddb62b}.ansi-yellow-intense-yellow,.ansi-bright-yellow-fg{color:#b27d12}.ansi-yellow-intense-yellow,.ansi-bright-yellow-bg{background-color:#b27d12}.ansi-blue-fg{color:#208ffb}.ansi-blue-bg{background-color:#208ffb}.ansi-blue-intense-blue,.ansi-bright-blue-fg{color:#0065ca}.ansi-blue-intense-blue,.ansi-bright-blue-bg{background-color:#0065ca}.ansi-magenta-fg{color:#d160c4}.ansi-magenta-bg{background-color:#d160c4}.ansi-magenta-intense-magenta,.ansi-bright-magenta-fg{color:#a03196}.ansi-magenta-intense-magenta,.ansi-bright-magenta-bg{background-color:#a03196}.ansi-cyan-fg{color:#60c6c8}.ansi-cyan-bg{background-color:#60c6c8}.ansi-cyan-intense-cyan,.ansi-bright-cyan-fg{color:#258f8f}.ansi-cyan-intense-cyan,.ansi-bright-cyan-bg{background-color:#258f8f}.ansi-white-fg{color:#c5c1b4}.ansi-white-bg{background-color:#c5c1b4}.ansi-white-intense-white,.ansi-bright-white-fg{color:#a1a6b2}.ansi-white-intense-white,.ansi-bright-white-bg{background-color:#a1a6b2}.ansi-default-inverse-fg{color:#fff}.ansi-default-inverse-bg{background-color:#000}.ansi-bold{font-weight:bold}.ansi-underline{text-decoration:underline}:root{--quarto-body-bg: #fbfcfd;--quarto-body-color: #1b2430;--quarto-text-muted: #6c757d;--quarto-border-color: #dae0e8;--quarto-border-width: 1px}table.gt_table{color:var(--quarto-body-color);font-size:1em;width:100%;background-color:rgba(0,0,0,0);border-top-width:inherit;border-bottom-width:inherit;border-color:var(--quarto-border-color)}table.gt_table th.gt_column_spanner_outer{color:var(--quarto-body-color);background-color:rgba(0,0,0,0);border-top-width:inherit;border-bottom-width:inherit;border-color:var(--quarto-border-color)}table.gt_table th.gt_col_heading{color:var(--quarto-body-color);font-weight:bold;background-color:rgba(0,0,0,0)}table.gt_table thead.gt_col_headings{border-bottom:1px solid currentColor;border-top-width:inherit;border-top-color:var(--quarto-border-color)}table.gt_table thead.gt_col_headings:not(:first-child){border-top-width:1px;border-top-color:var(--quarto-border-color)}table.gt_table td.gt_row{border-bottom-width:1px;border-bottom-color:var(--quarto-border-color);border-top-width:0px}table.gt_table tbody.gt_table_body{border-top-width:1px;border-bottom-width:1px;border-bottom-color:var(--quarto-border-color);border-top-color:currentColor}div.columns{display:initial;gap:initial}div.column{display:inline-block;overflow-x:initial;vertical-align:top;width:50%}.code-annotation-tip-content{word-wrap:break-word}.code-annotation-container-hidden{display:none !important}dl.code-annotation-container-grid{display:grid;grid-template-columns:min-content auto}dl.code-annotation-container-grid dt{grid-column:1}dl.code-annotation-container-grid dd{grid-column:2}pre.sourceCode.code-annotation-code{padding-right:0}code.sourceCode .code-annotation-anchor{z-index:100;position:relative;float:right;background-color:rgba(0,0,0,0)}input[type=checkbox]{margin-right:.5ch}:root{--mermaid-bg-color: #fbfcfd;--mermaid-edge-color: #5a6879;--mermaid-node-fg-color: #1b2430;--mermaid-fg-color: #1b2430;--mermaid-fg-color--lighter: rgb(45.36, 60.48, 80.64);--mermaid-fg-color--lightest: rgb(63.72, 84.96, 113.28);--mermaid-font-family: IBM Plex Sans, system-ui, -apple-system, sans-serif;--mermaid-label-bg-color: #fbfcfd;--mermaid-label-fg-color: #20666f;--mermaid-node-bg-color: rgba(32, 102, 111, 0.1);--mermaid-node-fg-color: #1b2430}@media print{:root{font-size:11pt}#quarto-sidebar,#TOC,.nav-page{display:none}.page-columns .content{grid-column-start:page-start}.fixed-top{position:relative}.panel-caption,.figure-caption,figcaption{color:#666}}body.quarto-light .dark-content{display:none !important}body.quarto-dark .light-content{display:none !important}.code-copy-button{position:absolute;top:0;right:0;border:0;margin-top:5px;margin-right:5px;background-color:rgba(0,0,0,0);z-index:3}.code-copy-button-tooltip{font-size:.75em}.code-copy-button>.bi::before{display:inline-block;height:1rem;width:1rem;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="rgb(94, 94, 94)" viewBox="0 0 16 16"><path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"/><path d="M9.5 1a.5.5 0 0 1 .5.5vLine truncated
File diff suppressed because it is too large. Load diff
Binary file not shown.
+7
View File
@@ -0,0 +1,7 @@
/*!
* Bootstrap v5.3.1 (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).bootstrap=e()}(this,(function(){"use strict";const t=new Map,e={set(e,i,n){t.has(e)||t.set(e,new Map);const s=t.get(e);s.has(i)||0===s.size?s.set(i,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`)},get:(e,i)=>t.has(e)&&t.get(e).get(i)||null,remove(e,i){if(!t.has(e))return;const n=t.get(e);n.delete(i),0===n.size&&t.delete(e)}},i="transitionend",n=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),s=t=>{t.dispatchEvent(new Event(i))},o=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),r=t=>o(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(n(t)):null,a=t=>{if(!o(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(!i)return e;if(i!==t){const e=t.closest("summary");if(e&&e.parentNode!==i)return!1;if(null===e)return!1}return e},l=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),c=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?c(t.parentNode):null},h=()=>{},d=t=>{t.offsetHeight},u=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,f=[],p=()=>"rtl"===document.documentElement.dir,m=t=>{var e;e=()=>{const e=u();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}},"loading"===document.readyState?(f.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of f)t()})),f.push(e)):e()},g=(t,e=[],i=t)=>"function"==typeof t?t(...e):i,_=(t,e,n=!0)=>{if(!n)return void g(t);const o=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const n=Number.parseFloat(e),s=Number.parseFloat(i);return n||s?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(e)+5;let r=!1;const a=({target:n})=>{n===e&&(r=!0,e.removeEventListener(i,a),g(t))};e.addEventListener(i,a),setTimeout((()=>{r||s(e)}),o)},b=(t,e,i,n)=>{const s=t.length;let o=t.indexOf(e);return-1===o?!i&&n?t[s-1]:t[0]:(o+=i?1:-1,n&&(o=(o+s)%s),t[Math.max(0,Math.min(o,s-1))])},v=/[^.]*(?=\..*)\.|.*/,y=/\..*/,w=/::\d+$/,A={};let E=1;const T={mouseenter:"mouseover",mouseleave:"mouseout"},C=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function O(t,e){return e&&`${e}::${E++}`||t.uidEvent||E++}function x(t){const e=O(t);return t.uidEvent=e,A[e]=A[e]||{},A[e]}function k(t,e,i=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===i))}function L(t,e,i){const n="string"==typeof e,s=n?i:e||i;let o=I(t);return C.has(o)||(o=t),[n,s,o]}function S(t,e,i,n,s){if("string"!=typeof e||!t)return;let[o,r,a]=L(e,i,n);if(e in T){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};r=t(r)}const l=x(t),c=l[a]||(l[a]={}),h=k(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=O(r,e.replace(v,"")),u=o?function(t,e,i){return function n(s){const o=t.querySelectorAll(e);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return P(s,{delegateTarget:r}),n.oneOff&&N.off(t,s.type,e,i),i.apply(r,[s])}}(t,i,r):function(t,e){return function i(n){return P(n,{delegateTarget:t}),i.oneOff&&N.off(t,n.type,e),e.apply(t,[n])}}(t,r);u.delegationSelector=o?i:null,u.callable=r,u.oneOff=s,u.uidEvent=d,c[d]=u,t.addEventListener(a,u,o)}function D(t,e,i,n,s){const o=k(e[i],n,s);o&&(t.removeEventListener(i,o,Boolean(s)),delete e[i][o.uidEvent])}function $(t,e,i,n){const s=e[i]||{};for(const[o,r]of Object.entries(s))o.includes(n)&&D(t,e,i,r.callable,r.delegationSelector)}function I(t){return t=t.replace(y,""),T[t]||t}const N={on(t,e,i,n){S(t,e,i,n,!1)},one(t,e,i,n){S(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[s,o,r]=L(e,i,n),a=r!==e,l=x(t),c=l[r]||{},h=e.startsWith(".");if(void 0===o){if(h)for(const i of Object.keys(l))$(t,l,i,e.slLine truncated
//# sourceMappingURL=bootstrap.bundle.min.js.map
+7
View File
@@ -0,0 +1,7 @@
/*!
* clipboard.js v2.0.11
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return b}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),r=n.n(e);function c(t){try{return document.execCommand(t)}catch(t){return}}var a=function(t){t=r()(t);return c("cut"),t};function o(t,e){var n,o,t=(n=t,o="rtl"===document.documentElement.getAttribute("dir"),(t=document.createElement("textarea")).style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0",t.style.position="absolute",t.style[o?"right":"left"]="-9999px",o=window.pageYOffset||document.documentElement.scrollTop,t.style.top="".concat(o,"px"),t.setAttribute("readonly",""),t.value=n,t);return e.container.appendChild(t),e=r()(t),c("copy"),t.remove(),e}var f=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return"string"==typeof t?n=o(t,e):t instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==t?void 0:t.type)?n=o(t.value,e):(n=r()(t),c("copy")),n};function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.action,n=void 0===e?"copy":e,o=t.container,e=t.target,t=t.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==e){if(!e||"object"!==l(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return t?f(t,{container:o}):e?"cut"===n?a(e):f(e,{container:o}):void 0};function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function y(t,e){return(y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(n){var o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=v(n);return t=o?(t=v(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments),e=this,!(t=t)||"object"!==p(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(t,e){t="data-clipboard-".concat(t);if(e.hasAttribute(t))return e.getAttribute(t)}var b=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)}(r,i());var t,e,n,o=h(r);function r(t,e){var n;return function(t){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this),(n=o.call(this)).resolveOptions(e),n.listenClick(t),n}return t=r,n=[{key:"copy",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body};return f(t,e)}},{key:"cut",value:function(t){return a(t)}},{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof t?[t]:t,e=!!document.queryCommandSupported;return t.forEach(function(t){e=e&&!!document.queryCommandSupported(t)}),e}}],(e=[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===p(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=u()(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget,n=this.action(e)||"copy",t=s({action:n,container:thLine truncated
@@ -0,0 +1,86 @@
/* exo — exercise cards, hint folds (sequential unlock), solution fold */
.exo {
margin: 1.2rem 0;
padding: 0.6rem 0.9rem;
border: 1px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 35%, transparent);
border-left: 3px solid var(--calc-notecolor, #B45309);
border-radius: 0.35rem;
scroll-margin-top: 5rem;
}
/* keep wide content inside the card: display math (and tables/code) scroll
on their own rather than spilling past the border. overflow-y stays hidden
so Firefox doesn't add a phantom vertical bar, as in .calc */
.exo mjx-container[display="true"],
.exo .katex-display {
max-width: 100%;
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 0.35em; /* keep descenders clear of a horizontal bar */
/* a centred overflowing box clips its left side out of reach, so centre
only while the formula fits (browsers without `safe` keep plain centring) */
display: flex;
justify-content: center;
justify-content: safe center;
}
.exo .math.display { display: block; max-width: 100%; }
.exo :is(pre, table) { max-width: 100%; overflow-x: auto; }
.exo img, .exo svg { max-width: 100%; }
.exo-head p { margin: 0 0 0.4rem; }
.exo-head strong { color: var(--calc-notecolor, #B45309); }
.exo details {
margin: 0.45rem 0;
border-radius: 0.3rem;
}
.exo details > summary {
cursor: pointer;
list-style: none;
user-select: none;
font-size: 0.9em;
font-weight: 600;
}
.exo details > summary::-webkit-details-marker { display: none; }
.exo details > summary::before { content: "▸ "; }
.exo details[open] > summary::before { content: "▾ "; }
/* hints: small highlight boxes */
.exo-hint {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 6%, transparent);
border: 1px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 30%, transparent);
padding: 0.25rem 0.6rem;
}
.exo-hint > summary { color: var(--calc-notecolor, #B45309); }
/* locked hints: unlock one by one */
.exo-hint.exo-locked > summary {
cursor: not-allowed;
opacity: 0.45;
}
.exo-hint.exo-locked > summary::before { content: "🔒 "; }
/* solution: closed by default, visually separated */
.exo-sol {
border-top: 1px dashed color-mix(in srgb, var(--calc-notecolor, #B45309) 40%, transparent);
padding: 0.35rem 0.1rem 0.1rem;
scroll-margin-top: 5rem;
}
/* in a numbered part, the fold lines up with the part's text */
.exo li > details { margin-left: 0; }
/* hand-in extracts (handin.sh, html output) */
.exo-handin-sol, .exo-handin-hint {
margin: 0.6rem 0;
padding: 0.2rem 0 0.2rem 0.8rem;
border-left: 2px solid var(--calc-notecolor, #B45309);
}
.exo-fold-body { margin-top: 0.3rem; }
.exo-fold-body > p:first-child { margin-top: 0; }
.exo-fold-body > p:last-child { margin-bottom: 0; }
@media print {
.exo details > summary::before { content: ""; }
.exo-hint.exo-locked > summary { opacity: 1; cursor: default; }
}
@@ -0,0 +1,39 @@
// exo — hints unlock one by one within a part; everything unfolds for printing
(function () {
// block opening a locked hint
document.addEventListener("click", function (e) {
var s = e.target.closest ? e.target.closest("details.exo-hint.exo-locked > summary") : null;
if (s) e.preventDefault();
});
// opening hint n of a part unlocks hint n+1 of the same part, wherever it
// sits in the exercise (toggle doesn't bubble: use capture)
document.addEventListener("toggle", function (e) {
var d = e.target;
if (!d.classList || !d.classList.contains("exo-hint") || !d.open) return;
var chain = d.getAttribute("data-exo-chain");
var n = parseInt(d.getAttribute("data-exo-hint"), 10);
if (!chain || isNaN(n)) return;
var hints = document.querySelectorAll("details.exo-hint[data-exo-chain]");
for (var i = 0; i < hints.length; i++) {
if (hints[i].getAttribute("data-exo-chain") === chain &&
parseInt(hints[i].getAttribute("data-exo-hint"), 10) === n + 1) {
hints[i].classList.remove("exo-locked");
}
}
}, true);
// print: open all hints/solutions, restore afterwards
window.addEventListener("beforeprint", function () {
document.querySelectorAll(".exo details").forEach(function (d) {
d.dataset.exoWasOpen = d.open ? "1" : "0";
d.open = true;
});
});
window.addEventListener("afterprint", function () {
document.querySelectorAll(".exo details").forEach(function (d) {
d.open = d.dataset.exoWasOpen === "1";
delete d.dataset.exoWasOpen;
});
});
})();
@@ -0,0 +1,77 @@
/* glossary — usages, entries, hover tooltip */
/* usages: dotted underline, keep math color */
a.gls-sym,
mjx-container a {
color: inherit;
text-decoration: none;
}
.gls-sym {
border-bottom: 1px dotted currentColor;
cursor: help;
}
/* rendered glossary list */
.glossary .gls-entry {
margin: 0.8rem 0;
padding: 0.35rem 0.7rem;
border-left: 3px solid var(--calc-notecolor, #B45309);
scroll-margin-top: 5rem; /* don't hide behind Quarto's sticky header */
}
.glossary .gls-entry p { margin: 0 0 0.2rem; }
.glossary .gls-entry:target {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 10%, transparent);
border-radius: 0.25rem;
}
/* floating hover tooltip (filled by glossary.js) */
.gls-float {
position: absolute;
z-index: 1000;
max-width: 26rem;
padding: 0.5rem 0.75rem;
border: 1px solid var(--calc-notecolor, #B45309);
border-radius: 0.4rem;
background: var(--bs-body-bg, #fff);
color: var(--bs-body-color, #1a1a1a);
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
font-size: 0.9em;
line-height: 1.4;
}
.gls-float p { margin: 0 0 0.25rem; }
.gls-float p:last-child { margin-bottom: 0; }
/* in-place definition cards and property sub-entries */
.gls-inline {
margin: 1rem 0;
padding: 0.4rem 0.8rem;
border-left: 3px solid var(--calc-notecolor, #B45309);
scroll-margin-top: 5rem;
}
.gls-inline p { margin: 0 0 0.3rem; }
.gls-inline:target,
.gls-prop-entry:target {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 10%, transparent);
border-radius: 0.25rem;
}
.gls-prop-entry {
margin: 0.5rem 0 0.5rem 1.2rem;
padding: 0.25rem 0.6rem;
border-left: 2px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 45%, transparent);
font-size: 0.95em;
scroll-margin-top: 5rem;
}
.gls-back {
font-size: 0.85em;
opacity: 0.75;
}
/* standalone property cards keep the section flow (no indent) */
.gls-prop-entry.gls-standalone {
margin-left: 0;
font-size: 1em;
}
.glossary .gls-prop-line {
margin: 0.1rem 0 0.1rem 1.2rem;
font-size: 0.9em;
}
@@ -0,0 +1,68 @@
// glossary — hover tooltip for .gls-sym usages (prose links and MathJax \class nodes)
(function () {
var tip = null;
function ensureTip() {
if (tip === null) {
tip = document.createElement("div");
tip.className = "gls-float";
tip.style.display = "none";
document.body.appendChild(tip);
}
return tip;
}
function keyOf(el) {
if (el.dataset && el.dataset.glsKey) return el.dataset.glsKey;
for (var i = 0; i < el.classList.length; i++) {
var c = el.classList[i];
if (c.indexOf("gls-key-") === 0) return c.slice(8);
}
return null;
}
function show(target) {
var key = keyOf(target);
if (!key) return;
var entry = document.getElementById("gls-" + key);
var t = ensureTip();
if (entry) {
// for a main entry, don't drag every property into the popup
var node = entry.cloneNode(true);
node.querySelectorAll(".gls-prop-entry").forEach(function (n) { n.remove(); });
t.innerHTML = node.innerHTML;
} else if (window.__glsData && window.__glsData[key]) {
// entry lives on another page (book chapters render separately)
t.innerHTML = window.__glsData[key];
} else {
return;
}
t.style.display = "block";
if (window.MathJax && window.MathJax.typesetPromise) {
window.MathJax.typesetPromise([t]).catch(function () {});
}
var r = target.getBoundingClientRect();
var x = r.left + window.scrollX;
var y = r.bottom + window.scrollY + 6;
// keep it on screen horizontally
var w = t.offsetWidth;
var maxX = window.scrollX + document.documentElement.clientWidth - w - 12;
t.style.left = Math.max(window.scrollX + 8, Math.min(x, maxX)) + "px";
t.style.top = y + "px";
}
function hide() {
if (tip !== null) tip.style.display = "none";
}
document.addEventListener("mouseover", function (e) {
var el = e.target.closest ? e.target.closest(".gls-sym") : null;
if (el) show(el);
});
document.addEventListener("mouseout", function (e) {
var el = e.target.closest ? e.target.closest(".gls-sym") : null;
if (el) hide();
});
document.addEventListener("click", hide);
window.addEventListener("scroll", hide, { passive: true });
})();
@@ -0,0 +1,45 @@
/* latex-tables — HTML rendering of LaTeX tabular environments */
.ltx-table {
border-collapse: collapse;
margin: 1rem auto;
max-width: 100%;
overflow-x: auto;
display: table;
}
.ltx-table th,
.ltx-table td {
padding: 0.35em 0.7em;
vertical-align: top;
line-height: 1.4;
}
.ltx-table th {
font-weight: 600;
}
/* alignment */
.ltx-l { text-align: left; }
.ltx-c { text-align: center; }
.ltx-r { text-align: right; }
/* vertical rules (from | in the column spec) */
.ltx-bl { border-left: 1px solid currentColor; }
.ltx-br { border-right: 1px solid currentColor; }
/* horizontal rules: t = above the row, b = below.
1 = \hline / \midrule / \cline, 2 = booktabs \toprule / \bottomrule,
d = doubled rule (\hline\hline) */
.ltx-t1 { border-top: 1px solid currentColor; }
.ltx-b1 { border-bottom: 1px solid currentColor; }
.ltx-t2 { border-top: 1.6px solid currentColor; }
.ltx-b2 { border-bottom: 1.6px solid currentColor; }
.ltx-td { border-top: 3px double currentColor; }
.ltx-bd { border-bottom: 3px double currentColor; }
/* keep wide tables usable on narrow screens */
@media (max-width: 700px) {
.ltx-table { font-size: 0.9em; }
.ltx-table th, .ltx-table td { padding: 0.25em 0.45em; }
}
@@ -0,0 +1,100 @@
/* calc-notes — HTML layout for the calc / calc* environments */
.calc {
display: grid;
/* lhs | rhs | notes | equation number */
grid-template-columns: max-content max-content minmax(8rem, 1fr) auto;
column-gap: 0.35rem;
row-gap: 0.6rem;
align-items: baseline;
margin: 1rem 0 1.4rem;
/* allow horizontal scrolling for very wide equations, but never show a
vertical bar (Firefox computes phantom vertical overflow otherwise) */
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 0.4em; /* keep descenders clear of a horizontal bar */
}
.calc-row { display: contents; }
.calc-lhs { grid-column: 1; justify-self: end; }
.calc-rhs { grid-column: 2; justify-self: start; }
.calc-full { grid-column: 1 / 3; justify-self: start; }
/* ---- notes ------------------------------------------------------- */
.calc-notes {
grid-column: 3;
display: flex;
flex-wrap: wrap;
gap: 0.35rem 0.75rem;
align-items: baseline;
min-width: 0;
padding-left: 0.9rem;
}
.calc-note {
color: var(--calc-notecolor, #B45309);
font-size: 0.85em;
line-height: 1.35;
}
.calc-note > summary {
cursor: pointer;
list-style: none; /* remove the default triangle ... */
user-select: none;
opacity: 0.7;
font-style: italic;
}
.calc-note > summary::-webkit-details-marker { display: none; }
.calc-note > summary::before { content: "▸ "; font-style: normal; }
.calc-note[open] > summary::before { content: "▾ "; }
.calc-note > summary:hover { opacity: 1; }
.calc-note[open] {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 8%, transparent);
border-left: 2px solid var(--calc-notecolor, #B45309);
border-radius: 0.25rem;
padding: 0.15rem 0.45rem;
}
.calc-note-body { margin-top: 0.1rem; }
.calc-note-body p { margin: 0; }
/* \mnote: math note (no extra styling needed — body is typeset math) */
.calc-note-math .calc-note-body { padding: 0.1rem 0; }
/* ---- calc*: boxed final result ----------------------------------- */
.calc-box {
display: inline-block;
border: 1.5px solid currentColor;
border-radius: 0.3em;
padding: 0.3em 0.65em;
margin-top: 0.15em;
background: color-mix(in srgb, currentColor 4%, transparent);
}
/* ---- labelled blocks: equation number on the last line ----------- */
.calc-tag {
grid-column: 4;
justify-self: end;
padding-left: 1rem;
white-space: nowrap;
}
/* ---- printing: show notes unfolded, like the PDF ------------------ */
@media print {
.calc-note > summary { display: none; }
.calc-note[open] { background: none; border: none; padding: 0; }
}
/* small screens: notes drop under the equation line */
@media (max-width: 560px) {
.calc { grid-template-columns: max-content 1fr; }
.calc-notes { grid-column: 1 / 3; padding-left: 1.5rem; }
.calc-full { grid-column: 1 / 3; }
.calc-tag { grid-column: 1 / -1; }
}
@@ -0,0 +1,15 @@
// calc-notes — open every note before printing, restore afterwards
(function () {
window.addEventListener("beforeprint", function () {
document.querySelectorAll("details.calc-note").forEach(function (d) {
d.dataset.calcWasOpen = d.open ? "1" : "0";
d.open = true;
});
});
window.addEventListener("afterprint", function () {
document.querySelectorAll("details.calc-note").forEach(function (d) {
d.open = d.dataset.calcWasOpen === "1";
delete d.dataset.calcWasOpen;
});
});
})();
+9
View File
@@ -0,0 +1,9 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
//
// AnchorJS - v5.0.0 - 2023-01-18
// https://www.bryanbraun.com/anchorjs/
// Copyright (c) 2023 Bryan Braun; Licensed MIT
//
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
!function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(globalThis,function(){"use strict";return function(A){function u(A){A.icon=Object.prototype.hasOwnProperty.call(A,"icon")?A.icon:"",A.visible=Object.prototype.hasOwnProperty.call(A,"visible")?A.visible:"hover",A.placement=Object.prototype.hasOwnProperty.call(A,"placement")?A.placement:"right",A.ariaLabel=Object.prototype.hasOwnProperty.call(A,"ariaLabel")?A.ariaLabel:"Anchor",A.class=Object.prototype.hasOwnProperty.call(A,"class")?A.class:"",A.base=Object.prototype.hasOwnProperty.call(A,"base")?A.base:"",A.truncate=Object.prototype.hasOwnProperty.call(A,"truncate")?Math.floor(A.truncate):64,A.titleText=Object.prototype.hasOwnProperty.call(A,"titleText")?A.titleText:""}function d(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new TypeError("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],u(this.options),this.add=function(A){var e,t,o,i,n,s,a,r,l,c,h,p=[];if(u(this.options),0!==(e=d(A=A||"h2, h3, h4, h5, h6")).length){for(null===document.head.querySelector("style.anchorjs")&&((A=document.createElement("style")).className="anchorjs",A.appendChild(document.createTextNode("")),void 0===(h=document.head.querySelector('[rel="stylesheet"],style'))?document.head.appendChild(A):document.head.insertBefore(A,h),A.sheet.insertRule(".anchorjs-link{opacity:0;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}",A.sheet.cssRules.length),A.sheet.insertRule(":hover>.anchorjs-link,.anchorjs-link:focus{opacity:1}",A.sheet.cssRules.length),A.sheet.insertRule("[data-anchorjs-icon]::after{content:attr(data-anchorjs-icon)}",A.sheet.cssRules.length),A.sheet.insertRule('@font-face{font-family:anchorjs-icons;src:url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype")}',A.sheet.cssRules.length)),h=document.querySelectorAll("[id]"),t=[].map.call(h,function(A){return A.id}),i=0;i<e.length;i++)if(this.hasAnchorJSLink(e[i]))p.push(i);else{if(e[i].hasAttribute("id"))o=e[i].getAttribute("id");else if(e[i].hasAttribute("data-anchor-id"))o=e[i].getAttribute("data-anchor-id");else{for(r=a=this.urlify(e[i].textContent),s=0;n=t.indexOf(r=void 0!==n?a+"-"+s:r),s+=1,-1!==n;);n=void 0,t.push(r),e[i].setAttribute("id",r),o=r}(l=document.createElement("a")).className="anchorjs-link "+this.options.class,l.setAttribute("aria-label",this.options.ariaLabel),l.setAttribute("data-anchorjs-icon",this.options.icon),this.options.titleText&&(l.title=this.options.titleText),c=document.querySelector("base")?window.location.pathname+window.location.search:"",c=this.options.base||c,l.href=c+"#"+o,"always"===this.options.visible&&(l.style.opacity="1"),""===this.options.icon&&(l.style.font="1em/1 anchorjs-icons","left"===this.options.placement)&&(l.style.lineHeight="inherit"),"left"===this.options.placement?(l.style.position="absolute",l.style.marginLeft="-1.25em",l.style.paddingRight=".25em",l.style.paddingLeft=".25em",e[i].insertBefore(l,e[i].firstChild)):(l.style.marginLeft=".1875em",l.style.paddingRight=".1875em",l.style.paddingLeft=".1875em",e[i].appendChild(l))}for(i=0;i<p.length;i++)e.splice(p[i]-i,1);this.elements=this.elements.concat(e)}return this},this.remove=function(A){for(var e,t,o=d(A),i=0;i<o.length;i++)(t=o[i].querySelector(".anchorjs-link"))&&(-1!==(e=this.elements.indexOf(o[i]))&&this.elements.splice(e,1),o[i].removeChild(t));return this},this.removeAll=function(){thisLine truncated
// @license-end
+6
View File
@@ -0,0 +1,6 @@
/**
* @popperjs/core v2.11.7 - MIT License
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,(function(e){"use strict";function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function n(e){return e instanceof t(e).Element||e instanceof Element}function r(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}var i=Math.max,a=Math.min,s=Math.round;function f(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function c(){return!/^((?!chrome|android).)*safari/i.test(f())}function p(e,o,i){void 0===o&&(o=!1),void 0===i&&(i=!1);var a=e.getBoundingClientRect(),f=1,p=1;o&&r(e)&&(f=e.offsetWidth>0&&s(a.width)/e.offsetWidth||1,p=e.offsetHeight>0&&s(a.height)/e.offsetHeight||1);var u=(n(e)?t(e):window).visualViewport,l=!c()&&i,d=(a.left+(l&&u?u.offsetLeft:0))/f,h=(a.top+(l&&u?u.offsetTop:0))/p,m=a.width/f,v=a.height/p;return{width:m,height:v,top:h,right:d+m,bottom:h+v,left:d,x:d,y:h}}function u(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function l(e){return e?(e.nodeName||"").toLowerCase():null}function d(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function h(e){return p(d(e)).left+u(e).scrollLeft}function m(e){return t(e).getComputedStyle(e)}function v(e){var t=m(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function y(e,n,o){void 0===o&&(o=!1);var i,a,f=r(n),c=r(n)&&function(e){var t=e.getBoundingClientRect(),n=s(t.width)/e.offsetWidth||1,r=s(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(n),m=d(n),y=p(e,c,o),g={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(f||!f&&!o)&&(("body"!==l(n)||v(m))&&(g=(i=n)!==t(i)&&r(i)?{scrollLeft:(a=i).scrollLeft,scrollTop:a.scrollTop}:u(i)),r(n)?((b=p(n,!0)).x+=n.clientLeft,b.y+=n.clientTop):m&&(b.x=h(m))),{x:y.left+g.scrollLeft-b.x,y:y.top+g.scrollTop-b.y,width:y.width,height:y.height}}function g(e){var t=p(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function b(e){return"html"===l(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||d(e)}function x(e){return["html","body","#document"].indexOf(l(e))>=0?e.ownerDocument.body:r(e)&&v(e)?e:x(b(e))}function w(e,n){var r;void 0===n&&(n=[]);var o=x(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=t(o),s=i?[a].concat(a.visualViewport||[],v(o)?o:[]):o,f=n.concat(s);return i?f:f.concat(w(b(s)))}function O(e){return["table","td","th"].indexOf(l(e))>=0}function j(e){return r(e)&&"fixed"!==m(e).position?e.offsetParent:null}function E(e){for(var n=t(e),i=j(e);i&&O(i)&&"static"===m(i).position;)i=j(i);return i&&("html"===l(i)||"body"===l(i)&&"static"===m(i).position)?n:i||function(e){var t=/firefox/i.test(f());if(/Trident/i.test(f())&&r(e)&&"fixed"===m(e).position)return null;var n=b(e);for(o(n)&&(n=n.host);r(n)&&["html","body"].indexOf(l(n))<0;){var i=m(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||n}var D="top",A="bottom",L="right",P="left",M="auto",k=[D,A,L,P],W="start",B="end",H="viewport",T="popper",R=k.reduce((function(e,t){return e.concat([t+"-"+W,t+"-"+B])}),[]),S=[].concat(k,[M]).reduce((function(e,t){return e.concat([t,t+"-"+W,t+"-"+B])}),[]),V=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function q(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function C(e){return e.split("-")[0]}function N(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function I(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function _(e,r,o){return r===H?I(function(e,n){var r=t(e),o=d(e),i=r.visualViewport,a=o.clientWidth,s=o.clientHeight,f=0,p=0;if(i){a=i.width,s=i.height;var u=c();(u||!u&&"fixed"===n)&&(f=i.offsetLeft,p=i.offsetTop)}return{width:a,height:s,x:f+h(e),y:p}}(e,o)):n(r)?function(e,t){var n=p(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.lLine truncated
@@ -0,0 +1,236 @@
/* quarto syntax highlight colors */
:root {
--quarto-hl-ot-color: #003B4F;
--quarto-hl-at-color: #657422;
--quarto-hl-ss-color: #20794D;
--quarto-hl-an-color: #5E5E5E;
--quarto-hl-fu-color: #4758AB;
--quarto-hl-st-color: #20794D;
--quarto-hl-cf-color: #003B4F;
--quarto-hl-op-color: #5E5E5E;
--quarto-hl-er-color: #AD0000;
--quarto-hl-bn-color: #AD0000;
--quarto-hl-al-color: #AD0000;
--quarto-hl-va-color: #111111;
--quarto-hl-bu-color: inherit;
--quarto-hl-ex-color: inherit;
--quarto-hl-pp-color: #AD0000;
--quarto-hl-in-color: #5E5E5E;
--quarto-hl-vs-color: #20794D;
--quarto-hl-wa-color: #5E5E5E;
--quarto-hl-do-color: #5E5E5E;
--quarto-hl-im-color: #00769E;
--quarto-hl-ch-color: #20794D;
--quarto-hl-dt-color: #AD0000;
--quarto-hl-fl-color: #AD0000;
--quarto-hl-co-color: #5E5E5E;
--quarto-hl-cv-color: #5E5E5E;
--quarto-hl-cn-color: #8f5902;
--quarto-hl-sc-color: #5E5E5E;
--quarto-hl-dv-color: #AD0000;
--quarto-hl-kw-color: #003B4F;
}
/* other quarto variables */
:root {
--quarto-font-monospace: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
/* syntax highlight based on Pandoc's rules */
pre > code.sourceCode > span {
color: #003B4F;
}
code.sourceCode > span {
color: #003B4F;
}
div.sourceCode,
div.sourceCode pre.sourceCode {
color: #003B4F;
}
/* Normal */
code span {
color: #003B4F;
}
/* Alert */
code span.al {
color: #AD0000;
font-style: inherit;
}
/* Annotation */
code span.an {
color: #5E5E5E;
font-style: inherit;
}
/* Attribute */
code span.at {
color: #657422;
font-style: inherit;
}
/* BaseN */
code span.bn {
color: #AD0000;
font-style: inherit;
}
/* BuiltIn */
code span.bu {
font-style: inherit;
}
/* ControlFlow */
code span.cf {
color: #003B4F;
font-weight: bold;
font-style: inherit;
}
/* Char */
code span.ch {
color: #20794D;
font-style: inherit;
}
/* Constant */
code span.cn {
color: #8f5902;
font-style: inherit;
}
/* Comment */
code span.co {
color: #5E5E5E;
font-style: inherit;
}
/* CommentVar */
code span.cv {
color: #5E5E5E;
font-style: italic;
}
/* Documentation */
code span.do {
color: #5E5E5E;
font-style: italic;
}
/* DataType */
code span.dt {
color: #AD0000;
font-style: inherit;
}
/* DecVal */
code span.dv {
color: #AD0000;
font-style: inherit;
}
/* Error */
code span.er {
color: #AD0000;
font-style: inherit;
}
/* Extension */
code span.ex {
font-style: inherit;
}
/* Float */
code span.fl {
color: #AD0000;
font-style: inherit;
}
/* Function */
code span.fu {
color: #4758AB;
font-style: inherit;
}
/* Import */
code span.im {
color: #00769E;
font-style: inherit;
}
/* Information */
code span.in {
color: #5E5E5E;
font-style: inherit;
}
/* Keyword */
code span.kw {
color: #003B4F;
font-weight: bold;
font-style: inherit;
}
/* Operator */
code span.op {
color: #5E5E5E;
font-style: inherit;
}
/* Other */
code span.ot {
color: #003B4F;
font-style: inherit;
}
/* Preprocessor */
code span.pp {
color: #AD0000;
font-style: inherit;
}
/* SpecialChar */
code span.sc {
color: #5E5E5E;
font-style: inherit;
}
/* SpecialString */
code span.ss {
color: #20794D;
font-style: inherit;
}
/* String */
code span.st {
color: #20794D;
font-style: inherit;
}
/* Variable */
code span.va {
color: #111111;
font-style: inherit;
}
/* VerbatimString */
code span.vs {
color: #20794D;
font-style: inherit;
}
/* Warning */
code span.wa {
color: #5E5E5E;
font-style: italic;
}
.prevent-inlining {
content: "</";
}
/*# sourceMappingURL=39d13593ecb7db6d02e40e1582482a0e.css.map */
+845
View File
@@ -0,0 +1,845 @@
import * as tabsets from "./tabsets/tabsets.js";
const sectionChanged = new CustomEvent("quarto-sectionChanged", {
detail: {},
bubbles: true,
cancelable: false,
composed: false,
});
const layoutMarginEls = () => {
// Find any conflicting margin elements and add margins to the
// top to prevent overlap
const marginChildren = window.document.querySelectorAll(
".column-margin.column-container > *, .margin-caption, .aside"
);
let lastBottom = 0;
for (const marginChild of marginChildren) {
if (marginChild.offsetParent !== null) {
// clear the top margin so we recompute it
marginChild.style.marginTop = null;
const top = marginChild.getBoundingClientRect().top + window.scrollY;
if (top < lastBottom) {
const marginChildStyle = window.getComputedStyle(marginChild);
const marginBottom = parseFloat(marginChildStyle["marginBottom"]);
const margin = lastBottom - top + marginBottom;
marginChild.style.marginTop = `${margin}px`;
}
const styles = window.getComputedStyle(marginChild);
const marginTop = parseFloat(styles["marginTop"]);
lastBottom = top + marginChild.getBoundingClientRect().height + marginTop;
}
}
};
window.document.addEventListener("DOMContentLoaded", function (_event) {
// Recompute the position of margin elements anytime the body size changes
if (window.ResizeObserver) {
const resizeObserver = new window.ResizeObserver(
throttle(() => {
layoutMarginEls();
if (
window.document.body.getBoundingClientRect().width < 990 &&
isReaderMode()
) {
quartoToggleReader();
}
}, 50)
);
resizeObserver.observe(window.document.body);
}
const tocEl = window.document.querySelector('nav.toc-active[role="doc-toc"]');
const sidebarEl = window.document.getElementById("quarto-sidebar");
const leftTocEl = window.document.getElementById("quarto-sidebar-toc-left");
const marginSidebarEl = window.document.getElementById(
"quarto-margin-sidebar"
);
// function to determine whether the element has a previous sibling that is active
const prevSiblingIsActiveLink = (el) => {
const sibling = el.previousElementSibling;
if (sibling && sibling.tagName === "A") {
return sibling.classList.contains("active");
} else {
return false;
}
};
// dispatch for htmlwidgets
// they use slideenter event to trigger resize
function fireSlideEnter() {
const event = window.document.createEvent("Event");
event.initEvent("slideenter", true, true);
window.document.dispatchEvent(event);
}
const tabs = window.document.querySelectorAll('a[data-bs-toggle="tab"]');
tabs.forEach((tab) => {
tab.addEventListener("shown.bs.tab", fireSlideEnter);
});
// dispatch for shiny
// they use BS shown and hidden events to trigger rendering
function distpatchShinyEvents(previous, current) {
if (window.jQuery) {
if (previous) {
window.jQuery(previous).trigger("hidden");
}
if (current) {
window.jQuery(current).trigger("shown");
}
}
}
// tabby.js listener: Trigger event for htmlwidget and shiny
document.addEventListener(
"tabby",
function (event) {
fireSlideEnter();
distpatchShinyEvents(event.detail.previousTab, event.detail.tab);
},
false
);
// Track scrolling and mark TOC links as active
// get table of contents and sidebar (bail if we don't have at least one)
const tocLinks = tocEl
? [...tocEl.querySelectorAll("a[data-scroll-target]")]
: [];
const makeActive = (link) => tocLinks[link].classList.add("active");
const removeActive = (link) => tocLinks[link].classList.remove("active");
const removeAllActive = () =>
[...Array(tocLinks.length).keys()].forEach((link) => removeActive(link));
// activate the anchor for a section associated with this TOC entry
tocLinks.forEach((link) => {
link.addEventListener("click", () => {
if (link.href.indexOf("#") !== -1) {
const anchor = link.href.split("#")[1];
const heading = window.document.querySelector(
`[data-anchor-id="${anchor}"]`
);
if (heading) {
// Add the class
heading.classList.add("reveal-anchorjs-link");
// function to show the anchor
const handleMouseout = () => {
heading.classList.remove("reveal-anchorjs-link");
heading.removeEventListener("mouseout", handleMouseout);
};
// add a function to clear the anchor when the user mouses out of it
heading.addEventListener("mouseout", handleMouseout);
}
}
});
});
const sections = tocLinks.map((link) => {
const target = link.getAttribute("data-scroll-target");
if (target.startsWith("#")) {
return window.document.getElementById(decodeURI(`${target.slice(1)}`));
} else {
return window.document.querySelector(decodeURI(`${target}`));
}
});
const sectionMargin = 200;
let currentActive = 0;
// track whether we've initialized state the first time
let init = false;
const updateActiveLink = () => {
// The index from bottom to top (e.g. reversed list)
let sectionIndex = -1;
if (
window.innerHeight + window.pageYOffset >=
window.document.body.offsetHeight
) {
// This is the no-scroll case where last section should be the active one
sectionIndex = 0;
} else {
// This finds the last section visible on screen that should be made active
sectionIndex = [...sections].reverse().findIndex((section) => {
if (section) {
return window.pageYOffset >= section.offsetTop - sectionMargin;
} else {
return false;
}
});
}
if (sectionIndex > -1) {
const current = sections.length - sectionIndex - 1;
if (current !== currentActive) {
removeAllActive();
currentActive = current;
makeActive(current);
if (init) {
window.dispatchEvent(sectionChanged);
}
init = true;
}
}
};
const inHiddenRegion = (top, bottom, hiddenRegions) => {
for (const region of hiddenRegions) {
if (top <= region.bottom && bottom >= region.top) {
return true;
}
}
return false;
};
const categorySelector = "header.quarto-title-block .quarto-category";
const activateCategories = (href) => {
// Find any categories
// Surround them with a link pointing back to:
// #category=Authoring
try {
const categoryEls = window.document.querySelectorAll(categorySelector);
for (const categoryEl of categoryEls) {
const categoryText = categoryEl.textContent;
if (categoryText) {
const link = `${href}#category=${encodeURIComponent(categoryText)}`;
const linkEl = window.document.createElement("a");
linkEl.setAttribute("href", link);
for (const child of categoryEl.childNodes) {
linkEl.append(child);
}
categoryEl.appendChild(linkEl);
}
}
} catch {
// Ignore errors
}
};
function hasTitleCategories() {
return window.document.querySelector(categorySelector) !== null;
}
function offsetRelativeUrl(url) {
const offset = getMeta("quarto:offset");
return offset ? offset + url : url;
}
function offsetAbsoluteUrl(url) {
const offset = getMeta("quarto:offset");
const baseUrl = new URL(offset, window.location);
const projRelativeUrl = url.replace(baseUrl, "");
if (projRelativeUrl.startsWith("/")) {
return projRelativeUrl;
} else {
return "/" + projRelativeUrl;
}
}
// read a meta tag value
function getMeta(metaName) {
const metas = window.document.getElementsByTagName("meta");
for (let i = 0; i < metas.length; i++) {
if (metas[i].getAttribute("name") === metaName) {
return metas[i].getAttribute("content");
}
}
return "";
}
async function findAndActivateCategories() {
// Categories search with listing only use path without query
const currentPagePath = offsetAbsoluteUrl(
window.location.origin + window.location.pathname
);
const response = await fetch(offsetRelativeUrl("listings.json"));
if (response.status == 200) {
return response.json().then(function (listingPaths) {
const listingHrefs = [];
for (const listingPath of listingPaths) {
const pathWithoutLeadingSlash = listingPath.listing.substring(1);
for (const item of listingPath.items) {
const encodedItem = encodeURI(item);
if (
encodedItem === currentPagePath ||
encodedItem === currentPagePath + "index.html"
) {
// Resolve this path against the offset to be sure
// we already are using the correct path to the listing
// (this adjusts the listing urls to be rooted against
// whatever root the page is actually running against)
const relative = offsetRelativeUrl(pathWithoutLeadingSlash);
const baseUrl = window.location;
const resolvedPath = new URL(relative, baseUrl);
listingHrefs.push(resolvedPath.pathname);
break;
}
}
}
// Look up the tree for a nearby linting and use that if we find one
const nearestListing = findNearestParentListing(
offsetAbsoluteUrl(window.location.pathname),
listingHrefs
);
if (nearestListing) {
activateCategories(nearestListing);
} else {
// See if the referrer is a listing page for this item
const referredRelativePath = offsetAbsoluteUrl(document.referrer);
const referrerListing = listingHrefs.find((listingHref) => {
const isListingReferrer =
listingHref === referredRelativePath ||
listingHref === referredRelativePath + "index.html";
return isListingReferrer;
});
if (referrerListing) {
// Try to use the referrer if possible
activateCategories(referrerListing);
} else if (listingHrefs.length > 0) {
// Otherwise, just fall back to the first listing
activateCategories(listingHrefs[0]);
}
}
});
}
}
if (hasTitleCategories()) {
findAndActivateCategories();
}
const findNearestParentListing = (href, listingHrefs) => {
if (!href || !listingHrefs) {
return undefined;
}
// Look up the tree for a nearby linting and use that if we find one
const relativeParts = href.substring(1).split("/");
while (relativeParts.length > 0) {
const path = relativeParts.join("/");
for (const listingHref of listingHrefs) {
if (listingHref.startsWith(path)) {
return listingHref;
}
}
relativeParts.pop();
}
return undefined;
};
const manageSidebarVisiblity = (el, placeholderDescriptor) => {
let isVisible = true;
let elRect;
return (hiddenRegions) => {
if (el === null) {
return;
}
// Find the last element of the TOC
const lastChildEl = el.lastElementChild;
if (lastChildEl) {
// Converts the sidebar to a menu
const convertToMenu = () => {
for (const child of el.children) {
child.style.opacity = 0;
child.style.overflow = "hidden";
child.style.pointerEvents = "none";
}
nexttick(() => {
const toggleContainer = window.document.createElement("div");
toggleContainer.style.width = "100%";
toggleContainer.classList.add("zindex-over-content");
toggleContainer.classList.add("quarto-sidebar-toggle");
toggleContainer.classList.add("headroom-target"); // Marks this to be managed by headeroom
toggleContainer.id = placeholderDescriptor.id;
toggleContainer.style.position = "fixed";
const toggleIcon = window.document.createElement("i");
toggleIcon.classList.add("quarto-sidebar-toggle-icon");
toggleIcon.classList.add("bi");
toggleIcon.classList.add("bi-caret-down-fill");
const toggleTitle = window.document.createElement("div");
const titleEl = window.document.body.querySelector(
placeholderDescriptor.titleSelector
);
if (titleEl) {
toggleTitle.append(
titleEl.textContent || titleEl.innerText,
toggleIcon
);
}
toggleTitle.classList.add("zindex-over-content");
toggleTitle.classList.add("quarto-sidebar-toggle-title");
toggleContainer.append(toggleTitle);
const toggleContents = window.document.createElement("div");
toggleContents.classList = el.classList;
toggleContents.classList.add("zindex-over-content");
toggleContents.classList.add("quarto-sidebar-toggle-contents");
for (const child of el.children) {
if (child.id === "toc-title") {
continue;
}
const clone = child.cloneNode(true);
clone.style.opacity = 1;
clone.style.pointerEvents = null;
clone.style.display = null;
toggleContents.append(clone);
}
toggleContents.style.height = "0px";
const positionToggle = () => {
// position the element (top left of parent, same width as parent)
if (!elRect) {
elRect = el.getBoundingClientRect();
}
toggleContainer.style.left = `${elRect.left}px`;
toggleContainer.style.top = `${elRect.top}px`;
toggleContainer.style.width = `${elRect.width}px`;
};
positionToggle();
toggleContainer.append(toggleContents);
el.parentElement.prepend(toggleContainer);
// Process clicks
let tocShowing = false;
// Allow the caller to control whether this is dismissed
// when it is clicked (e.g. sidebar navigation supports
// opening and closing the nav tree, so don't dismiss on click)
const clickEl = placeholderDescriptor.dismissOnClick
? toggleContainer
: toggleTitle;
const closeToggle = () => {
if (tocShowing) {
toggleContainer.classList.remove("expanded");
toggleContents.style.height = "0px";
tocShowing = false;
}
};
// Get rid of any expanded toggle if the user scrolls
window.document.addEventListener(
"scroll",
throttle(() => {
closeToggle();
}, 50)
);
// Handle positioning of the toggle
window.addEventListener(
"resize",
throttle(() => {
elRect = undefined;
positionToggle();
}, 50)
);
window.addEventListener("quarto-hrChanged", () => {
elRect = undefined;
});
// Process the click
clickEl.onclick = () => {
if (!tocShowing) {
toggleContainer.classList.add("expanded");
toggleContents.style.height = null;
tocShowing = true;
} else {
closeToggle();
}
};
});
};
// Converts a sidebar from a menu back to a sidebar
const convertToSidebar = () => {
for (const child of el.children) {
child.style.opacity = 1;
child.style.overflow = null;
child.style.pointerEvents = null;
}
const placeholderEl = window.document.getElementById(
placeholderDescriptor.id
);
if (placeholderEl) {
placeholderEl.remove();
}
el.classList.remove("rollup");
};
if (isReaderMode()) {
convertToMenu();
isVisible = false;
} else {
// Find the top and bottom o the element that is being managed
const elTop = el.offsetTop;
const elBottom =
elTop + lastChildEl.offsetTop + lastChildEl.offsetHeight;
if (!isVisible) {
// If the element is current not visible reveal if there are
// no conflicts with overlay regions
if (!inHiddenRegion(elTop, elBottom, hiddenRegions)) {
convertToSidebar();
isVisible = true;
}
} else {
// If the element is visible, hide it if it conflicts with overlay regions
// and insert a placeholder toggle (or if we're in reader mode)
if (inHiddenRegion(elTop, elBottom, hiddenRegions)) {
convertToMenu();
isVisible = false;
}
}
}
}
};
};
const tabEls = document.querySelectorAll('a[data-bs-toggle="tab"]');
for (const tabEl of tabEls) {
const id = tabEl.getAttribute("data-bs-target");
if (id) {
const columnEl = document.querySelector(
`${id} .column-margin, .tabset-margin-content`
);
if (columnEl)
tabEl.addEventListener("shown.bs.tab", function (event) {
const el = event.srcElement;
if (el) {
const visibleCls = `${el.id}-margin-content`;
// walk up until we find a parent tabset
let panelTabsetEl = el.parentElement;
while (panelTabsetEl) {
if (panelTabsetEl.classList.contains("panel-tabset")) {
break;
}
panelTabsetEl = panelTabsetEl.parentElement;
}
if (panelTabsetEl) {
const prevSib = panelTabsetEl.previousElementSibling;
if (
prevSib &&
prevSib.classList.contains("tabset-margin-container")
) {
const childNodes = prevSib.querySelectorAll(
".tabset-margin-content"
);
for (const childEl of childNodes) {
if (childEl.classList.contains(visibleCls)) {
childEl.classList.remove("collapse");
} else {
childEl.classList.add("collapse");
}
}
}
}
}
layoutMarginEls();
});
}
}
// Manage the visibility of the toc and the sidebar
const marginScrollVisibility = manageSidebarVisiblity(marginSidebarEl, {
id: "quarto-toc-toggle",
titleSelector: "#toc-title",
dismissOnClick: true,
});
const sidebarScrollVisiblity = manageSidebarVisiblity(sidebarEl, {
id: "quarto-sidebarnav-toggle",
titleSelector: ".title",
dismissOnClick: false,
});
let tocLeftScrollVisibility;
if (leftTocEl) {
tocLeftScrollVisibility = manageSidebarVisiblity(leftTocEl, {
id: "quarto-lefttoc-toggle",
titleSelector: "#toc-title",
dismissOnClick: true,
});
}
// Find the first element that uses formatting in special columns
const conflictingEls = window.document.body.querySelectorAll(
'[class^="column-"], [class*=" column-"], aside, [class*="margin-caption"], [class*=" margin-caption"], [class*="margin-ref"], [class*=" margin-ref"]'
);
// Filter all the possibly conflicting elements into ones
// the do conflict on the left or ride side
const arrConflictingEls = Array.from(conflictingEls);
const leftSideConflictEls = arrConflictingEls.filter((el) => {
if (el.tagName === "ASIDE") {
return false;
}
return Array.from(el.classList).find((className) => {
return (
className !== "column-body" &&
className.startsWith("column-") &&
!className.endsWith("right") &&
!className.endsWith("container") &&
className !== "column-margin"
);
});
});
const rightSideConflictEls = arrConflictingEls.filter((el) => {
if (el.tagName === "ASIDE") {
return true;
}
const hasMarginCaption = Array.from(el.classList).find((className) => {
return className == "margin-caption";
});
if (hasMarginCaption) {
return true;
}
return Array.from(el.classList).find((className) => {
return (
className !== "column-body" &&
!className.endsWith("container") &&
className.startsWith("column-") &&
!className.endsWith("left")
);
});
});
const kOverlapPaddingSize = 10;
function toRegions(els) {
return els.map((el) => {
const boundRect = el.getBoundingClientRect();
const top =
boundRect.top +
document.documentElement.scrollTop -
kOverlapPaddingSize;
return {
top,
bottom: top + el.scrollHeight + 2 * kOverlapPaddingSize,
};
});
}
let hasObserved = false;
const visibleItemObserver = (els) => {
let visibleElements = [...els];
const intersectionObserver = new IntersectionObserver(
(entries, _observer) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
if (visibleElements.indexOf(entry.target) === -1) {
visibleElements.push(entry.target);
}
} else {
visibleElements = visibleElements.filter((visibleEntry) => {
return visibleEntry !== entry;
});
}
});
if (!hasObserved) {
hideOverlappedSidebars();
}
hasObserved = true;
},
{}
);
els.forEach((el) => {
intersectionObserver.observe(el);
});
return {
getVisibleEntries: () => {
return visibleElements;
},
};
};
const rightElementObserver = visibleItemObserver(rightSideConflictEls);
const leftElementObserver = visibleItemObserver(leftSideConflictEls);
const hideOverlappedSidebars = () => {
marginScrollVisibility(toRegions(rightElementObserver.getVisibleEntries()));
sidebarScrollVisiblity(toRegions(leftElementObserver.getVisibleEntries()));
if (tocLeftScrollVisibility) {
tocLeftScrollVisibility(
toRegions(leftElementObserver.getVisibleEntries())
);
}
};
window.quartoToggleReader = () => {
// Applies a slow class (or removes it)
// to update the transition speed
const slowTransition = (slow) => {
const manageTransition = (id, slow) => {
const el = document.getElementById(id);
if (el) {
if (slow) {
el.classList.add("slow");
} else {
el.classList.remove("slow");
}
}
};
manageTransition("TOC", slow);
manageTransition("quarto-sidebar", slow);
};
const readerMode = !isReaderMode();
setReaderModeValue(readerMode);
// If we're entering reader mode, slow the transition
if (readerMode) {
slowTransition(readerMode);
}
highlightReaderToggle(readerMode);
hideOverlappedSidebars();
// If we're exiting reader mode, restore the non-slow transition
if (!readerMode) {
slowTransition(!readerMode);
}
};
const highlightReaderToggle = (readerMode) => {
const els = document.querySelectorAll(".quarto-reader-toggle");
if (els) {
els.forEach((el) => {
if (readerMode) {
el.classList.add("reader");
} else {
el.classList.remove("reader");
}
});
}
};
const setReaderModeValue = (val) => {
if (window.location.protocol !== "file:") {
window.localStorage.setItem("quarto-reader-mode", val);
} else {
localReaderMode = val;
}
};
const isReaderMode = () => {
if (window.location.protocol !== "file:") {
return window.localStorage.getItem("quarto-reader-mode") === "true";
} else {
return localReaderMode;
}
};
let localReaderMode = null;
const tocOpenDepthStr = tocEl?.getAttribute("data-toc-expanded");
const tocOpenDepth = tocOpenDepthStr ? Number(tocOpenDepthStr) : 1;
// Walk the TOC and collapse/expand nodes
// Nodes are expanded if:
// - they are top level
// - they have children that are 'active' links
// - they are directly below an link that is 'active'
const walk = (el, depth) => {
// Tick depth when we enter a UL
if (el.tagName === "UL") {
depth = depth + 1;
}
// It this is active link
let isActiveNode = false;
if (el.tagName === "A" && el.classList.contains("active")) {
isActiveNode = true;
}
// See if there is an active child to this element
let hasActiveChild = false;
for (const child of el.children) {
hasActiveChild = walk(child, depth) || hasActiveChild;
}
// Process the collapse state if this is an UL
if (el.tagName === "UL") {
if (tocOpenDepth === -1 && depth > 1) {
// toc-expand: false
el.classList.add("collapse");
} else if (
depth <= tocOpenDepth ||
hasActiveChild ||
prevSiblingIsActiveLink(el)
) {
el.classList.remove("collapse");
} else {
el.classList.add("collapse");
}
// untick depth when we leave a UL
depth = depth - 1;
}
return hasActiveChild || isActiveNode;
};
// walk the TOC and expand / collapse any items that should be shown
if (tocEl) {
updateActiveLink();
walk(tocEl, 0);
}
// Throttle the scroll event and walk peridiocally
window.document.addEventListener(
"scroll",
throttle(() => {
if (tocEl) {
updateActiveLink();
walk(tocEl, 0);
}
if (!isReaderMode()) {
hideOverlappedSidebars();
}
}, 5)
);
window.addEventListener(
"resize",
throttle(() => {
if (tocEl) {
updateActiveLink();
walk(tocEl, 0);
}
if (!isReaderMode()) {
hideOverlappedSidebars();
}
}, 10)
);
hideOverlappedSidebars();
highlightReaderToggle(isReaderMode());
});
tabsets.init();
function throttle(func, wait) {
let waiting = false;
return function () {
if (!waiting) {
func.apply(this, arguments);
waiting = true;
setTimeout(function () {
waiting = false;
}, wait);
}
};
}
function nexttick(func) {
return setTimeout(func, 0);
}
@@ -0,0 +1,95 @@
// grouped tabsets
export function init() {
window.addEventListener("pageshow", (_event) => {
function getTabSettings() {
const data = localStorage.getItem("quarto-persistent-tabsets-data");
if (!data) {
localStorage.setItem("quarto-persistent-tabsets-data", "{}");
return {};
}
if (data) {
return JSON.parse(data);
}
}
function setTabSettings(data) {
localStorage.setItem(
"quarto-persistent-tabsets-data",
JSON.stringify(data)
);
}
function setTabState(groupName, groupValue) {
const data = getTabSettings();
data[groupName] = groupValue;
setTabSettings(data);
}
function toggleTab(tab, active) {
const tabPanelId = tab.getAttribute("aria-controls");
const tabPanel = document.getElementById(tabPanelId);
if (active) {
tab.classList.add("active");
tabPanel.classList.add("active");
} else {
tab.classList.remove("active");
tabPanel.classList.remove("active");
}
}
function toggleAll(selectedGroup, selectorsToSync) {
for (const [thisGroup, tabs] of Object.entries(selectorsToSync)) {
const active = selectedGroup === thisGroup;
for (const tab of tabs) {
toggleTab(tab, active);
}
}
}
function findSelectorsToSyncByLanguage() {
const result = {};
const tabs = Array.from(
document.querySelectorAll(`div[data-group] a[id^='tabset-']`)
);
for (const item of tabs) {
const div = item.parentElement.parentElement.parentElement;
const group = div.getAttribute("data-group");
if (!result[group]) {
result[group] = {};
}
const selectorsToSync = result[group];
const value = item.innerHTML;
if (!selectorsToSync[value]) {
selectorsToSync[value] = [];
}
selectorsToSync[value].push(item);
}
return result;
}
function setupSelectorSync() {
const selectorsToSync = findSelectorsToSyncByLanguage();
Object.entries(selectorsToSync).forEach(([group, tabSetsByValue]) => {
Object.entries(tabSetsByValue).forEach(([value, items]) => {
items.forEach((item) => {
item.addEventListener("click", (_event) => {
setTabState(group, value);
toggleAll(value, selectorsToSync[group]);
});
});
});
});
return selectorsToSync;
}
const selectorsToSync = setupSelectorSync();
for (const [group, selectedName] of Object.entries(getTabSettings())) {
const selectors = selectorsToSync[group];
// it's possible that stale state gives us empty selections, so we explicitly check here.
if (selectors) {
toggleAll(selectedName, selectors);
}
}
});
}
+1
View File
@@ -0,0 +1 @@
.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}
+2
View File
@@ -0,0 +1,2 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],t):(e=e||self).tippy=t(e.Popper)}(this,(function(e){"use strict";var t={passive:!0,capture:!0},n=function(){return document.body};function r(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function o(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function i(e,t){return"function"==typeof e?e.apply(void 0,t):e}function a(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function s(e,t){var n=Object.assign({},e);return t.forEach((function(e){delete n[e]})),n}function u(e){return[].concat(e)}function c(e,t){-1===e.indexOf(t)&&e.push(t)}function p(e){return e.split("-")[0]}function f(e){return[].slice.call(e)}function l(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function d(){return document.createElement("div")}function v(e){return["Element","Fragment"].some((function(t){return o(e,t)}))}function m(e){return o(e,"MouseEvent")}function g(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function h(e){return v(e)?[e]:function(e){return o(e,"NodeList")}(e)?f(e):Array.isArray(e)?e:f(document.querySelectorAll(e))}function b(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function y(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function w(e){var t,n=u(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function E(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function O(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var x={isTouch:!1},C=0;function T(){x.isTouch||(x.isTouch=!0,window.performance&&document.addEventListener("mousemove",A))}function A(){var e=performance.now();e-C<20&&(x.isTouch=!1,document.removeEventListener("mousemove",A)),C=e}function L(){var e=document.activeElement;if(g(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var D=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,R=Object.assign({appendTo:n,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),k=Object.keys(R);function P(e){var t=(e.plugins||[]).reduce((function(t,n){var r,o=n.name,i=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(r=R[o])?r:i);return t}),{});return Object.assign({},e,t)}function j(e,t){var n=Object.assign({},t,{content:i(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(P(Object.assign({},R,{plugins:t}))):k).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},R.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function M(e,t){e.innerHTML=t}function V(e){var t=d();return!0===e?t.className="tippy-arrow":(t.className="tippy-svg-arrow",v(e)?t.appendChild(e):M(t,e)),t}function I(e,t){v(t.content)?(M(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?M(e,t.content):e.textContent=t.content)}function S(e){var t=e.firstElementChild,n=f(t.children);return{box:t,content:n.find((function(e){return e.classList.contains("tippy-content")})),arrow:n.find((function(e){return e.classList.contains("tippy-arrow")||e.classList.contains("tippy-svg-arrow")})),backdrop:n.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function N(e){var t=d(),n=d();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=d();function o(n,r){var o=S(t),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==tyLine truncated
+1
View File
@@ -0,0 +1 @@
!function(t,e){"function"==typeof define&&define.amd?define([],e()):"object"==typeof module&&module.exports?module.exports=e():function n(){document&&document.body?t.zenscroll=e():setTimeout(n,9)}()}(this,function(){"use strict";var t=function(t){return t&&"getComputedStyle"in window&&"smooth"===window.getComputedStyle(t)["scroll-behavior"]};if("undefined"==typeof window||!("document"in window))return{};var e=function(e,n,o){n=n||999,o||0===o||(o=9);var i,r=function(t){i=t},u=function(){clearTimeout(i),r(0)},c=function(t){return Math.max(0,e.getTopOf(t)-o)},a=function(o,i,c){if(u(),0===i||i&&i<0||t(e.body))e.toY(o),c&&c();else{var a=e.getY(),f=Math.max(0,o)-a,s=(new Date).getTime();i=i||Math.min(Math.abs(f),n),function t(){r(setTimeout(function(){var n=Math.min(1,((new Date).getTime()-s)/i),o=Math.max(0,Math.floor(a+f*(n<.5?2*n*n:n*(4-2*n)-1)));e.toY(o),n<1&&e.getHeight()+o<e.body.scrollHeight?t():(setTimeout(u,99),c&&c())},9))}()}},f=function(t,e,n){a(c(t),e,n)},s=function(t,n,i){var r=t.getBoundingClientRect().height,u=e.getTopOf(t)+r,s=e.getHeight(),l=e.getY(),d=l+s;c(t)<l||r+o>s?f(t,n,i):u+o>d?a(u-s+o,n,i):i&&i()},l=function(t,n,o,i){a(Math.max(0,e.getTopOf(t)-e.getHeight()/2+(o||t.getBoundingClientRect().height/2)),n,i)};return{setup:function(t,e){return(0===t||t)&&(n=t),(0===e||e)&&(o=e),{defaultDuration:n,edgeOffset:o}},to:f,toY:a,intoView:s,center:l,stop:u,moving:function(){return!!i},getY:e.getY,getTopOf:e.getTopOf}},n=document.documentElement,o=function(){return window.scrollY||n.scrollTop},i=e({body:document.scrollingElement||document.body,toY:function(t){window.scrollTo(0,t)},getY:o,getHeight:function(){return window.innerHeight||n.clientHeight},getTopOf:function(t){return t.getBoundingClientRect().top+o()-n.offsetTop}});if(i.createScroller=function(t,o,i){return e({body:t,toY:function(e){t.scrollTop=e},getY:function(){return t.scrollTop},getHeight:function(){return Math.min(t.clientHeight,window.innerHeight||n.clientHeight)},getTopOf:function(t){return t.offsetTop}},o,i)},"addEventListener"in window&&!window.noZensmooth&&!t(document.body)){var r="history"in window&&"pushState"in history,u=r&&"scrollRestoration"in history;u&&(history.scrollRestoration="auto"),window.addEventListener("load",function(){u&&(setTimeout(function(){history.scrollRestoration="manual"},9),window.addEventListener("popstate",function(t){t.state&&"zenscrollY"in t.state&&i.toY(t.state.zenscrollY)},!1)),window.location.hash&&setTimeout(function(){var t=i.setup().edgeOffset;if(t){var e=document.getElementById(window.location.href.split("#")[1]);if(e){var n=Math.max(0,i.getTopOf(e)-t),o=i.getY()-n;0<=o&&o<9&&window.scrollTo(0,n)}}},9)},!1);var c=new RegExp("(^|\\s)noZensmooth(\\s|$)");window.addEventListener("click",function(t){for(var e=t.target;e&&"A"!==e.tagName;)e=e.parentNode;if(!(!e||1!==t.which||t.shiftKey||t.metaKey||t.ctrlKey||t.altKey)){if(u){var n=history.state&&"object"==typeof history.state?history.state:{};n.zenscrollY=i.getY();try{history.replaceState(n,"")}catch(t){}}var o=e.getAttribute("href")||"";if(0===o.indexOf("#")&&!c.test(e.className)){var a=0,f=document.getElementById(o.substring(1));if("#"!==o){if(!f)return;a=i.getTopOf(f)}t.preventDefault();var s=function(){window.location=o},l=i.setup().edgeOffset;l&&(a=Math.max(0,a-l),r&&(s=function(){history.pushState({},"",o)})),i.toY(a,null,s)}}},!1)}return i});
+7
View File
@@ -0,0 +1,7 @@
/*!
* headroom.js v0.12.0 - Give your page some headroom. Hide your header until you need it
* Copyright (c) 2020 Nick Williams - http://wicky.nillia.ms/headroom.js
* License: MIT
*/
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).Headroom=n()}(this,function(){"use strict";function t(){return"undefined"!=typeof window}function d(t){return function(t){return t&&t.document&&function(t){return 9===t.nodeType}(t.document)}(t)?function(t){var n=t.document,o=n.body,s=n.documentElement;return{scrollHeight:function(){return Math.max(o.scrollHeight,s.scrollHeight,o.offsetHeight,s.offsetHeight,o.clientHeight,s.clientHeight)},height:function(){return t.innerHeight||s.clientHeight||o.clientHeight},scrollY:function(){return void 0!==t.pageYOffset?t.pageYOffset:(s||o.parentNode||o).scrollTop}}}(t):function(t){return{scrollHeight:function(){return Math.max(t.scrollHeight,t.offsetHeight,t.clientHeight)},height:function(){return Math.max(t.offsetHeight,t.clientHeight)},scrollY:function(){return t.scrollTop}}}(t)}function n(t,s,e){var n,o=function(){var n=!1;try{var t={get passive(){n=!0}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){n=!1}return n}(),i=!1,r=d(t),l=r.scrollY(),a={};function c(){var t=Math.round(r.scrollY()),n=r.height(),o=r.scrollHeight();a.scrollY=t,a.lastScrollY=l,a.direction=l<t?"down":"up",a.distance=Math.abs(t-l),a.isOutOfBounds=t<0||o<t+n,a.top=t<=s.offset[a.direction],a.bottom=o<=t+n,a.toleranceExceeded=a.distance>s.tolerance[a.direction],e(a),l=t,i=!1}function h(){i||(i=!0,n=requestAnimationFrame(c))}var u=!!o&&{passive:!0,capture:!1};return t.addEventListener("scroll",h,u),c(),{destroy:function(){cancelAnimationFrame(n),t.removeEventListener("scroll",h,u)}}}function o(t){return t===Object(t)?t:{down:t,up:t}}function s(t,n){n=n||{},Object.assign(this,s.options,n),this.classes=Object.assign({},s.options.classes,n.classes),this.elem=t,this.tolerance=o(this.tolerance),this.offset=o(this.offset),this.initialised=!1,this.frozen=!1}return s.prototype={constructor:s,init:function(){return s.cutsTheMustard&&!this.initialised&&(this.addClass("initial"),this.initialised=!0,setTimeout(function(t){t.scrollTracker=n(t.scroller,{offset:t.offset,tolerance:t.tolerance},t.update.bind(t))},100,this)),this},destroy:function(){this.initialised=!1,Object.keys(this.classes).forEach(this.removeClass,this),this.scrollTracker.destroy()},unpin:function(){!this.hasClass("pinned")&&this.hasClass("unpinned")||(this.addClass("unpinned"),this.removeClass("pinned"),this.onUnpin&&this.onUnpin.call(this))},pin:function(){this.hasClass("unpinned")&&(this.addClass("pinned"),this.removeClass("unpinned"),this.onPin&&this.onPin.call(this))},freeze:function(){this.frozen=!0,this.addClass("frozen")},unfreeze:function(){this.frozen=!1,this.removeClass("frozen")},top:function(){this.hasClass("top")||(this.addClass("top"),this.removeClass("notTop"),this.onTop&&this.onTop.call(this))},notTop:function(){this.hasClass("notTop")||(this.addClass("notTop"),this.removeClass("top"),this.onNotTop&&this.onNotTop.call(this))},bottom:function(){this.hasClass("bottom")||(this.addClass("bottom"),this.removeClass("notBottom"),this.onBottom&&this.onBottom.call(this))},notBottom:function(){this.hasClass("notBottom")||(this.addClass("notBottom"),this.removeClass("bottom"),this.onNotBottom&&this.onNotBottom.call(this))},shouldUnpin:function(t){return"down"===t.direction&&!t.top&&t.toleranceExceeded},shouldPin:function(t){return"up"===t.direction&&t.toleranceExceeded||t.top},addClass:function(t){this.elem.classList.add.apply(this.elem.classList,this.classes[t].split(" "))},removeClass:function(t){this.elem.classList.remove.apply(this.elem.classList,this.classes[t].split(" "))},hasClass:function(t){return this.classes[t].split(" ").every(function(t){return this.classList.contains(t)},this.elem)},update:function(t){t.isOutOfBounds||!0!==this.frozen&&(t.top?this.top():this.notTop(),t.bottom?this.bottom():this.notBottom(),this.shouldUnpin(t)?this.unpin():this.shouldPin(t)&&this.pin())}},s.options={tolerance:{up:0,down:0},offset:0,scroller:t()?window:null,classes:{frozen:"headroom--frozen",pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},s.cutsTheMustard=!!(t()&&function(){}.bind&&"classList"in document.documentElement&&Object.assign&&Object.keys&&requestAnimationFrame),s});
+328
View File
@@ -0,0 +1,328 @@
const headroomChanged = new CustomEvent("quarto-hrChanged", {
detail: {},
bubbles: true,
cancelable: false,
composed: false,
});
const announceDismiss = () => {
const annEl = window.document.getElementById("quarto-announcement");
if (annEl) {
annEl.remove();
const annId = annEl.getAttribute("data-announcement-id");
window.localStorage.setItem(`quarto-announce-${annId}`, "true");
}
};
const announceRegister = () => {
const annEl = window.document.getElementById("quarto-announcement");
if (annEl) {
const annId = annEl.getAttribute("data-announcement-id");
const isDismissed =
window.localStorage.getItem(`quarto-announce-${annId}`) || false;
if (isDismissed) {
announceDismiss();
return;
} else {
annEl.classList.remove("hidden");
}
const actionEl = annEl.querySelector(".quarto-announcement-action");
if (actionEl) {
actionEl.addEventListener("click", function (e) {
e.preventDefault();
// Hide the bar immediately
announceDismiss();
});
}
}
};
window.document.addEventListener("DOMContentLoaded", function () {
let init = false;
announceRegister();
// Manage the back to top button, if one is present.
let lastScrollTop = window.pageYOffset || document.documentElement.scrollTop;
const scrollDownBuffer = 5;
const scrollUpBuffer = 35;
const btn = document.getElementById("quarto-back-to-top");
const hideBackToTop = () => {
btn.style.display = "none";
};
const showBackToTop = () => {
btn.style.display = "inline-block";
};
if (btn) {
window.document.addEventListener(
"scroll",
function () {
const currentScrollTop =
window.pageYOffset || document.documentElement.scrollTop;
// Shows and hides the button 'intelligently' as the user scrolls
if (currentScrollTop - scrollDownBuffer > lastScrollTop) {
hideBackToTop();
lastScrollTop = currentScrollTop <= 0 ? 0 : currentScrollTop;
} else if (currentScrollTop < lastScrollTop - scrollUpBuffer) {
showBackToTop();
lastScrollTop = currentScrollTop <= 0 ? 0 : currentScrollTop;
}
// Show the button at the bottom, hides it at the top
if (currentScrollTop <= 0) {
hideBackToTop();
} else if (
window.innerHeight + currentScrollTop >=
document.body.offsetHeight
) {
showBackToTop();
}
},
false
);
}
function throttle(func, wait) {
var timeout;
return function () {
const context = this;
const args = arguments;
const later = function () {
clearTimeout(timeout);
timeout = null;
func.apply(context, args);
};
if (!timeout) {
timeout = setTimeout(later, wait);
}
};
}
function headerOffset() {
// Set an offset if there is are fixed top navbar
const headerEl = window.document.querySelector("header.fixed-top");
if (headerEl) {
return headerEl.clientHeight;
} else {
return 0;
}
}
function footerOffset() {
const footerEl = window.document.querySelector("footer.footer");
if (footerEl) {
return footerEl.clientHeight;
} else {
return 0;
}
}
function dashboardOffset() {
const dashboardNavEl = window.document.getElementById(
"quarto-dashboard-header"
);
if (dashboardNavEl !== null) {
return dashboardNavEl.clientHeight;
} else {
return 0;
}
}
function updateDocumentOffsetWithoutAnimation() {
updateDocumentOffset(false);
}
function updateDocumentOffset(animated) {
// set body offset
const topOffset = headerOffset();
const bodyOffset = topOffset + footerOffset() + dashboardOffset();
const bodyEl = window.document.body;
bodyEl.setAttribute("data-bs-offset", topOffset);
bodyEl.style.paddingTop = topOffset + "px";
// deal with sidebar offsets
const sidebars = window.document.querySelectorAll(
".sidebar, .headroom-target"
);
sidebars.forEach((sidebar) => {
if (!animated) {
sidebar.classList.add("notransition");
// Remove the no transition class after the animation has time to complete
setTimeout(function () {
sidebar.classList.remove("notransition");
}, 201);
}
if (window.Headroom && sidebar.classList.contains("sidebar-unpinned")) {
sidebar.style.top = "0";
sidebar.style.maxHeight = "100vh";
} else {
sidebar.style.top = topOffset + "px";
sidebar.style.maxHeight = "calc(100vh - " + topOffset + "px)";
}
});
// allow space for footer
const mainContainer = window.document.querySelector(".quarto-container");
if (mainContainer) {
mainContainer.style.minHeight = "calc(100vh - " + bodyOffset + "px)";
}
// link offset
let linkStyle = window.document.querySelector("#quarto-target-style");
if (!linkStyle) {
linkStyle = window.document.createElement("style");
linkStyle.setAttribute("id", "quarto-target-style");
window.document.head.appendChild(linkStyle);
}
while (linkStyle.firstChild) {
linkStyle.removeChild(linkStyle.firstChild);
}
if (topOffset > 0) {
linkStyle.appendChild(
window.document.createTextNode(`
section:target::before {
content: "";
display: block;
height: ${topOffset}px;
margin: -${topOffset}px 0 0;
}`)
);
}
if (init) {
window.dispatchEvent(headroomChanged);
}
init = true;
}
// initialize headroom
var header = window.document.querySelector("#quarto-header");
if (header && window.Headroom) {
const headroom = new window.Headroom(header, {
tolerance: 5,
onPin: function () {
const sidebars = window.document.querySelectorAll(
".sidebar, .headroom-target"
);
sidebars.forEach((sidebar) => {
sidebar.classList.remove("sidebar-unpinned");
});
updateDocumentOffset();
},
onUnpin: function () {
const sidebars = window.document.querySelectorAll(
".sidebar, .headroom-target"
);
sidebars.forEach((sidebar) => {
sidebar.classList.add("sidebar-unpinned");
});
updateDocumentOffset();
},
});
headroom.init();
let frozen = false;
window.quartoToggleHeadroom = function () {
if (frozen) {
headroom.unfreeze();
frozen = false;
} else {
headroom.freeze();
frozen = true;
}
};
}
window.addEventListener(
"hashchange",
function (e) {
if (
getComputedStyle(document.documentElement).scrollBehavior !== "smooth"
) {
window.scrollTo(0, window.pageYOffset - headerOffset());
}
},
false
);
// Observe size changed for the header
const headerEl = window.document.querySelector("header.fixed-top");
if (headerEl && window.ResizeObserver) {
const observer = new window.ResizeObserver(() => {
setTimeout(updateDocumentOffsetWithoutAnimation, 0);
});
observer.observe(headerEl, {
attributes: true,
childList: true,
characterData: true,
});
} else {
window.addEventListener(
"resize",
throttle(updateDocumentOffsetWithoutAnimation, 50)
);
}
setTimeout(updateDocumentOffsetWithoutAnimation, 250);
// fixup index.html links if we aren't on the filesystem
if (window.location.protocol !== "file:") {
const links = window.document.querySelectorAll("a");
for (let i = 0; i < links.length; i++) {
if (links[i].href) {
links[i].dataset.originalHref = links[i].href;
// only strip index.html at the end of the path (optionally followed
// by a query or fragment) so that files like index.html.md
// (alternate-format twins) are left alone (#14667)
links[i].href = links[i].href.replace(/\/index\.html(?=[?#]|$)/, "/");
}
}
// Fixup any sharing links that require urls
// Append url to any sharing urls
const sharingLinks = window.document.querySelectorAll(
"a.sidebar-tools-main-item, a.quarto-navigation-tool, a.quarto-navbar-tools, a.quarto-navbar-tools-item"
);
for (let i = 0; i < sharingLinks.length; i++) {
const sharingLink = sharingLinks[i];
const href = sharingLink.getAttribute("href");
if (href) {
sharingLink.setAttribute(
"href",
href.replace("|url|", window.location.href)
);
}
}
// Scroll the active navigation item into view, if necessary
const navSidebar = window.document.querySelector("nav#quarto-sidebar");
if (navSidebar) {
// Find the active item
const activeItem = navSidebar.querySelector("li.sidebar-item a.active");
if (activeItem) {
// Wait for the scroll height and height to resolve by observing size changes on the
// nav element that is scrollable
const resizeObserver = new ResizeObserver((_entries) => {
// The bottom of the element
const elBottom = activeItem.offsetTop;
const viewBottom = navSidebar.scrollTop + navSidebar.clientHeight;
// The element height and scroll height are the same, then we are still loading
if (viewBottom !== navSidebar.scrollHeight) {
// Determine if the item isn't visible and scroll to it
if (elBottom >= viewBottom) {
navSidebar.scrollTop = elBottom;
}
// stop observing now since we've completed the scroll
resizeObserver.unobserve(navSidebar);
}
});
resizeObserver.observe(navSidebar);
}
}
}
});
@@ -0,0 +1,3 @@
/*! @algolia/autocomplete-js 1.19.1 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/autocomplete-js"]={})}(this,(function(e){"use strict";function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}function u(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,u,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(c)throw o}}return a}}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e){return{current:e}}function p(e,t){var n=void 0;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];n&&clearTimeout(n),n=setTimeout((function(){return e.apply(void 0,o)}),t)}}function m(e){return e.reduce((function(e,t){return e.concat(t)}),[])}var v=0;function d(){return"autocomplete-".concat(v++)}function y(e,t){return t.reduce((function(e,t){return e&&e[t]}),e)}function b(e){return 0===e.collections.length?0:e.collections.reduce((function(e,t){return e+t.items.length}),0)}function g(e){return e!==Object(e)}function h(e,t){if(e===t)return!0;if(g(e)||g(t)||"function"==typeof e||"function"==typeof t)return e===t;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];if(!(o in t))return!1;if(!h(e[o],t[o]))return!1}return!0}var _=function(){};var O="1.19.1",S=[{segment:"autocomplete-core",version:O}];function j(e){var t=e.item,n=e.items,r=void 0===n?[]:n;return{index:t.__autocomplete_indexName,items:[t],positions:[1+r.findIndex((function(e){return e.objectID===t.objectID}))],queryID:t.__autocomplete_queryID,algoliaSource:["autocomplete"]}}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,u,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.pLine truncated
+9
View File
@@ -0,0 +1,9 @@
/**
* Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io)
*
* Copyright (c) 2022 Kiro Risk (http://kiro.me)
* All Rights Reserved. Apache Software License 2.0
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
var e,t;e=this,t=function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){c(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(e,"prototype",{value:Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),writable:!1}),t&&u(e,t)}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function h(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return h(this,n)}}function f(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e){return Array.isArray?Array.isArray(e):"[object Array]"===b(e)}function g(e){return"string"==typeof e}function y(e){return"number"==typeof e}function p(e){return!0===e||!1===e||function(e){return m(e)&&null!==e}(e)&&"[object Boolean]"==b(e)}function m(e){return"object"===n(e)}function k(e){return null!=e}function M(e){return!e.trim().length}function b(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var x=function(e){return"Invalid value for key ".concat(e)},w=function(e){return"Pattern length exceeds max of ".concat(e,".")},L=Object.prototype.hasOwnProperty,S=function(){function e(t){var n=this;r(this,e),this._keys=[],this._keyMap={};var i=0;t.forEach((function(e){var t=_(e);i+=t.weight,n._keys.push(t),n._keyMap[t.id]=t,i+=t.weight})),this._keys.forEach((function(e){e.weight/=i}))}return o(e,[{key:"get",value:function(e){return this._keyMap[e]}},{key:"keys",value:function(){return this._keys}},{key:"toJSON",value:function(){return JSON.stringify(this._keys)}}]),e}();function _(e){var t=null,n=null,r=null,i=1,o=null;if(g(e)||v(e))r=e,t=O(e),n=j(e);else{if(!L.call(e,"name"))throw new Error(function(e){return"Missing ".concat(e," property in key")}("name"));var c=e.name;if(r=c,L.call(e,"weight")&&(i=e.weight)<=0)throw new Error(function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")}(c));t=O(c),n=j(c),o=e.getFn}return{path:t,id:n,weight:i,src:r,getFn:o}}function O(e){return v(e)?e:e.split(".")}function j(e){return v(e)?e.join("."):e}var A={useExtendedSearch:!1,getFn:function(e,t){var n=[],r=!1;return function e(t,i,o){if(k(t))if(i[o]){var c=t[i[o]];if(!k(c))return;if(o===i.Line truncated
File diff suppressed because it is too large. Load diff
+988
View File
@@ -0,0 +1,988 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
<meta charset="utf-8">
<meta name="generator" content="quarto-1.10.18">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>Glossary – From Calling to Eventing</title>
<style>
/* Default styles provided by pandoc.
** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
*/
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: 1.5em;}
div.column{flex: auto;}
@media screen {
div.columns{gap: min(4vw, 1.5em);}
div.column{overflow-x: auto;}
}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
width: 0.8em;
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
vertical-align: middle;
}
</style>
<script src="site_libs/quarto-nav/quarto-nav.js"></script>
<script src="site_libs/quarto-nav/headroom.min.js"></script>
<script src="site_libs/clipboard/clipboard.min.js"></script>
<script src="site_libs/quarto-search/autocomplete.umd.js"></script>
<script src="site_libs/quarto-search/fuse.min.js"></script>
<script src="site_libs/quarto-search/quarto-search.js"></script>
<meta name="quarto:offset" content="./">
<link href="./02-part-ii-processes.html" rel="prev">
<script src="site_libs/quarto-html/quarto.js" type="module"></script>
<script src="site_libs/quarto-html/tabsets/tabsets.js" type="module"></script>
<script src="site_libs/quarto-html/popper.min.js"></script>
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
<script src="site_libs/quarto-html/anchor.min.js"></script>
<link href="site_libs/quarto-html/tippy.css" rel="stylesheet">
<link href="site_libs/quarto-html/quarto-syntax-highlighting-7c68a30ea258f1cbeb56603bc0a48370.css" rel="stylesheet" id="quarto-text-highlighting-styles">
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="site_libs/bootstrap/bootstrap-cfe7114cbc4adb2af5ff3a891545d7fa.min.css" rel="stylesheet" append-hash="true" id="quarto-bootstrap" data-mode="light">
<script src="site_libs/quarto-contrib/calc-exo-2.0.0/exo.js"></script>
<link href="site_libs/quarto-contrib/calc-exo-2.0.0/exo.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.js"></script>
<link href="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-latex-tables-1.0.0/latex-tables.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.js"></script>
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.js"></script>
<link href="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.css" rel="stylesheet">
<script id="quarto-search-options" type="application/json">{
"location": "sidebar",
"copy-button": false,
"collapse-after": 3,
"panel-placement": "start",
"type": "textbox",
"limit": 50,
"keyboard-shortcut": [
"f",
"/",
"s"
],
"show-item-context": false,
"language": {
"search-no-results-text": "No results",
"search-matching-documents-text": "matching documents",
"search-copy-link-title": "Copy link to search",
"search-hide-matches-text": "Hide additional matches",
"search-more-match-text": "more match in this document",
"search-more-matches-text": "more matches in this document",
"search-clear-button-title": "Clear",
"search-text-placeholder": "",
"search-detached-cancel-button-title": "Cancel",
"search-submit-button-title": "Submit",
"search-label": "Search"
}
}</script>
<style>html{ scroll-behavior: smooth; }</style>
<!-- Language switcher for the html output only (included in the <head>).
Each profile's sidebar translate menu links to the start page of the other
languages (_book/ English, _book/fr/, _book/de/). All three books share the
same file names and section ids (#sec-...), so a click is sent to the same
page and section of the other language instead.
Quarto's page scripts rewrite those links in the browser (to an absolute
address without index.html), and can do so after this script runs. So
nothing is attached to the links themselves: one capture-phase listener on
the document reads the link's final address at click time.
If a language has not been built (./render-all.sh), its pages do not exist:
the target is checked first and a short note is shown instead of a
"Not Found" page.
The language picked in the menu is remembered for a year in a cookie
(notes-lang, limited to the book's address). A later visit to a page in
another language goes straight to the same page in the remembered one; this
runs in the <head>, before anything is drawn. Not in the local preview
(file:, localhost), where the other languages may not be built. -->
<script>
(function () {
var CODE = { 'Deutsch': 'de', 'Français': 'fr', 'English': 'en' };
var ROOT_LANG = 'en'; // the language at the top of _book/
var COOKIE = 'notes-lang';
var NOTE = {
de: 'Diese Sprache wurde noch nicht erstellt. Einmal ./render-all.sh ausführen – '
+ 'danach funktioniert der Wechsel auch in der Vorschau.',
fr: 'Cette langue n’a pas encore été générée. Lancez une fois ./render-all.sh : '
+ 'ensuite le changement fonctionne aussi dans l’aperçu.',
en: 'This language hasn’t been built yet. Run ./render-all.sh once, '
+ 'then switching works in the preview too.'
};
var here = (document.documentElement.lang || ROOT_LANG).slice(0, 2);
// the book's top folder: /…/fr/page.html -> /…/ ; /…/page.html -> /…/
var dir = location.pathname.replace(/[^\/]*$/, '');
var root = (here !== ROOT_LANG && dir.slice(-(here.length + 2)) === '/' + here + '/')
? dir.slice(0, -(here.length + 1)) : dir;
var page = location.pathname.slice(dir.length); // "" for a folder
function remembered() {
var m = document.cookie.match(/(?:^|;\s*)notes-lang=(de|fr|en)(?:;|$)/);
return m ? m[1] : null;
}
function remember(code) {
document.cookie = COOKIE + '=' + code + '; path=' + root + '; max-age=31536000; SameSite=Lax'
+ (location.protocol === 'https:' ? '; Secure' : '');
}
// a returning reader lands in the language picked last time
var live = /^https?:$/.test(location.protocol)
&& !/^(localhost|127\.0\.0\.1|\[::1\])$/.test(location.hostname);
var wanted = remembered();
if (live && wanted && wanted !== here) {
location.replace(root + (wanted === ROOT_LANG ? '' : wanted + '/') + page
+ location.search + location.hash);
return;
}
function note() {
var lang = (document.documentElement.lang || 'en').slice(0, 2);
var box = document.createElement('div');
box.setAttribute('role', 'status');
box.className = 'i18n-note';
box.textContent = NOTE[lang] || NOTE.en;
box.style.cssText = 'position:fixed;left:50%;bottom:1.25rem;transform:translateX(-50%);'
+ 'max-width:min(34rem,calc(100vw - 2rem));padding:.6rem .9rem;border-radius:6px;'
+ 'background:#1f2328;color:#fff;font-size:.85rem;line-height:1.4;z-index:2000;'
+ 'box-shadow:0 4px 16px rgba(0,0,0,.25)';
document.body.appendChild(box);
setTimeout(function () { box.remove(); }, 7000);
}
function exists(url) {
return fetch(url, { method: 'HEAD', cache: 'no-store' })
.then(function (r) { return r.status !== 404; }, function () { return true; });
}
document.addEventListener('click', function (ev) {
if (ev.button !== 0 || ev.metaKey || ev.ctrlKey || ev.shiftKey || ev.altKey) return;
var a = ev.target.closest && ev.target.closest('a.sidebar-tools-main-item');
if (!a || !a.href) return;
var code = CODE[a.textContent.trim()];
if (!code) return; // some other tool link
ev.preventDefault();
// the language being read already: just remember it
if (code === here) { remember(code); return; }
var link = new URL(a.href, location.href);
var target_root = link.pathname.replace(/index\.html$/, ''); // "/" or "/fr/"
if (target_root.slice(-1) !== '/') target_root += '/';
var target = link.origin + target_root + (page || 'index.html');
if (location.protocol === 'file:' || !window.fetch) {
remember(code);
location.href = target + location.hash;
return;
}
// same page in the other language, else its start page, else explain
exists(target).then(function (ok) {
if (ok) { remember(code); location.href = target + location.hash; return; }
return exists(link.origin + target_root).then(function (rootOk) {
if (rootOk) { remember(code); location.href = link.origin + target_root; }
else note();
});
});
}, true);
})();
</script>
<style>:root { --calc-notecolor: #B45309; }</style>
</head>
<body class="nav-sidebar docked quarto-light">
<div id="quarto-search-results"></div>
<header id="quarto-header" class="headroom fixed-top">
<nav class="quarto-secondary-nav">
<div class="container-fluid d-flex">
<button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" role="button" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
<i class="bi bi-layout-text-sidebar-reverse"></i>
</button>
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./glossary.html">Appendices</a></li><li class="breadcrumb-item"><a href="./glossary.html">Glossary</a></li></ol></nav>
<a class="flex-grow-1" role="navigation" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
</a>
<button type="button" class="btn quarto-search-button" aria-label="Search" onclick="window.quartoOpenSearch();">
<i class="bi bi-search"></i>
</button>
</div>
</nav>
</header>
<!-- content -->
<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article">
<!-- sidebar -->
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation docked overflow-auto">
<div class="pt-lg-2 mt-2 text-left sidebar-header">
<div class="sidebar-title mb-0 py-0">
<a href="./">From Calling to Eventing</a>
<div class="sidebar-tools-main tools-wide">
<div class="dropdown">
<a href="" title="" id="quarto-navigation-tool-dropdown-0" class="quarto-navigation-tool dropdown-toggle px-1" data-bs-toggle="dropdown" aria-expanded="false" role="link" aria-label=""><i class="bi bi-translate"></i></a>
<ul class="dropdown-menu" aria-labelledby="quarto-navigation-tool-dropdown-0">
<li>
<a class="dropdown-item sidebar-tools-main-item" href="./index.html">
English
</a>
</li>
<li>
<a class="dropdown-item sidebar-tools-main-item" href="./fr/index.html">
Français
</a>
</li>
<li>
<a class="dropdown-item sidebar-tools-main-item" href="./de/index.html">
Deutsch
</a>
</li>
</ul>
</div>
<a href="./From-Calling-to-Eventing.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="" class="quarto-reader-toggle quarto-navigation-tool px-1" onclick="window.quartoToggleReader(); return false;" title="Toggle reader mode">
<div class="quarto-reader-toggle-btn">
<i class="bi"></i>
</div>
</a>
</div>
</div>
</div>
<div class="mt-2 flex-shrink-0 align-items-center">
<div class="sidebar-search">
<div id="quarto-search" class="" title="Search"></div>
</div>
</div>
<div class="sidebar-menu-container">
<ul class="list-unstyled mt-1">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./index.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">About these notes</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./00-orientation.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What the tutorial is about</span></span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./01-part-i-calls.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">2</span>&nbsp; <span class="chapter-title">Part I — Start with what you already know</span></span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./02-part-ii-processes.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Part II — Cross the process boundary</span></span></a>
</div>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="true">
<span class="menu-text">Appendices</span></a>
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="true" aria-label="Toggle section">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./glossary.html" class="sidebar-item-text sidebar-link active">
<span class="menu-text">Glossary</span></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
</nav>
<div id="quarto-sidebar-glass" class="quarto-sidebar-collapse-item" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item"></div>
<!-- margin-sidebar -->
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar zindex-bottom">
</div>
<!-- main -->
<main class="content" id="quarto-document-content">
<header id="title-block-header" class="quarto-title-block default"><nav class="quarto-page-breadcrumbs quarto-title-breadcrumbs d-none d-lg-block" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./glossary.html">Appendices</a></li><li class="breadcrumb-item"><a href="./glossary.html">Glossary</a></li></ol></nav>
<div class="quarto-title">
<h1 class="title"><span id="sec-glossary" class="quarto-section-identifier">Glossary</span></h1>
</div>
<div class="quarto-title-meta">
</div>
</header>
<!-- MULTILINGUAL: see the comment at the top of the first chapter.
Every entry here is defined in the chapter where the term first does some
work; this page only collects them. The arrow on an entry leads back to
that spot, which is usually the thing worth re-reading.
The list is built by _extensions/notes/glossary.lua from the ::: {.gls-def}
divs of the chapters (via .gls-cache-<lang>.lua) and from glossary.yml, so
a chapter added today shows up here after the next render. -->
<p>Every term below is defined where it is first used, and linked from every later mention. The arrow on an entry leads back to that page.</p>
<div class="glossary">
</div>
</main> <!-- /main -->
<!-- figures/flow-player.html -- the web version's interactive diagrams.
Injected at the end of <body> by include-in-header's sibling
include-after-body in _quarto.yml, so it is a no-op on a page that holds
no img.flow-figure.
A chapter writes an ordinary Quarto figure and adds the class:
![caption](figures/mailboxes-jvm-@tr{langcode}){#fig-x .flow-figure}
That keeps the PDF and the no-JavaScript case working: the built svg is
already the whole picture. Here the image is fetched, inlined, and given
a play bar that walks a message through the mailboxes, one hop per
[data-flow] edge of the svg, highlighting the [data-flow-node] each hop
ends at. Colours are diagram.css's, so the two stay in step. -->
<style>
.flow-wrap { margin: 0; }
.flow-wrap svg { width: 100%; height: auto; display: block; }
.flow-token { fill: #8a5a08; stroke: #fbfcfd; stroke-width: 1.2; }
.flow-wrap .flow-on .box,
.flow-wrap .flow-on .box-plain,
.flow-wrap .flow-on .box-accent { stroke-width: 3; }
.flow-wrap .flow-done { stroke: #8a5a08; }
.flow-bar {
display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
max-width: 100%; margin: .45rem 0 0;
}
.flow-bar button {
font: inherit; font-size: .82rem; padding: .18rem .7rem; cursor: pointer;
border: 1px solid #dae0e8; border-radius: 999px;
background: #fbfcfd; color: #5a6879;
}
.flow-bar button:hover { border-color: #20666f; color: #20666f; }
.flow-bar button[disabled] { opacity: .45; cursor: default; }
.flow-status { font-size: .8rem; color: #5a6879; }
.flow-status b { color: #20666f; font-weight: 600; }
@media (prefers-color-scheme: dark) {
.flow-token { fill: #c99a3a; stroke: #161b22; }
.flow-bar button { background: #161b22; border-color: #30363d; color: #8b98a8; }
.flow-bar button:hover { border-color: #4c9aa5; color: #7fc4cf; }
.flow-status { color: #8b98a8; }
.flow-status b { color: #7fc4cf; }
}
</style>
<script>
(() => {
const images = document.querySelectorAll("img.flow-figure");
if (!images.length) return;
const LANG = (document.documentElement.lang || "en").slice(0, 2);
const WORDS = {
en: { play: "Play", pause: "Pause", step: "One hop", reset: "Reset",
idle: "the message has not been sent yet", done: "arrived" },
fr: { play: "Lancer", pause: "Pause", step: "Un saut", reset: "Réinitialiser",
idle: "le message n'est pas encore parti", done: "arrivé" },
de: { play: "Abspielen", pause: "Pause", step: "Ein Sprung", reset: "Zurücksetzen",
idle: "die Nachricht ist noch nicht unterwegs", done: "angekommen" },
};
const W = WORDS[LANG] || WORDS.en;
const STILL = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
const HOP = 620; // ms per hop
const label = (node) => {
const text = node && node.querySelector("text");
return text ? text.textContent.trim() : "";
};
async function upgrade(img) {
let svg;
try {
const response = await fetch(img.currentSrc || img.src);
if (!response.ok) return; // leave the plain image in place
const doc = new DOMParser().parseFromString(await response.text(), "image/svg+xml");
svg = doc.documentElement;
if (!svg || svg.nodeName !== "svg" || doc.querySelector("parsererror")) return;
} catch { return; } // file:// or offline: plain image
const edges = [...svg.querySelectorAll("[data-flow]")]
.sort((a, b) => Number(a.dataset.flow) - Number(b.dataset.flow));
if (!edges.length) return;
svg.removeAttribute("width");
svg.removeAttribute("height");
const wrap = document.createElement("div");
wrap.className = "flow-wrap";
wrap.appendChild(svg);
const bar = document.createElement("div");
bar.className = "flow-bar";
const make = (name) => {
const button = document.createElement("button");
button.type = "button";
button.textContent = W[name];
bar.appendChild(button);
return button;
};
const playButton = make("play");
const stepButton = make("step");
const resetButton = make("reset");
const status = document.createElement("span");
status.className = "flow-status";
bar.appendChild(status);
wrap.appendChild(bar);
img.hidden = true;
img.after(wrap);
const token = document.createElementNS("http://www.w3.org/2000/svg", "circle");
token.setAttribute("r", "6");
token.setAttribute("class", "flow-token");
token.style.display = "none";
svg.appendChild(token);
let at = 0; // hops already made
let playing = false;
let frame = null;
const nodeOf = (edge) =>
edge.dataset.flowTo
? svg.querySelector(`[data-flow-node="${edge.dataset.flowTo}"]`)
: null;
const say = () => {
if (at === 0) { status.textContent = W.idle; return; }
const here = label(nodeOf(edges[at - 1]));
status.innerHTML = `${at} / ${edges.length} — <b></b>`;
status.querySelector("b").textContent =
at === edges.length ? `${here} (${W.done})` : here;
};
const clear = () => {
svg.querySelectorAll(".flow-on").forEach((n) => n.classList.remove("flow-on"));
edges.forEach((e) => e.classList.remove("flow-done"));
};
const place = (edge, fraction) => {
const length = edge.getTotalLength();
const point = edge.getPointAtLength(length * fraction);
token.setAttribute("cx", point.x);
token.setAttribute("cy", point.y);
token.style.display = "";
};
function hop(then) {
const edge = edges[at];
if (!edge) { then && then(false); return; }
clear();
const arrive = () => {
edge.classList.add("flow-done");
const node = nodeOf(edge);
if (node) node.classList.add("flow-on");
at += 1;
say();
buttons();
then && then(at < edges.length);
};
if (STILL) { place(edge, 1); arrive(); return; }
const start = performance.now();
const tick = (now) => {
const done = Math.min((now - start) / HOP, 1);
place(edge, done);
if (done < 1) { frame = requestAnimationFrame(tick); } else { frame = null; arrive(); }
};
frame = requestAnimationFrame(tick);
}
function buttons() {
const end = at >= edges.length;
playButton.textContent = playing ? W.pause : W.play;
playButton.disabled = end && !playing;
stepButton.disabled = end || playing;
resetButton.disabled = at === 0 && !playing;
}
function stop() {
playing = false;
if (frame) { cancelAnimationFrame(frame); frame = null; }
buttons();
}
function run() {
if (at >= edges.length) at = 0;
playing = true;
buttons();
const next = (more) => {
if (!playing) return;
if (more) { hop(next); } else { stop(); }
};
hop(next);
}
playButton.addEventListener("click", () => (playing ? stop() : run()));
stepButton.addEventListener("click", () => { stop(); hop(); });
resetButton.addEventListener("click", () => {
stop();
at = 0;
clear();
token.style.display = "none";
say();
buttons();
});
say();
buttons();
}
images.forEach(upgrade);
})();
</script>
<script id="quarto-html-after-body" type="application/javascript">
window.document.addEventListener("DOMContentLoaded", function (event) {
const icon = "";
const anchorJS = new window.AnchorJS();
anchorJS.options = {
placement: 'right',
icon: icon
};
anchorJS.add('.anchored');
const isCodeAnnotation = (el) => {
for (const clz of el.classList) {
if (clz.startsWith('code-annotation-')) {
return true;
}
}
return false;
}
const onCopySuccess = function(e) {
// button target
const button = e.trigger;
// don't keep focus
button.blur();
// flash "checked"
button.classList.add('code-copy-button-checked');
var currentTitle = button.getAttribute("title");
button.setAttribute("title", "Copied!");
let tooltip;
if (window.bootstrap) {
button.setAttribute("data-bs-toggle", "tooltip");
button.setAttribute("data-bs-placement", "left");
button.setAttribute("data-bs-title", "Copied!");
tooltip = new bootstrap.Tooltip(button,
{ trigger: "manual",
customClass: "code-copy-button-tooltip",
offset: [0, -8]});
tooltip.show();
}
setTimeout(function() {
if (tooltip) {
tooltip.hide();
button.removeAttribute("data-bs-title");
button.removeAttribute("data-bs-toggle");
button.removeAttribute("data-bs-placement");
}
button.setAttribute("title", currentTitle);
button.classList.remove('code-copy-button-checked');
}, 1000);
// clear code selection
e.clearSelection();
}
const getTextToCopy = function(trigger) {
const outerScaffold = trigger.parentElement.cloneNode(true);
const codeEl = outerScaffold.querySelector('code');
for (const childEl of codeEl.children) {
if (isCodeAnnotation(childEl)) {
childEl.remove();
}
}
return codeEl.innerText;
}
const clipboard = new window.ClipboardJS('.code-copy-button:not([data-in-quarto-modal])', {
text: getTextToCopy
});
clipboard.on('success', onCopySuccess);
if (window.document.getElementById('quarto-embedded-source-code-modal')) {
const clipboardModal = new window.ClipboardJS('.code-copy-button[data-in-quarto-modal]', {
text: getTextToCopy,
container: window.document.getElementById('quarto-embedded-source-code-modal')
});
clipboardModal.on('success', onCopySuccess);
}
var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//);
var mailtoRegex = new RegExp(/^mailto:/);
var filterRegex = new RegExp('/' + window.location.host + '/');
var isInternal = (href) => {
return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href);
}
// Inspect non-navigation links and adorn them if external
var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)');
for (var i=0; i<links.length; i++) {
const link = links[i];
if (!isInternal(link.href)) {
// undo the damage that might have been done by quarto-nav.js in the case of
// links that we want to consider external
if (link.dataset.originalHref !== undefined) {
link.href = link.dataset.originalHref;
}
// target, if specified
link.setAttribute("target", "_blank");
if (link.getAttribute("rel") === null) {
link.setAttribute("rel", "noopener");
}
}
}
function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {
const config = {
allowHTML: true,
maxWidth: 500,
delay: 100,
arrow: false,
appendTo: function(el) {
return el.parentElement;
},
interactive: true,
interactiveBorder: 10,
theme: 'quarto',
placement: 'bottom-start',
};
if (contentFn) {
config.content = contentFn;
}
if (onTriggerFn) {
config.onTrigger = onTriggerFn;
}
if (onUntriggerFn) {
config.onUntrigger = onUntriggerFn;
}
window.tippy(el, config);
}
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
for (var i=0; i<noterefs.length; i++) {
const ref = noterefs[i];
tippyHover(ref, function() {
// use id or data attribute instead here
let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
try { href = new URL(href).hash; } catch {}
const id = href.replace(/^#\/?/, "");
const note = window.document.getElementById(id);
if (note) {
return note.innerHTML;
} else {
return "";
}
});
}
const xrefs = window.document.querySelectorAll('a.quarto-xref');
const processXRef = (id, note) => {
// Strip column container classes
const stripColumnClz = (el) => {
el.classList.remove("page-full", "page-columns");
if (el.children) {
for (const child of el.children) {
stripColumnClz(child);
}
}
}
stripColumnClz(note)
if (id === null || id.startsWith('sec-')) {
// Special case sections, only their first couple elements
const container = document.createElement("div");
if (note.children && note.children.length > 2) {
container.appendChild(note.children[0].cloneNode(true));
for (let i = 1; i < note.children.length; i++) {
const child = note.children[i];
if (child.tagName === "P" && child.innerText === "") {
continue;
} else {
container.appendChild(child.cloneNode(true));
break;
}
}
if (window.Quarto?.typesetMath) {
window.Quarto.typesetMath(container);
}
return container.innerHTML
} else {
if (window.Quarto?.typesetMath) {
window.Quarto.typesetMath(note);
}
return note.innerHTML;
}
} else {
// Remove any anchor links if they are present
const anchorLink = note.querySelector('a.anchorjs-link');
if (anchorLink) {
anchorLink.remove();
}
if (window.Quarto?.typesetMath) {
window.Quarto.typesetMath(note);
}
if (note.classList.contains("callout")) {
return note.outerHTML;
} else {
return note.innerHTML;
}
}
}
for (var i=0; i<xrefs.length; i++) {
const xref = xrefs[i];
tippyHover(xref, undefined, function(instance) {
instance.disable();
let url = xref.getAttribute('href');
let hash = undefined;
if (url.startsWith('#')) {
hash = url;
} else {
try { hash = new URL(url).hash; } catch {}
}
if (hash) {
const id = hash.replace(/^#\/?/, "");
const note = window.document.getElementById(id);
if (note !== null) {
try {
const html = processXRef(id, note.cloneNode(true));
instance.setContent(html);
} finally {
instance.enable();
instance.show();
}
} else {
// See if we can fetch this
fetch(url.split('#')[0])
.then(res => res.text())
.then(html => {
const parser = new DOMParser();
const htmlDoc = parser.parseFromString(html, "text/html");
const note = htmlDoc.getElementById(id);
if (note !== null) {
const html = processXRef(id, note);
instance.setContent(html);
}
}).finally(() => {
instance.enable();
instance.show();
});
}
} else {
// See if we can fetch a full url (with no hash to target)
// This is a special case and we should probably do some content thinning / targeting
fetch(url)
.then(res => res.text())
.then(html => {
const parser = new DOMParser();
const htmlDoc = parser.parseFromString(html, "text/html");
const note = htmlDoc.querySelector('main.content');
if (note !== null) {
// This should only happen for chapter cross references
// (since there is no id in the URL)
// remove the first header
if (note.children.length > 0 && note.children[0].tagName === "HEADER") {
note.children[0].remove();
}
const html = processXRef(null, note);
instance.setContent(html);
}
}).finally(() => {
instance.enable();
instance.show();
});
}
}, function(instance) {
});
}
let selectedAnnoteEl;
const selectorForAnnotation = ( cell, annotation) => {
let cellAttr = 'data-code-cell="' + cell + '"';
let lineAttr = 'data-code-annotation="' + annotation + '"';
const selector = 'span[' + cellAttr + '][' + lineAttr + ']';
return selector;
}
const selectCodeLines = (annoteEl) => {
const doc = window.document;
const targetCell = annoteEl.getAttribute("data-target-cell");
const targetAnnotation = annoteEl.getAttribute("data-target-annotation");
const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));
const lines = annoteSpan.getAttribute("data-code-lines").split(",");
const lineIds = lines.map((line) => {
return targetCell + "-" + line;
})
let top = null;
let height = null;
let parent = null;
if (lineIds.length > 0) {
//compute the position of the single el (top and bottom and make a div)
const el = window.document.getElementById(lineIds[0]);
top = el.offsetTop;
height = el.offsetHeight;
parent = el.parentElement.parentElement;
if (lineIds.length > 1) {
const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);
const bottom = lastEl.offsetTop + lastEl.offsetHeight;
height = bottom - top;
}
if (top !== null && height !== null && parent !== null) {
// cook up a div (if necessary) and position it
let div = window.document.getElementById("code-annotation-line-highlight");
if (div === null) {
div = window.document.createElement("div");
div.setAttribute("id", "code-annotation-line-highlight");
div.style.position = 'absolute';
parent.appendChild(div);
}
div.style.top = top - 2 + "px";
div.style.height = height + 4 + "px";
div.style.left = 0;
let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
if (gutterDiv === null) {
gutterDiv = window.document.createElement("div");
gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter");
gutterDiv.style.position = 'absolute';
const codeCell = window.document.getElementById(targetCell);
const gutter = codeCell.querySelector('.code-annotation-gutter');
gutter.appendChild(gutterDiv);
}
gutterDiv.style.top = top - 2 + "px";
gutterDiv.style.height = height + 4 + "px";
}
selectedAnnoteEl = annoteEl;
}
};
const unselectCodeLines = () => {
const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"];
elementsIds.forEach((elId) => {
const div = window.document.getElementById(elId);
if (div) {
div.remove();
}
});
selectedAnnoteEl = undefined;
};
// Handle positioning of the toggle
window.addEventListener(
"resize",
throttle(() => {
elRect = undefined;
if (selectedAnnoteEl) {
selectCodeLines(selectedAnnoteEl);
}
}, 10)
);
function throttle(fn, ms) {
let throttle = false;
let timer;
return (...args) => {
if(!throttle) { // first call gets through
fn.apply(this, args);
throttle = true;
} else { // all the others get throttled
if(timer) clearTimeout(timer); // cancel #2
timer = setTimeout(() => {
fn.apply(this, args);
timer = throttle = false;
}, ms);
}
};
}
// Attach click handler to the DT
const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
for (const annoteDlNode of annoteDls) {
annoteDlNode.addEventListener('click', (event) => {
const clickedEl = event.target;
if (clickedEl !== selectedAnnoteEl) {
unselectCodeLines();
const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');
if (activeEl) {
activeEl.classList.remove('code-annotation-active');
}
selectCodeLines(clickedEl);
clickedEl.classList.add('code-annotation-active');
} else {
// Unselect the line
unselectCodeLines();
clickedEl.classList.remove('code-annotation-active');
}
});
}
const findCites = (el) => {
const parentEl = el.parentElement;
if (parentEl) {
const cites = parentEl.dataset.cites;
if (cites) {
return {
el,
cites: cites.split(' ')
};
} else {
return findCites(el.parentElement)
}
} else {
return undefined;
}
};
var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
for (var i=0; i<bibliorefs.length; i++) {
const ref = bibliorefs[i];
const citeInfo = findCites(ref);
if (citeInfo) {
tippyHover(citeInfo.el, function() {
var popup = window.document.createElement('div');
citeInfo.cites.forEach(function(cite) {
var citeDiv = window.document.createElement('div');
citeDiv.classList.add('hanging-indent');
citeDiv.classList.add('csl-entry');
var biblioDiv = window.document.getElementById('ref-' + cite);
if (biblioDiv) {
citeDiv.innerHTML = biblioDiv.innerHTML;
}
popup.appendChild(citeDiv);
});
return popup.innerHTML;
});
}
}
});
</script>
<nav class="page-navigation">
<div class="nav-page nav-page-previous">
<a href="./02-part-ii-processes.html" class="pagination-link" aria-label="[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}">
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Part II — Cross the process boundary</span></span>
</a>
</div>
<div class="nav-page nav-page-next">
</div>
</nav>
</div> <!-- /content -->
<script src="site_libs/quarto-html/zenscroll-min.js"></script>
</body></html>
+1066
View File
File diff suppressed because it is too large. Load diff
+233
View File
@@ -0,0 +1,233 @@
[
{
"objectID": "index.html",
"href": "index.html",
"title": "From Calling to Eventing",
"section": "",
"text": "About these notes\nThese notes summarise the tutorial “SIN.04028 — From Calling to Eventing”, worked through step by step. The tutorial itself lives next to this book, in SIN.04028-From-Calling-to-Eventing/README.md, and belongs to the Process Control course given by Reto Konig at the University of Fribourg (autumn semester 2026).\nThe program under construction never changes: you type a line, it comes back rotated by 13 letters.\nWhat changes is everything around it. The tutorial rebuilds the same system again and again while asking three questions, in this order:\nOne summary is added here each time a step is finished, so the book grows at the pace of the work. Each summary says what the step did, what was observed when it ran, and what moved architecturally — usually a piece of knowledge that changed hands.",
"crumbs": [
"[About these notes]{.en}[À propos de ces notes]{.fr}[Über diese Notizen]{.de}"
]
},
{
"objectID": "index.html#sec-diagrams",
"href": "index.html#sec-diagrams",
"title": "From Calling to Eventing",
"section": "How to read the diagrams",
"text": "How to read the diagrams\nEvery diagram exists once as a drawing and three times as a language. In the web version, a diagram that carries a message flow has a small play bar under it: Play walks one message through the whole chain, One hop advances a single step, and Reset puts it back. Boxes light up as the message reaches them, so you can see which component is waiting and which one is working.\nIn the PDF, and in a browser with JavaScript switched off, the same picture is there — just still. Nothing in the notes depends on the animation.",
"crumbs": [
"[About these notes]{.en}[À propos de ces notes]{.fr}[Über diese Notizen]{.de}"
]
},
{
"objectID": "index.html#sec-build",
"href": "index.html#sec-build",
"title": "From Calling to Eventing",
"section": "Building this book",
"text": "Building this book\nThe three books come from one source:\n./render-all.sh # figures, then html + pdf for en, fr, de\n./render-all.sh --serve # …and serve _book/ on http://localhost:8000\n_book/ holds the English book, _book/fr/ the French one and _book/de/ the German one; the language menu in the sidebar switches between them and remembers the choice. A single quarto render builds English only and empties _book/, which removes the other two — so use the script.",
"crumbs": [
"[About these notes]{.en}[À propos de ces notes]{.fr}[Über diese Notizen]{.de}"
]
},
{
"objectID": "00-orientation.html",
"href": "00-orientation.html",
"title": "1  Step 0 — What the tutorial is about",
"section": "",
"text": "1.1 The three questions\nStep 0 contains no code. It states the subject: not ROT13, but the architecture around it. The functionality stays almost unchanged for 81 steps, which is what makes the changes around it visible.\nTwo rules are set here and hold for the whole tutorial:\nThat is why the tutorial does not start with MQTT, and not with dynamic subscriptions either. It first builds a system with deliberately awkward mediators, puts it into operation, and only then asks whether they have earned their place.\nThe second rule is about vocabulary: Intent, Status/State and Event are named only after they have been used. They appear in the tutorial around step 42, not before.\nThe planned route, from step 0:\nThe wording of the three questions matters, and it is easy to replace it with something weaker:\n“Knowing” is not “communicating”: two components can exchange messages all day without either one naming the other. “Deciding the wiring” is not “connecting”: the part that forwards messages need not be the part that chose the route. Both distinctions become concrete later — the first already in step 1, the second in part III.",
"crumbs": [
"<span class='chapter-number'>1</span>  <span class='chapter-title'>[Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de}</span>"
]
},
{
"objectID": "00-orientation.html#sec-three-questions",
"href": "00-orientation.html#sec-three-questions",
"title": "1  Step 0 — What the tutorial is about",
"section": "",
"text": "The tutorial asks\nA weaker version\n\n\n\n\nWho knows whom?\nwho communicates with whom\n\n\nWho owns what?\nwhich data each part holds\n\n\nWho decides how the system is wired?\nwhich part connects everything",
"crumbs": [
"<span class='chapter-number'>1</span>  <span class='chapter-title'>[Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html",
"href": "01-part-i-calls.html",
"title": "2  Part I — Start with what you already know",
"section": "",
"text": "2.1 Step 1 — Rock bottom: just call it\nSteps 1 to 10 stay inside one JVM. The system is built three times: as direct calls, as three capabilities that refuse to know each other, and as those same capabilities glued together by mediators. Nothing is distributed yet, and that is the point: the only thing that changes is who knows whom.\nProceduralRot13.java is the whole system in one compact source file: a loop that reads a line, and one statement that prints the rotated text.\nIO.readln() stands on its own line, but rot13(text) is not a step of its own: it is called inside the argument of IO.println. Neither rot13 nor IO.println knows anything about the other. The one that knows both is main(), which names them and fixes their order.\nWhat main() knows about rot13: that it exists, how to invoke it (a bare name, both live in the same implicitly generated class), what argument it takes, what it returns, that it is available right now, and that execution continues after it returns. It does not know how rot13 is implemented — that is the one thing it can ignore.\nThe availability guarantee is worth naming, because it disappears later: main() and rot13 are two methods of one already-loaded class, called on the same thread, in the same process. Nothing has to be started first, no message travels anywhere, no listener has to be subscribed.\nObserved: typing a line prints it rotated; Ctrl+D ends the program silently, because IO.readln() returns null and main() returns.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-1",
"href": "01-part-i-calls.html#sec-step-1",
"title": "2  Part I — Start with what you already know",
"section": "",
"text": "void main() {\n while (true) {\n var text = IO.readln();\n\n if (text == null)\n return;\n\n IO.println(rot13(text));\n }\n}\n\n\n\n\n\n\n\n\n\n\nFigure 2.1: The procedural version. The wiring is written into the code: main() names all three parts and fixes their order.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-2",
"href": "01-part-i-calls.html#sec-step-2",
"title": "2  Part I — Start with what you already know",
"section": "2.2 Step 2 — Three egoistic capabilities",
"text": "2.2 Step 2 — Three egoistic capabilities\nAn egoistic component says: I know what I can do, what data I accept and what data I produce — and I would rather not know the business process around me. Concretely, ConsoleIn must not contain rot13(...), and ROT13 must not contain consoleOut(...).\nRemoving those calls immediately creates a problem, which the tutorial states as a question: if nobody knows anybody, who makes this into a system? Note what the question does not say: the knowledge is not gone, it has to go somewhere else. Two connections are missing, not one — ConsoleIn ↔︎ ROT13 and ROT13 ↔︎ ConsoleOut.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-3",
"href": "01-part-i-calls.html#sec-step-3",
"title": "2  Part I — Start with what you already know",
"section": "2.3 Step 3 — Give every capability a mailbox",
"text": "2.3 Step 3 — Give every capability a mailbox\nThe smallest mechanism for the missing connections: a message and a named queue.\nrecord Message(String type, String value) {}\n\nMap&lt;String, BlockingQueue&lt;Message&gt;&gt; mailboxes = new ConcurrentHashMap&lt;&gt;();\n\nBlockingQueue&lt;Message&gt; mailbox(String name) {\n return mailboxes.computeIfAbsent(name, _ -&gt; new LinkedBlockingQueue&lt;&gt;());\n}\nThe tutorial insists on calling these mailboxes, not topics, and gives the reason: if two readers call take() on the same mailbox, they compete — each message goes to exactly one of them and is not copied to both. A topic, in Publish/Subscribe, would hand every subscriber its own copy. One reader per message is enough for now, and the limitation is kept on purpose: it is what makes it clear later what Publish/Subscribe actually adds.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-steps-4-6",
"href": "01-part-i-calls.html#sec-steps-4-6",
"title": "2  Part I — Start with what you already know",
"section": "2.4 Steps 4–6 — The three capabilities become egoistic",
"text": "2.4 Steps 4–6 — The three capabilities become egoistic\nEach capability now touches only its own mailbox names:\n\n\n\nCapability\nreads\nwrites\n\n\n\n\nConsoleIn\nthe keyboard\nconsoleIn.outbox\n\n\nROT13\nrot13.inbox\nrot13.outbox\n\n\nConsoleOut\nconsoleOut.inbox\nthe console\n\n\n\nNo capability contains the name of another. The tutorial’s own summary of the result: “three nicely isolated capabilities. And they do absolutely nothing together.” Nothing moves a message from consoleIn.outbox to rot13.inbox, or from rot13.outbox to consoleOut.inbox.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-7",
"href": "01-part-i-calls.html#sec-step-7",
"title": "2  Part I — Start with what you already know",
"section": "2.5 Step 7 — Enter the mediator",
"text": "2.5 Step 7 — Enter the mediator\nThe smallest possible glue: a loop that takes from one mailbox and puts into another, knowing nothing about what travels through it.\nvoid mediate(String from, String to) {\n while (true)\n mailbox(to).put(mailbox(from).take());\n}\nmain() starts five virtual threads: the three capabilities, plus two mediators whose routes are given as arguments — consoleIn.outbox → rot13.inbox and rot13.outbox → consoleOut.inbox.\nObserved: Hello World in, Uryyb Jbeyq out, exactly as in step 1. But Ctrl+D no longer ends the program. ConsoleIn’s thread returns (it does not loop), and the other four threads sit blocked in take() on empty mailboxes, using no CPU. What actually keeps the process alive is the last line of main(), Thread.currentThread().join(): the main thread waits for itself, which can never finish. Virtual threads are daemon threads, so those four waiting threads would not have kept the JVM running on their own.\n\n\n\n\n\n\nFigure 2.2: The mediated version inside one JVM. In the web version, Play walks one message through all eight hops.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-8",
"href": "01-part-i-calls.html#sec-step-8",
"title": "2  Part I — Start with what you already know",
"section": "2.6 Step 8 — Ask again: who knows whom?",
"text": "2.6 Step 8 — Ask again: who knows whom?\nDoes ConsoleIn know ROT13? No. Does ROT13 know ConsoleIn or ConsoleOut? No. Has the topology disappeared? No — it sits in the two mediate(...) calls inside main().\nThis is the tutorial’s first major result:\n\nDecoupling often does not make knowledge disappear. It moves knowledge to where it belongs.\n\nThe capability “ROT13 transforms text” belongs to ROT13. The topology ConsoleIn → ROT13 → ConsoleOut belongs to system composition. What changed since step 1 is not that the wiring left main() — it is still there — but that it is no longer written inside a capability. It is now data: two pairs of mailbox names. Rewiring touches those two lines and no capability at all.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-9",
"href": "01-part-i-calls.html#sec-step-9",
"title": "2  Part I — Start with what you already know",
"section": "2.7 Step 9 — Why virtual threads?",
"text": "2.7 Step 9 — Why virtual threads?\nFive loops now wait indefinitely: the keyboard, rot13.inbox, consoleOut.inbox and the two mediators’ sources. Virtual threads are simply the cheap Java way to let five waits happen at once inside one JVM.\nThey are an implementation convenience, not an architecture. The architecture — who knows whom, and where the wiring lives — is in the mailbox names, not in the threads. The tutorial’s own evidence for the separation: the same architecture will run as separate processes in step 11, with no threads shared between the parts.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-step-10",
"href": "01-part-i-calls.html#sec-step-10",
"title": "2  Part I — Start with what you already know",
"section": "2.8 Step 10 — Keep the services egoistic",
"text": "2.8 Step 10 — Keep the services egoistic\nThe obvious shortcut: the first mediator only copies messages unchanged, so why not delete it and let ROT13 take() from consoleIn.outbox directly?\nBecause ROT13 would then contain the name consoleIn.outbox, which means it would know that ConsoleIn exists and where it publishes. The topology would move into ROT13, and ROT13 would stop being an egoistic capability. The test that makes this concrete: suppose the input comes from a new FileIn capability publishing to fileIn.outbox.\n\n\n\n\nwith the mediator\nwith the shortcut\n\n\n\n\nwhat changes\none argument of the mediator\nrunRot13 itself\n\n\nwho is touched\nno capability\nROT13, whose job did not change\n\n\n\nThe tutorial is honest about the price: this design “may look indirect — even a little odd”, and it promises a different way to keep services egoistic without a mediator in every message’s path.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "01-part-i-calls.html#sec-part-i-result",
"href": "01-part-i-calls.html#sec-part-i-result",
"title": "2  Part I — Start with what you already know",
"section": "2.9 What part I moved",
"text": "2.9 What part I moved\n\n\n\n\n\n\n\n\nstage\nwhere the topology lives\nwho could rewire it\n\n\n\n\nstep 1\ninside the capability code (IO.println(rot13(text)))\nwhoever edits that code\n\n\nsteps 7–8\nin main(), as pairs of mailbox names\nwhoever edits main()\n\n\n\nFunctionality: unchanged. Lines of code: more. Parts that know each other: none. That is the trade the rest of the tutorial keeps testing.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html",
"href": "02-part-ii-processes.html",
"title": "3  Part II — Cross the process boundary",
"section": "",
"text": "3.1 Step 11 — Separate the components\nSteps 11 to 18 take the architecture of part I and split it across five operating-system processes on one computer. The capabilities keep their mailbox names; only the transport underneath changes, from Java objects to files in directories. The first genuinely distributed problem shows up here, and it has nothing to do with ROT13.\nThree processes cannot share a BlockingQueue: every java command starts its own JVM with its own memory, so the mailboxes map would exist three times and each copy would see only its own messages. An external transport is needed.\nTCP would do, MQTT would do. The tutorial deliberately picks the most primitive option, the filesystem, and gives a one-line reason: because you can see it. Messages become files you can list with ls and read with cat while the system runs. Primitive here does not mean inferior; part VIII comes back to what the filesystem is genuinely good and bad at.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html#sec-steps-12-13",
"href": "02-part-ii-processes.html#sec-steps-12-13",
"title": "3  Part II — Cross the process boundary",
"section": "3.2 Steps 12–13 — A directory becomes a mailbox",
"text": "3.2 Steps 12–13 — A directory becomes a mailbox\nThe mapping is one line long:\ndirectory = mailbox file = message\npublish = create file receive = watch directory\nmessageBoard/\n├── consoleIn/outbox/\n├── rot13/inbox/\n├── rot13/outbox/\n└── consoleOut/inbox/\nThe Message record gains an optional timestamp, and the file format stays two lines plus an optional third:\nTEXT\nHello World\nTIMESTAMP: 2026-09-22T10:42:12.123Z\nA message written by hand may leave the timestamp out. The TIMESTAMP: marker keeps a payload line that happens to look like a date from being mistaken for metadata; in this tiny format, a final line starting with TIMESTAMP: is reserved.\nJackson could be introduced here and deliberately is not. The point of a ridiculously simple format is that almost nothing hides the architecture — the whole message is readable in any text editor, which is what keeps the attention on who talks to whom.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html#sec-step-14",
"href": "02-part-ii-processes.html#sec-step-14",
"title": "3  Part II — Cross the process boundary",
"section": "3.3 Step 14 — The first distributed-systems problem: publication",
"text": "3.3 Step 14 — The first distributed-systems problem: publication\nA reader watching a directory can discover a file before the writer has finished writing it. Hence a publication protocol:\n\ncreate a private temporary file;\nwrite the complete message;\nclose it;\natomically rename it to its final .msg name;\nconsumers react only to final files.\n\nFiles.writeString(temporary, content);\nFiles.move(temporary, published, StandardCopyOption.ATOMIC_MOVE);\nBoth halves are needed. The rename is atomic — a reader sees either no .msg file or the complete one — but it protects nothing if readers also pick up .tmp files. .tmp and .msg stay in the same directory so the move cannot cross filesystems, where atomicity would be lost.\n\nWriting and publishing are not the same operation.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html#sec-step-15",
"href": "02-part-ii-processes.html#sec-step-15",
"title": "3  Part II — Cross the process boundary",
"section": "3.4 Step 15 — Observe a mailbox with WatchService",
"text": "3.4 Step 15 — Observe a mailbox with WatchService\nJava’s own filesystem observer supplies the consumer half: register a directory for ENTRY_CREATE, block in watcher.take(), and ignore every filename that does not end in .msg.\nThat also gives a low-tech injection tool. With ActuatorService running as the consumer:\nprintf 'TEXT\\nHello from a file' &gt; messageBoard/consoleOut/inbox/manual.tmp\nmv messageBoard/consoleOut/inbox/manual.tmp messageBoard/consoleOut/inbox/manual.msg\nObserved: nothing happens when the .tmp file appears; the line is printed the moment the rename creates the .msg name. Both accepted formats work, with and without the trailing timestamp.\nThe architectural lesson is the one the tutorial draws as producer → filesystem → consumer: the consumer could not tell a human typing mv from a real service. It knows its own inbox, not who writes into it. Egoism survived the process boundary.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html#sec-steps-16-17",
"href": "02-part-ii-processes.html#sec-steps-16-17",
"title": "3  Part II — Cross the process boundary",
"section": "3.5 Steps 16–17 — Services and mediator become processes",
"text": "3.5 Steps 16–17 — Services and mediator become processes\nThe three capabilities become three programs, and the mediator a fourth kind of program:\n\n\n\n\n\n\n\n\n\nprogram\nplays\nreads\nwrites\n\n\n\n\nSensorService.java\nConsoleIn\nthe keyboard\nconsoleIn/outbox\n\n\nProcessorService.java\nROT13\nrot13/inbox\nrot13/outbox\n\n\nActuatorService.java\nConsoleOut\nconsoleOut/inbox\nthe console\n\n\nMediator.java &lt;from&gt; &lt;to&gt;\nthe glue\n&lt;from&gt;\n&lt;to&gt;\n\n\n\nThe mediator is generic: its route is not compiled in, it arrives as two startup arguments. But the tutorial points at an asymmetry worth keeping in mind: the three capabilities receive their work as messages in a mailbox, while the mediator receives its route as startup configuration, and it has no name and no control mailbox of its own that anyone could write to.\nThe practical consequence: arguments are read once, so changing the route of a running mediator means stopping it and starting it again. A configuration file would be no different — it is still read at startup. The tutorial deliberately leaves this unfixed until the cost of the distributed mediators has been felt.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html#sec-step-18",
"href": "02-part-ii-processes.html#sec-step-18",
"title": "3  Part II — Cross the process boundary",
"section": "3.6 Step 18 — Run the fully external local version",
"text": "3.6 Step 18 — Run the fully external local version\nFive terminals, five processes, one local filesystem between them:\njava SensorService.java # terminal 1\njava Mediator.java consoleIn/outbox rot13/inbox # terminal 2\njava ProcessorService.java # terminal 3\njava Mediator.java rot13/outbox consoleOut/inbox # terminal 4\njava ActuatorService.java # terminal 5\nObserved: Hello World typed in terminal 1 appeared as Uryyb Jbeyq in terminal 5. The three middle terminals showed nothing new — each mediator prints one “Mediating: …” line at startup, and ProcessorService prints nothing at all. Afterwards each of the four mailbox directories held one .msg file: the same line, copied along the chain.\nCount it: five processes for what step 1 did in one statement. The tutorial’s instruction at this point is not to optimise: “We are not done making it painful.”\n\n\n\n\n\n\nFigure 3.1: The five processes and the four mailbox directories. In the web version, Play follows one line of text from the keyboard to the console.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "02-part-ii-processes.html#sec-part-ii-result",
"href": "02-part-ii-processes.html#sec-part-ii-result",
"title": "3  Part II — Cross the process boundary",
"section": "3.7 What part II moved",
"text": "3.7 What part II moved\n\n\n\n\n\n\n\n\nstage\nwhere the topology lives\nwho could rewire it\n\n\n\n\nstep 1\ninside the capability code\nwhoever edits that code\n\n\nsteps 7–8\nin main(), as mailbox names\nwhoever edits main()\n\n\nstep 18\nin the two Mediator.java &lt;from&gt; &lt;to&gt; command lines\nwhoever starts the processes\n\n\n\nThe topology has now left the source code altogether: no .java file contains the route. It lives in what the operator typed, which means a person is currently the orchestrator. What the five-process version bought is real — the wiring can change without touching any program — and what it cost is equally real: five processes, four copies of every message, and a program that no longer stops when you press Ctrl+D.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "glossary.html",
"href": "glossary.html",
"title": "Glossary",
"section": "",
"text": "Every term below is defined where it is first used, and linked from every later mention. The arrow on an entry leads back to that page.",
"crumbs": [
"Appendices",
"[Glossary]{.en}[Glossaire]{.fr}[Glossar]{.de}"
]
}
]
@@ -0,0 +1,12 @@
/*!
* Bootstrap v5.3.1 (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/@import"https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Serif:ital,wght@0,400;0,600;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap";:root,[data-bs-theme=light]{--bs-blue: #2780e3;--bs-indigo: #6610f2;--bs-purple: #613d7c;--bs-pink: #e83e8c;--bs-red: #ff0039;--bs-orange: #f0ad4e;--bs-yellow: #ff7518;--bs-green: #3fb618;--bs-teal: #20c997;--bs-cyan: #9954bb;--bs-black: #000;--bs-white: #fff;--bs-gray: #6c757d;--bs-gray-dark: #343a40;--bs-gray-100: #f8f9fa;--bs-gray-200: #e9ecef;--bs-gray-300: #dee2e6;--bs-gray-400: #ced4da;--bs-gray-500: #adb5bd;--bs-gray-600: #6c757d;--bs-gray-700: #495057;--bs-gray-800: #343a40;--bs-gray-900: #212529;--bs-default: #5a6879;--bs-primary: #20666f;--bs-secondary: #5a6879;--bs-success: #3fb618;--bs-info: #9954bb;--bs-warning: #ff7518;--bs-danger: #ff0039;--bs-light: #f8f9fa;--bs-dark: #343a40;--bs-default-rgb: 90, 104, 121;--bs-primary-rgb: 32, 102, 111;--bs-secondary-rgb: 90, 104, 121;--bs-success-rgb: 63, 182, 24;--bs-info-rgb: 153, 84, 187;--bs-warning-rgb: 255, 117, 24;--bs-danger-rgb: 255, 0, 57;--bs-light-rgb: 248, 249, 250;--bs-dark-rgb: 52, 58, 64;--bs-primary-text-emphasis: rgb(12.8, 40.8, 44.4);--bs-secondary-text-emphasis: rgb(36, 41.6, 48.4);--bs-success-text-emphasis: rgb(25.2, 72.8, 9.6);--bs-info-text-emphasis: rgb(61.2, 33.6, 74.8);--bs-warning-text-emphasis: rgb(102, 46.8, 9.6);--bs-danger-text-emphasis: rgb(102, 0, 22.8);--bs-light-text-emphasis: #495057;--bs-dark-text-emphasis: #495057;--bs-primary-bg-subtle: rgb(210.4, 224.4, 226.2);--bs-secondary-bg-subtle: rgb(222, 224.8, 228.2);--bs-success-bg-subtle: rgb(216.6, 240.4, 208.8);--bs-info-bg-subtle: rgb(234.6, 220.8, 241.4);--bs-warning-bg-subtle: rgb(255, 227.4, 208.8);--bs-danger-bg-subtle: rgb(255, 204, 215.4);--bs-light-bg-subtle: rgb(251.5, 252, 252.5);--bs-dark-bg-subtle: #ced4da;--bs-primary-border-subtle: rgb(165.8, 193.8, 197.4);--bs-secondary-border-subtle: rgb(189, 194.6, 201.4);--bs-success-border-subtle: rgb(178.2, 225.8, 162.6);--bs-info-border-subtle: rgb(214.2, 186.6, 227.8);--bs-warning-border-subtle: rgb(255, 199.8, 162.6);--bs-danger-border-subtle: rgb(255, 153, 175.8);--bs-light-border-subtle: #e9ecef;--bs-dark-border-subtle: #adb5bd;--bs-white-rgb: 255, 255, 255;--bs-black-rgb: 0, 0, 0;--bs-font-sans-serif: "IBM Plex Sans", system-ui, -apple-system, sans-serif;--bs-font-monospace: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-root-font-size: 17px;--bs-body-font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;--bs-body-font-size:1rem;--bs-body-font-weight: 400;--bs-body-line-height: 1.66;--bs-body-color: #1b2430;--bs-body-color-rgb: 27, 36, 48;--bs-body-bg: #fbfcfd;--bs-body-bg-rgb: 251, 252, 253;--bs-emphasis-color: #000;--bs-emphasis-color-rgb: 0, 0, 0;--bs-secondary-color: rgba(27, 36, 48, 0.75);--bs-secondary-color-rgb: 27, 36, 48;--bs-secondary-bg: #e9ecef;--bs-secondary-bg-rgb: 233, 236, 239;--bs-tertiary-color: rgba(27, 36, 48, 0.5);--bs-tertiary-color-rgb: 27, 36, 48;--bs-tertiary-bg: #f8f9fa;--bs-tertiary-bg-rgb: 248, 249, 250;--bs-heading-color: inherit;--bs-link-color: #20666f;--bs-link-color-rgb: 32, 102, 111;--bs-link-decoration: underline;--bs-link-hover-color: rgb(25.6, 81.6, 88.8);--bs-link-hover-color-rgb: 26, 82, 89;--bs-code-color: #1b2430;--bs-highlight-bg: rgb(255, 227.4, 208.8);--bs-border-width: 1px;--bs-border-style: solid;--bs-border-color: #dae0e8;--bs-border-color-translucent: rgba(0, 0, 0, 0.175);--bs-border-radius: 0.25rem;--bs-border-radius-sm: 0.2em;--bs-border-radius-lg: 0.5rem;--bs-border-radius-xl: 1rem;--bs-border-radius-xxl: 2rem;--bs-border-radius-2xl: var(--bs-border-radius-xxl);--bs-border-radius-pill: 50rem;--bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.075);--bs-focus-ring-width: 0.25rem;--bs-focus-ring-opacity: 0.25;--bs-focus-ring-color: rgba(32, 102, 111, 0.25);--bs-form-valid-color: #3fb618;--bs-form-valid-border-color: #3fb618;--bs-form-invalid-color: #ff0039;--bs-form-invalid-border-color: #ff0039}[data-bs-theme=dark]{color-scheme:dark;--bs-body-color: #dee2e6;--bs-body-color-rgb: 222, 226, 230;--bs-body-bg: #212529;--bs-body-bg-rgb: 33, 37, 41;--bs-emphasis-color: #fff;--bs-emphasis-color-rgb: 255, 255, 255;--bs-secondary-color: rgba(222, 226, 230, 0.75);--bs-secondary-color-rgb: 222, 226, 230;--bs-secondary-bg: #343a40;--bs-secondary-bg-rgb: 52, 58, 64;--bs-tertiary-color: rgba(222, 226, 230, 0.5);--bs-tertiary-color-rgb: 222, 226, 230;--bs-tertiary-bg: rgb(42.5, 47.5, 52.5);--bs-tertiary-bg-rgb: 43, 48, 53;--bs-primary-text-emphasis: rgb(121.2, 163.2, 168.6);--bs-secondary-text-emphasis: rgb(156, 164.4, 174.6);--bs-success-text-emphasis: rgb(139.8, 211.2, 116.4);--bs-info-text-emphasis: rgb(193.8, 152.4,Line truncated
*
* ansi colors from IPython notebook's
*
* we also add `bright-[color]-` synonyms for the `-[color]-intense` classes since
* that seems to be what ansi_up emits
*
*/.ansi-black-fg{color:#3e424d}.ansi-black-bg{background-color:#3e424d}.ansi-black-intense-black,.ansi-bright-black-fg{color:#282c36}.ansi-black-intense-black,.ansi-bright-black-bg{background-color:#282c36}.ansi-red-fg{color:#e75c58}.ansi-red-bg{background-color:#e75c58}.ansi-red-intense-red,.ansi-bright-red-fg{color:#b22b31}.ansi-red-intense-red,.ansi-bright-red-bg{background-color:#b22b31}.ansi-green-fg{color:#00a250}.ansi-green-bg{background-color:#00a250}.ansi-green-intense-green,.ansi-bright-green-fg{color:#007427}.ansi-green-intense-green,.ansi-bright-green-bg{background-color:#007427}.ansi-yellow-fg{color:#ddb62b}.ansi-yellow-bg{background-color:#ddb62b}.ansi-yellow-intense-yellow,.ansi-bright-yellow-fg{color:#b27d12}.ansi-yellow-intense-yellow,.ansi-bright-yellow-bg{background-color:#b27d12}.ansi-blue-fg{color:#208ffb}.ansi-blue-bg{background-color:#208ffb}.ansi-blue-intense-blue,.ansi-bright-blue-fg{color:#0065ca}.ansi-blue-intense-blue,.ansi-bright-blue-bg{background-color:#0065ca}.ansi-magenta-fg{color:#d160c4}.ansi-magenta-bg{background-color:#d160c4}.ansi-magenta-intense-magenta,.ansi-bright-magenta-fg{color:#a03196}.ansi-magenta-intense-magenta,.ansi-bright-magenta-bg{background-color:#a03196}.ansi-cyan-fg{color:#60c6c8}.ansi-cyan-bg{background-color:#60c6c8}.ansi-cyan-intense-cyan,.ansi-bright-cyan-fg{color:#258f8f}.ansi-cyan-intense-cyan,.ansi-bright-cyan-bg{background-color:#258f8f}.ansi-white-fg{color:#c5c1b4}.ansi-white-bg{background-color:#c5c1b4}.ansi-white-intense-white,.ansi-bright-white-fg{color:#a1a6b2}.ansi-white-intense-white,.ansi-bright-white-bg{background-color:#a1a6b2}.ansi-default-inverse-fg{color:#fff}.ansi-default-inverse-bg{background-color:#000}.ansi-bold{font-weight:bold}.ansi-underline{text-decoration:underline}:root{--quarto-body-bg: #fbfcfd;--quarto-body-color: #1b2430;--quarto-text-muted: #6c757d;--quarto-border-color: #dae0e8;--quarto-border-width: 1px}table.gt_table{color:var(--quarto-body-color);font-size:1em;width:100%;background-color:rgba(0,0,0,0);border-top-width:inherit;border-bottom-width:inherit;border-color:var(--quarto-border-color)}table.gt_table th.gt_column_spanner_outer{color:var(--quarto-body-color);background-color:rgba(0,0,0,0);border-top-width:inherit;border-bottom-width:inherit;border-color:var(--quarto-border-color)}table.gt_table th.gt_col_heading{color:var(--quarto-body-color);font-weight:bold;background-color:rgba(0,0,0,0)}table.gt_table thead.gt_col_headings{border-bottom:1px solid currentColor;border-top-width:inherit;border-top-color:var(--quarto-border-color)}table.gt_table thead.gt_col_headings:not(:first-child){border-top-width:1px;border-top-color:var(--quarto-border-color)}table.gt_table td.gt_row{border-bottom-width:1px;border-bottom-color:var(--quarto-border-color);border-top-width:0px}table.gt_table tbody.gt_table_body{border-top-width:1px;border-bottom-width:1px;border-bottom-color:var(--quarto-border-color);border-top-color:currentColor}div.columns{display:initial;gap:initial}div.column{display:inline-block;overflow-x:initial;vertical-align:top;width:50%}.code-annotation-tip-content{word-wrap:break-word}.code-annotation-container-hidden{display:none !important}dl.code-annotation-container-grid{display:grid;grid-template-columns:min-content auto}dl.code-annotation-container-grid dt{grid-column:1}dl.code-annotation-container-grid dd{grid-column:2}pre.sourceCode.code-annotation-code{padding-right:0}code.sourceCode .code-annotation-anchor{z-index:100;position:relative;float:right;background-color:rgba(0,0,0,0)}input[type=checkbox]{margin-right:.5ch}:root{--mermaid-bg-color: #fbfcfd;--mermaid-edge-color: #5a6879;--mermaid-node-fg-color: #1b2430;--mermaid-fg-color: #1b2430;--mermaid-fg-color--lighter: rgb(45.36, 60.48, 80.64);--mermaid-fg-color--lightest: rgb(63.72, 84.96, 113.28);--mermaid-font-family: IBM Plex Sans, system-ui, -apple-system, sans-serif;--mermaid-label-bg-color: #fbfcfd;--mermaid-label-fg-color: #20666f;--mermaid-node-bg-color: rgba(32, 102, 111, 0.1);--mermaid-node-fg-color: #1b2430}@media print{:root{font-size:11pt}#quarto-sidebar,#TOC,.nav-page{display:none}.page-columns .content{grid-column-start:page-start}.fixed-top{position:relative}.panel-caption,.figure-caption,figcaption{color:#666}}body.quarto-light .dark-content{display:none !important}body.quarto-dark .light-content{display:none !important}.code-copy-button{position:absolute;top:0;right:0;border:0;margin-top:5px;margin-right:5px;background-color:rgba(0,0,0,0);z-index:3}.code-copy-button-tooltip{font-size:.75em}.code-copy-button>.bi::before{display:inline-block;height:1rem;width:1rem;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="rgb(94, 94, 94)" viewBox="0 0 16 16"><path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"/><path d="M9.5 1a.5.5 0 0 1 .5.5vLine truncated
File diff suppressed because it is too large. Load diff
Binary file not shown.
+7
View File
@@ -0,0 +1,7 @@
/*!
* Bootstrap v5.3.1 (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).bootstrap=e()}(this,(function(){"use strict";const t=new Map,e={set(e,i,n){t.has(e)||t.set(e,new Map);const s=t.get(e);s.has(i)||0===s.size?s.set(i,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`)},get:(e,i)=>t.has(e)&&t.get(e).get(i)||null,remove(e,i){if(!t.has(e))return;const n=t.get(e);n.delete(i),0===n.size&&t.delete(e)}},i="transitionend",n=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),s=t=>{t.dispatchEvent(new Event(i))},o=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),r=t=>o(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(n(t)):null,a=t=>{if(!o(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(!i)return e;if(i!==t){const e=t.closest("summary");if(e&&e.parentNode!==i)return!1;if(null===e)return!1}return e},l=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),c=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?c(t.parentNode):null},h=()=>{},d=t=>{t.offsetHeight},u=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,f=[],p=()=>"rtl"===document.documentElement.dir,m=t=>{var e;e=()=>{const e=u();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}},"loading"===document.readyState?(f.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of f)t()})),f.push(e)):e()},g=(t,e=[],i=t)=>"function"==typeof t?t(...e):i,_=(t,e,n=!0)=>{if(!n)return void g(t);const o=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const n=Number.parseFloat(e),s=Number.parseFloat(i);return n||s?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(e)+5;let r=!1;const a=({target:n})=>{n===e&&(r=!0,e.removeEventListener(i,a),g(t))};e.addEventListener(i,a),setTimeout((()=>{r||s(e)}),o)},b=(t,e,i,n)=>{const s=t.length;let o=t.indexOf(e);return-1===o?!i&&n?t[s-1]:t[0]:(o+=i?1:-1,n&&(o=(o+s)%s),t[Math.max(0,Math.min(o,s-1))])},v=/[^.]*(?=\..*)\.|.*/,y=/\..*/,w=/::\d+$/,A={};let E=1;const T={mouseenter:"mouseover",mouseleave:"mouseout"},C=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function O(t,e){return e&&`${e}::${E++}`||t.uidEvent||E++}function x(t){const e=O(t);return t.uidEvent=e,A[e]=A[e]||{},A[e]}function k(t,e,i=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===i))}function L(t,e,i){const n="string"==typeof e,s=n?i:e||i;let o=I(t);return C.has(o)||(o=t),[n,s,o]}function S(t,e,i,n,s){if("string"!=typeof e||!t)return;let[o,r,a]=L(e,i,n);if(e in T){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};r=t(r)}const l=x(t),c=l[a]||(l[a]={}),h=k(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=O(r,e.replace(v,"")),u=o?function(t,e,i){return function n(s){const o=t.querySelectorAll(e);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return P(s,{delegateTarget:r}),n.oneOff&&N.off(t,s.type,e,i),i.apply(r,[s])}}(t,i,r):function(t,e){return function i(n){return P(n,{delegateTarget:t}),i.oneOff&&N.off(t,n.type,e),e.apply(t,[n])}}(t,r);u.delegationSelector=o?i:null,u.callable=r,u.oneOff=s,u.uidEvent=d,c[d]=u,t.addEventListener(a,u,o)}function D(t,e,i,n,s){const o=k(e[i],n,s);o&&(t.removeEventListener(i,o,Boolean(s)),delete e[i][o.uidEvent])}function $(t,e,i,n){const s=e[i]||{};for(const[o,r]of Object.entries(s))o.includes(n)&&D(t,e,i,r.callable,r.delegationSelector)}function I(t){return t=t.replace(y,""),T[t]||t}const N={on(t,e,i,n){S(t,e,i,n,!1)},one(t,e,i,n){S(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[s,o,r]=L(e,i,n),a=r!==e,l=x(t),c=l[r]||{},h=e.startsWith(".");if(void 0===o){if(h)for(const i of Object.keys(l))$(t,l,i,e.slLine truncated
//# sourceMappingURL=bootstrap.bundle.min.js.map
+7
View File
@@ -0,0 +1,7 @@
/*!
* clipboard.js v2.0.11
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return b}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),r=n.n(e);function c(t){try{return document.execCommand(t)}catch(t){return}}var a=function(t){t=r()(t);return c("cut"),t};function o(t,e){var n,o,t=(n=t,o="rtl"===document.documentElement.getAttribute("dir"),(t=document.createElement("textarea")).style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0",t.style.position="absolute",t.style[o?"right":"left"]="-9999px",o=window.pageYOffset||document.documentElement.scrollTop,t.style.top="".concat(o,"px"),t.setAttribute("readonly",""),t.value=n,t);return e.container.appendChild(t),e=r()(t),c("copy"),t.remove(),e}var f=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return"string"==typeof t?n=o(t,e):t instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==t?void 0:t.type)?n=o(t.value,e):(n=r()(t),c("copy")),n};function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.action,n=void 0===e?"copy":e,o=t.container,e=t.target,t=t.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==e){if(!e||"object"!==l(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return t?f(t,{container:o}):e?"cut"===n?a(e):f(e,{container:o}):void 0};function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function y(t,e){return(y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(n){var o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=v(n);return t=o?(t=v(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments),e=this,!(t=t)||"object"!==p(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(t,e){t="data-clipboard-".concat(t);if(e.hasAttribute(t))return e.getAttribute(t)}var b=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)}(r,i());var t,e,n,o=h(r);function r(t,e){var n;return function(t){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this),(n=o.call(this)).resolveOptions(e),n.listenClick(t),n}return t=r,n=[{key:"copy",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body};return f(t,e)}},{key:"cut",value:function(t){return a(t)}},{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof t?[t]:t,e=!!document.queryCommandSupported;return t.forEach(function(t){e=e&&!!document.queryCommandSupported(t)}),e}}],(e=[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===p(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=u()(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget,n=this.action(e)||"copy",t=s({action:n,container:thLine truncated
@@ -0,0 +1,86 @@
/* exo — exercise cards, hint folds (sequential unlock), solution fold */
.exo {
margin: 1.2rem 0;
padding: 0.6rem 0.9rem;
border: 1px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 35%, transparent);
border-left: 3px solid var(--calc-notecolor, #B45309);
border-radius: 0.35rem;
scroll-margin-top: 5rem;
}
/* keep wide content inside the card: display math (and tables/code) scroll
on their own rather than spilling past the border. overflow-y stays hidden
so Firefox doesn't add a phantom vertical bar, as in .calc */
.exo mjx-container[display="true"],
.exo .katex-display {
max-width: 100%;
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 0.35em; /* keep descenders clear of a horizontal bar */
/* a centred overflowing box clips its left side out of reach, so centre
only while the formula fits (browsers without `safe` keep plain centring) */
display: flex;
justify-content: center;
justify-content: safe center;
}
.exo .math.display { display: block; max-width: 100%; }
.exo :is(pre, table) { max-width: 100%; overflow-x: auto; }
.exo img, .exo svg { max-width: 100%; }
.exo-head p { margin: 0 0 0.4rem; }
.exo-head strong { color: var(--calc-notecolor, #B45309); }
.exo details {
margin: 0.45rem 0;
border-radius: 0.3rem;
}
.exo details > summary {
cursor: pointer;
list-style: none;
user-select: none;
font-size: 0.9em;
font-weight: 600;
}
.exo details > summary::-webkit-details-marker { display: none; }
.exo details > summary::before { content: "▸ "; }
.exo details[open] > summary::before { content: "▾ "; }
/* hints: small highlight boxes */
.exo-hint {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 6%, transparent);
border: 1px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 30%, transparent);
padding: 0.25rem 0.6rem;
}
.exo-hint > summary { color: var(--calc-notecolor, #B45309); }
/* locked hints: unlock one by one */
.exo-hint.exo-locked > summary {
cursor: not-allowed;
opacity: 0.45;
}
.exo-hint.exo-locked > summary::before { content: "🔒 "; }
/* solution: closed by default, visually separated */
.exo-sol {
border-top: 1px dashed color-mix(in srgb, var(--calc-notecolor, #B45309) 40%, transparent);
padding: 0.35rem 0.1rem 0.1rem;
scroll-margin-top: 5rem;
}
/* in a numbered part, the fold lines up with the part's text */
.exo li > details { margin-left: 0; }
/* hand-in extracts (handin.sh, html output) */
.exo-handin-sol, .exo-handin-hint {
margin: 0.6rem 0;
padding: 0.2rem 0 0.2rem 0.8rem;
border-left: 2px solid var(--calc-notecolor, #B45309);
}
.exo-fold-body { margin-top: 0.3rem; }
.exo-fold-body > p:first-child { margin-top: 0; }
.exo-fold-body > p:last-child { margin-bottom: 0; }
@media print {
.exo details > summary::before { content: ""; }
.exo-hint.exo-locked > summary { opacity: 1; cursor: default; }
}
@@ -0,0 +1,39 @@
// exo — hints unlock one by one within a part; everything unfolds for printing
(function () {
// block opening a locked hint
document.addEventListener("click", function (e) {
var s = e.target.closest ? e.target.closest("details.exo-hint.exo-locked > summary") : null;
if (s) e.preventDefault();
});
// opening hint n of a part unlocks hint n+1 of the same part, wherever it
// sits in the exercise (toggle doesn't bubble: use capture)
document.addEventListener("toggle", function (e) {
var d = e.target;
if (!d.classList || !d.classList.contains("exo-hint") || !d.open) return;
var chain = d.getAttribute("data-exo-chain");
var n = parseInt(d.getAttribute("data-exo-hint"), 10);
if (!chain || isNaN(n)) return;
var hints = document.querySelectorAll("details.exo-hint[data-exo-chain]");
for (var i = 0; i < hints.length; i++) {
if (hints[i].getAttribute("data-exo-chain") === chain &&
parseInt(hints[i].getAttribute("data-exo-hint"), 10) === n + 1) {
hints[i].classList.remove("exo-locked");
}
}
}, true);
// print: open all hints/solutions, restore afterwards
window.addEventListener("beforeprint", function () {
document.querySelectorAll(".exo details").forEach(function (d) {
d.dataset.exoWasOpen = d.open ? "1" : "0";
d.open = true;
});
});
window.addEventListener("afterprint", function () {
document.querySelectorAll(".exo details").forEach(function (d) {
d.open = d.dataset.exoWasOpen === "1";
delete d.dataset.exoWasOpen;
});
});
})();
@@ -0,0 +1,77 @@
/* glossary — usages, entries, hover tooltip */
/* usages: dotted underline, keep math color */
a.gls-sym,
mjx-container a {
color: inherit;
text-decoration: none;
}
.gls-sym {
border-bottom: 1px dotted currentColor;
cursor: help;
}
/* rendered glossary list */
.glossary .gls-entry {
margin: 0.8rem 0;
padding: 0.35rem 0.7rem;
border-left: 3px solid var(--calc-notecolor, #B45309);
scroll-margin-top: 5rem; /* don't hide behind Quarto's sticky header */
}
.glossary .gls-entry p { margin: 0 0 0.2rem; }
.glossary .gls-entry:target {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 10%, transparent);
border-radius: 0.25rem;
}
/* floating hover tooltip (filled by glossary.js) */
.gls-float {
position: absolute;
z-index: 1000;
max-width: 26rem;
padding: 0.5rem 0.75rem;
border: 1px solid var(--calc-notecolor, #B45309);
border-radius: 0.4rem;
background: var(--bs-body-bg, #fff);
color: var(--bs-body-color, #1a1a1a);
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
font-size: 0.9em;
line-height: 1.4;
}
.gls-float p { margin: 0 0 0.25rem; }
.gls-float p:last-child { margin-bottom: 0; }
/* in-place definition cards and property sub-entries */
.gls-inline {
margin: 1rem 0;
padding: 0.4rem 0.8rem;
border-left: 3px solid var(--calc-notecolor, #B45309);
scroll-margin-top: 5rem;
}
.gls-inline p { margin: 0 0 0.3rem; }
.gls-inline:target,
.gls-prop-entry:target {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 10%, transparent);
border-radius: 0.25rem;
}
.gls-prop-entry {
margin: 0.5rem 0 0.5rem 1.2rem;
padding: 0.25rem 0.6rem;
border-left: 2px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 45%, transparent);
font-size: 0.95em;
scroll-margin-top: 5rem;
}
.gls-back {
font-size: 0.85em;
opacity: 0.75;
}
/* standalone property cards keep the section flow (no indent) */
.gls-prop-entry.gls-standalone {
margin-left: 0;
font-size: 1em;
}
.glossary .gls-prop-line {
margin: 0.1rem 0 0.1rem 1.2rem;
font-size: 0.9em;
}
@@ -0,0 +1,68 @@
// glossary — hover tooltip for .gls-sym usages (prose links and MathJax \class nodes)
(function () {
var tip = null;
function ensureTip() {
if (tip === null) {
tip = document.createElement("div");
tip.className = "gls-float";
tip.style.display = "none";
document.body.appendChild(tip);
}
return tip;
}
function keyOf(el) {
if (el.dataset && el.dataset.glsKey) return el.dataset.glsKey;
for (var i = 0; i < el.classList.length; i++) {
var c = el.classList[i];
if (c.indexOf("gls-key-") === 0) return c.slice(8);
}
return null;
}
function show(target) {
var key = keyOf(target);
if (!key) return;
var entry = document.getElementById("gls-" + key);
var t = ensureTip();
if (entry) {
// for a main entry, don't drag every property into the popup
var node = entry.cloneNode(true);
node.querySelectorAll(".gls-prop-entry").forEach(function (n) { n.remove(); });
t.innerHTML = node.innerHTML;
} else if (window.__glsData && window.__glsData[key]) {
// entry lives on another page (book chapters render separately)
t.innerHTML = window.__glsData[key];
} else {
return;
}
t.style.display = "block";
if (window.MathJax && window.MathJax.typesetPromise) {
window.MathJax.typesetPromise([t]).catch(function () {});
}
var r = target.getBoundingClientRect();
var x = r.left + window.scrollX;
var y = r.bottom + window.scrollY + 6;
// keep it on screen horizontally
var w = t.offsetWidth;
var maxX = window.scrollX + document.documentElement.clientWidth - w - 12;
t.style.left = Math.max(window.scrollX + 8, Math.min(x, maxX)) + "px";
t.style.top = y + "px";
}
function hide() {
if (tip !== null) tip.style.display = "none";
}
document.addEventListener("mouseover", function (e) {
var el = e.target.closest ? e.target.closest(".gls-sym") : null;
if (el) show(el);
});
document.addEventListener("mouseout", function (e) {
var el = e.target.closest ? e.target.closest(".gls-sym") : null;
if (el) hide();
});
document.addEventListener("click", hide);
window.addEventListener("scroll", hide, { passive: true });
})();
@@ -0,0 +1,45 @@
/* latex-tables — HTML rendering of LaTeX tabular environments */
.ltx-table {
border-collapse: collapse;
margin: 1rem auto;
max-width: 100%;
overflow-x: auto;
display: table;
}
.ltx-table th,
.ltx-table td {
padding: 0.35em 0.7em;
vertical-align: top;
line-height: 1.4;
}
.ltx-table th {
font-weight: 600;
}
/* alignment */
.ltx-l { text-align: left; }
.ltx-c { text-align: center; }
.ltx-r { text-align: right; }
/* vertical rules (from | in the column spec) */
.ltx-bl { border-left: 1px solid currentColor; }
.ltx-br { border-right: 1px solid currentColor; }
/* horizontal rules: t = above the row, b = below.
1 = \hline / \midrule / \cline, 2 = booktabs \toprule / \bottomrule,
d = doubled rule (\hline\hline) */
.ltx-t1 { border-top: 1px solid currentColor; }
.ltx-b1 { border-bottom: 1px solid currentColor; }
.ltx-t2 { border-top: 1.6px solid currentColor; }
.ltx-b2 { border-bottom: 1.6px solid currentColor; }
.ltx-td { border-top: 3px double currentColor; }
.ltx-bd { border-bottom: 3px double currentColor; }
/* keep wide tables usable on narrow screens */
@media (max-width: 700px) {
.ltx-table { font-size: 0.9em; }
.ltx-table th, .ltx-table td { padding: 0.25em 0.45em; }
}
@@ -0,0 +1,100 @@
/* calc-notes — HTML layout for the calc / calc* environments */
.calc {
display: grid;
/* lhs | rhs | notes | equation number */
grid-template-columns: max-content max-content minmax(8rem, 1fr) auto;
column-gap: 0.35rem;
row-gap: 0.6rem;
align-items: baseline;
margin: 1rem 0 1.4rem;
/* allow horizontal scrolling for very wide equations, but never show a
vertical bar (Firefox computes phantom vertical overflow otherwise) */
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 0.4em; /* keep descenders clear of a horizontal bar */
}
.calc-row { display: contents; }
.calc-lhs { grid-column: 1; justify-self: end; }
.calc-rhs { grid-column: 2; justify-self: start; }
.calc-full { grid-column: 1 / 3; justify-self: start; }
/* ---- notes ------------------------------------------------------- */
.calc-notes {
grid-column: 3;
display: flex;
flex-wrap: wrap;
gap: 0.35rem 0.75rem;
align-items: baseline;
min-width: 0;
padding-left: 0.9rem;
}
.calc-note {
color: var(--calc-notecolor, #B45309);
font-size: 0.85em;
line-height: 1.35;
}
.calc-note > summary {
cursor: pointer;
list-style: none; /* remove the default triangle ... */
user-select: none;
opacity: 0.7;
font-style: italic;
}
.calc-note > summary::-webkit-details-marker { display: none; }
.calc-note > summary::before { content: "▸ "; font-style: normal; }
.calc-note[open] > summary::before { content: "▾ "; }
.calc-note > summary:hover { opacity: 1; }
.calc-note[open] {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 8%, transparent);
border-left: 2px solid var(--calc-notecolor, #B45309);
border-radius: 0.25rem;
padding: 0.15rem 0.45rem;
}
.calc-note-body { margin-top: 0.1rem; }
.calc-note-body p { margin: 0; }
/* \mnote: math note (no extra styling needed — body is typeset math) */
.calc-note-math .calc-note-body { padding: 0.1rem 0; }
/* ---- calc*: boxed final result ----------------------------------- */
.calc-box {
display: inline-block;
border: 1.5px solid currentColor;
border-radius: 0.3em;
padding: 0.3em 0.65em;
margin-top: 0.15em;
background: color-mix(in srgb, currentColor 4%, transparent);
}
/* ---- labelled blocks: equation number on the last line ----------- */
.calc-tag {
grid-column: 4;
justify-self: end;
padding-left: 1rem;
white-space: nowrap;
}
/* ---- printing: show notes unfolded, like the PDF ------------------ */
@media print {
.calc-note > summary { display: none; }
.calc-note[open] { background: none; border: none; padding: 0; }
}
/* small screens: notes drop under the equation line */
@media (max-width: 560px) {
.calc { grid-template-columns: max-content 1fr; }
.calc-notes { grid-column: 1 / 3; padding-left: 1.5rem; }
.calc-full { grid-column: 1 / 3; }
.calc-tag { grid-column: 1 / -1; }
}
@@ -0,0 +1,15 @@
// calc-notes — open every note before printing, restore afterwards
(function () {
window.addEventListener("beforeprint", function () {
document.querySelectorAll("details.calc-note").forEach(function (d) {
d.dataset.calcWasOpen = d.open ? "1" : "0";
d.open = true;
});
});
window.addEventListener("afterprint", function () {
document.querySelectorAll("details.calc-note").forEach(function (d) {
d.open = d.dataset.calcWasOpen === "1";
delete d.dataset.calcWasOpen;
});
});
})();
@@ -0,0 +1,180 @@
/* quiz — tick-box self-checks: options, per-option explanations, score bar
*
* The card borrows .exo's frame so a quiz and an exercise look related.
* Green and red are reserved for the verdict: nothing else on the page uses
* them, so a colour here always means "this answer was judged".
*/
.quiz {
--quiz-ok: #1a7f5a;
--quiz-bad: #a3324a;
--quiz-ink: #5a6879;
margin: 1.4rem 0;
padding: 0.7rem 1rem 0.85rem;
border: 1px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 35%, transparent);
border-left: 3px solid var(--calc-notecolor, #B45309);
border-radius: 0.35rem;
scroll-margin-top: 5rem;
}
/* keep wide content inside the card, as in .calc and .exo */
.quiz mjx-container[display="true"],
.quiz .katex-display {
max-width: 100%;
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 0.35em;
display: flex;
justify-content: center;
justify-content: safe center;
}
.quiz .math.display { display: block; max-width: 100%; }
.quiz :is(pre, table) { max-width: 100%; overflow-x: auto; }
.quiz img, .quiz svg { max-width: 100%; }
.quiz-head { margin: 0 0 0.45rem; }
.quiz-head strong { color: var(--calc-notecolor, #B45309); }
.quiz-tip {
margin: 0 0 0.7rem;
font-size: 0.82rem;
color: var(--quiz-ink);
}
/* ---- questions ------------------------------------------------------ */
.quiz-q + .quiz-q {
margin-top: 1.1rem;
padding-top: 0.9rem;
border-top: 1px dashed color-mix(in srgb, var(--calc-notecolor, #B45309) 30%, transparent);
}
.quiz-q-head { margin: 0 0 0.35rem; font-size: 0.9em; }
/* ---- options -------------------------------------------------------- */
.quiz-opts {
list-style: none;
margin: 0.55rem 0 0;
padding: 0;
}
.quiz-opt {
margin: 0;
padding: 0.22rem 0.4rem;
border-radius: 0.25rem;
border-left: 2px solid transparent;
}
.quiz-opt + .quiz-opt { margin-top: 0.15rem; }
/* the whole row is the click target, so a long formula is still easy to tick */
.quiz-label {
display: flex;
align-items: baseline;
gap: 0.55rem;
cursor: pointer;
}
.quiz-box {
flex: 0 0 auto;
width: 1rem;
height: 1rem;
margin: 0;
/* baseline-align the box with the first line of the option text */
transform: translateY(0.15rem);
accent-color: var(--calc-notecolor, #B45309);
cursor: pointer;
}
.quiz-opt-text { min-width: 0; }
.quiz-opt-text > :first-child { margin-top: 0; }
.quiz-opt-text > :last-child { margin-bottom: 0; }
/* judged options */
.quiz-opt.quiz-ok {
background: color-mix(in srgb, var(--quiz-ok) 8%, transparent);
border-left-color: var(--quiz-ok);
}
.quiz-opt.quiz-bad {
background: color-mix(in srgb, var(--quiz-bad) 8%, transparent);
border-left-color: var(--quiz-bad);
}
/* ---- explanations --------------------------------------------------- */
.quiz-why {
margin: 0.35rem 0 0.15rem 1.55rem;
padding: 0.3rem 0 0.3rem 0.7rem;
border-left: 2px solid var(--quiz-bad);
font-size: 0.88rem;
}
.quiz-why > :first-child { margin-top: 0; }
.quiz-why > :last-child { margin-bottom: 0; }
.quiz-why-q {
margin-left: 0;
margin-top: 0.5rem;
}
/* ---- verdict and bar ------------------------------------------------ */
.quiz-verdict {
margin: 0.5rem 0 0;
font-size: 0.85rem;
font-weight: 600;
}
.quiz-verdict.quiz-ok { color: var(--quiz-ok); }
.quiz-verdict.quiz-bad { color: var(--quiz-bad); }
.quiz-bar {
display: flex;
align-items: center;
gap: 0.6rem;
flex-wrap: wrap;
margin-top: 1rem;
padding-top: 0.7rem;
border-top: 1px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 25%, transparent);
}
.quiz-bar button {
font: inherit;
font-size: 0.84rem;
padding: 0.2rem 0.85rem;
cursor: pointer;
border: 1px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 45%, transparent);
border-radius: 999px;
background: transparent;
color: var(--calc-notecolor, #B45309);
}
.quiz-bar button:hover {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 10%, transparent);
}
.quiz-bar button.quiz-reset {
border-color: color-mix(in srgb, var(--quiz-ink) 40%, transparent);
color: var(--quiz-ink);
}
.quiz-bar button.quiz-reset:hover {
background: color-mix(in srgb, var(--quiz-ink) 10%, transparent);
}
.quiz-score {
font-size: 0.84rem;
color: var(--quiz-ink);
}
.quiz-score b { color: var(--calc-notecolor, #B45309); font-weight: 600; }
/* ---- dark theme ----------------------------------------------------- */
@media (prefers-color-scheme: dark) {
.quiz {
--quiz-ok: #4cb08a;
--quiz-bad: #e2798f;
--quiz-ink: #8b98a8;
}
}
/* ---- print ----------------------------------------------------------
* Printing the HTML is a fallback (the pdf format is the real print path).
* A printed quiz is one to fill in with a pen: the bar goes, the boxes stay
* empty, and anything already revealed on screen is kept so a checked quiz
* prints as it looks.
*/
@media print {
.quiz-bar { display: none; }
.quiz-opt.quiz-ok, .quiz-opt.quiz-bad { background: none; }
}
@@ -0,0 +1,126 @@
// quiz — judge the tick boxes of one quiz, explain what went wrong
//
// Every label the reader sees is written into the markup by quiz.lua, so the
// wording follows the book's language and nothing is translated twice. A
// quiz carries:
// data-quiz-score "{n} of {m} questions correct" ({n}/{m} substituted)
// data-quiz-right verdict of a question answered correctly
// data-quiz-wrong verdict of a question answered wrongly
//
// A question is right only when every one of its options is in the right
// state: ticked when true, left empty when false. That is the "multiple
// true/false" rule of the exam, and it is why a half-ticked question counts
// as wrong.
(function () {
"use strict";
function options(quiz) {
return quiz.querySelectorAll(".quiz-opt");
}
function judge(quiz) {
var questions = quiz.querySelectorAll(".quiz-q");
var right = 0;
questions.forEach(function (q) {
var ok = true;
q.querySelectorAll(".quiz-opt").forEach(function (opt) {
var box = opt.querySelector(".quiz-box");
if (!box) return;
var want = opt.dataset.correct === "1";
var hit = box.checked === want;
opt.classList.toggle("quiz-ok", hit);
opt.classList.toggle("quiz-bad", !hit);
// the explanation of an option is for the reader who got it wrong
var why = opt.querySelector(".quiz-why");
if (why) why.hidden = hit;
if (!hit) ok = false;
});
var verdict = q.querySelector(".quiz-verdict");
if (verdict) {
verdict.hidden = false;
verdict.textContent = ok
? (quiz.dataset.quizRight || "Correct")
: (quiz.dataset.quizWrong || "Not quite");
verdict.classList.toggle("quiz-ok", ok);
verdict.classList.toggle("quiz-bad", !ok);
}
// a question-level explanation backs up a wrong answer as a whole
var qwhy = q.querySelector(".quiz-why-q");
if (qwhy) qwhy.hidden = ok;
if (ok) right++;
});
var score = quiz.querySelector(".quiz-score");
if (score) {
var template = quiz.dataset.quizScore || "{n}/{m}";
score.innerHTML = "";
// built as nodes, not markup: the template comes from metadata
var parts = template.split(/\{n\}|\{m\}/);
var values = [];
(template.match(/\{n\}|\{m\}/g) || []).forEach(function (token) {
values.push(token === "{n}" ? right : questions.length);
});
parts.forEach(function (text, i) {
score.appendChild(document.createTextNode(text));
if (i < values.length) {
var b = document.createElement("b");
b.textContent = String(values[i]);
score.appendChild(b);
}
});
}
}
function reset(quiz) {
options(quiz).forEach(function (opt) {
var box = opt.querySelector(".quiz-box");
if (box) box.checked = false;
opt.classList.remove("quiz-ok", "quiz-bad");
var why = opt.querySelector(".quiz-why");
if (why) why.hidden = true;
});
quiz.querySelectorAll(".quiz-verdict").forEach(function (v) {
v.hidden = true;
v.textContent = "";
v.classList.remove("quiz-ok", "quiz-bad");
});
quiz.querySelectorAll(".quiz-why-q").forEach(function (w) { w.hidden = true; });
var score = quiz.querySelector(".quiz-score");
if (score) score.textContent = "";
}
document.addEventListener("click", function (event) {
var target = event.target;
if (!target.closest) return;
var check = target.closest(".quiz .quiz-check");
if (check) {
judge(check.closest(".quiz"));
return;
}
var again = target.closest(".quiz .quiz-reset");
if (again) {
reset(again.closest(".quiz"));
}
});
// re-ticking a box after checking clears that row's verdict, so a stale
// green or red never sits next to a box the reader has just changed
document.addEventListener("change", function (event) {
var box = event.target;
if (!box.closest || !box.classList || !box.classList.contains("quiz-box")) return;
var opt = box.closest(".quiz-opt");
if (!opt) return;
opt.classList.remove("quiz-ok", "quiz-bad");
var why = opt.querySelector(".quiz-why");
if (why) why.hidden = true;
});
})();
+9
View File
@@ -0,0 +1,9 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
//
// AnchorJS - v5.0.0 - 2023-01-18
// https://www.bryanbraun.com/anchorjs/
// Copyright (c) 2023 Bryan Braun; Licensed MIT
//
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
!function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(globalThis,function(){"use strict";return function(A){function u(A){A.icon=Object.prototype.hasOwnProperty.call(A,"icon")?A.icon:"",A.visible=Object.prototype.hasOwnProperty.call(A,"visible")?A.visible:"hover",A.placement=Object.prototype.hasOwnProperty.call(A,"placement")?A.placement:"right",A.ariaLabel=Object.prototype.hasOwnProperty.call(A,"ariaLabel")?A.ariaLabel:"Anchor",A.class=Object.prototype.hasOwnProperty.call(A,"class")?A.class:"",A.base=Object.prototype.hasOwnProperty.call(A,"base")?A.base:"",A.truncate=Object.prototype.hasOwnProperty.call(A,"truncate")?Math.floor(A.truncate):64,A.titleText=Object.prototype.hasOwnProperty.call(A,"titleText")?A.titleText:""}function d(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new TypeError("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],u(this.options),this.add=function(A){var e,t,o,i,n,s,a,r,l,c,h,p=[];if(u(this.options),0!==(e=d(A=A||"h2, h3, h4, h5, h6")).length){for(null===document.head.querySelector("style.anchorjs")&&((A=document.createElement("style")).className="anchorjs",A.appendChild(document.createTextNode("")),void 0===(h=document.head.querySelector('[rel="stylesheet"],style'))?document.head.appendChild(A):document.head.insertBefore(A,h),A.sheet.insertRule(".anchorjs-link{opacity:0;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}",A.sheet.cssRules.length),A.sheet.insertRule(":hover>.anchorjs-link,.anchorjs-link:focus{opacity:1}",A.sheet.cssRules.length),A.sheet.insertRule("[data-anchorjs-icon]::after{content:attr(data-anchorjs-icon)}",A.sheet.cssRules.length),A.sheet.insertRule('@font-face{font-family:anchorjs-icons;src:url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype")}',A.sheet.cssRules.length)),h=document.querySelectorAll("[id]"),t=[].map.call(h,function(A){return A.id}),i=0;i<e.length;i++)if(this.hasAnchorJSLink(e[i]))p.push(i);else{if(e[i].hasAttribute("id"))o=e[i].getAttribute("id");else if(e[i].hasAttribute("data-anchor-id"))o=e[i].getAttribute("data-anchor-id");else{for(r=a=this.urlify(e[i].textContent),s=0;n=t.indexOf(r=void 0!==n?a+"-"+s:r),s+=1,-1!==n;);n=void 0,t.push(r),e[i].setAttribute("id",r),o=r}(l=document.createElement("a")).className="anchorjs-link "+this.options.class,l.setAttribute("aria-label",this.options.ariaLabel),l.setAttribute("data-anchorjs-icon",this.options.icon),this.options.titleText&&(l.title=this.options.titleText),c=document.querySelector("base")?window.location.pathname+window.location.search:"",c=this.options.base||c,l.href=c+"#"+o,"always"===this.options.visible&&(l.style.opacity="1"),""===this.options.icon&&(l.style.font="1em/1 anchorjs-icons","left"===this.options.placement)&&(l.style.lineHeight="inherit"),"left"===this.options.placement?(l.style.position="absolute",l.style.marginLeft="-1.25em",l.style.paddingRight=".25em",l.style.paddingLeft=".25em",e[i].insertBefore(l,e[i].firstChild)):(l.style.marginLeft=".1875em",l.style.paddingRight=".1875em",l.style.paddingLeft=".1875em",e[i].appendChild(l))}for(i=0;i<p.length;i++)e.splice(p[i]-i,1);this.elements=this.elements.concat(e)}return this},this.remove=function(A){for(var e,t,o=d(A),i=0;i<o.length;i++)(t=o[i].querySelector(".anchorjs-link"))&&(-1!==(e=this.elements.indexOf(o[i]))&&this.elements.splice(e,1),o[i].removeChild(t));return this},this.removeAll=function(){thisLine truncated
// @license-end
+6
View File
@@ -0,0 +1,6 @@
/**
* @popperjs/core v2.11.7 - MIT License
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,(function(e){"use strict";function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function n(e){return e instanceof t(e).Element||e instanceof Element}function r(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}var i=Math.max,a=Math.min,s=Math.round;function f(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function c(){return!/^((?!chrome|android).)*safari/i.test(f())}function p(e,o,i){void 0===o&&(o=!1),void 0===i&&(i=!1);var a=e.getBoundingClientRect(),f=1,p=1;o&&r(e)&&(f=e.offsetWidth>0&&s(a.width)/e.offsetWidth||1,p=e.offsetHeight>0&&s(a.height)/e.offsetHeight||1);var u=(n(e)?t(e):window).visualViewport,l=!c()&&i,d=(a.left+(l&&u?u.offsetLeft:0))/f,h=(a.top+(l&&u?u.offsetTop:0))/p,m=a.width/f,v=a.height/p;return{width:m,height:v,top:h,right:d+m,bottom:h+v,left:d,x:d,y:h}}function u(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function l(e){return e?(e.nodeName||"").toLowerCase():null}function d(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function h(e){return p(d(e)).left+u(e).scrollLeft}function m(e){return t(e).getComputedStyle(e)}function v(e){var t=m(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function y(e,n,o){void 0===o&&(o=!1);var i,a,f=r(n),c=r(n)&&function(e){var t=e.getBoundingClientRect(),n=s(t.width)/e.offsetWidth||1,r=s(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(n),m=d(n),y=p(e,c,o),g={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(f||!f&&!o)&&(("body"!==l(n)||v(m))&&(g=(i=n)!==t(i)&&r(i)?{scrollLeft:(a=i).scrollLeft,scrollTop:a.scrollTop}:u(i)),r(n)?((b=p(n,!0)).x+=n.clientLeft,b.y+=n.clientTop):m&&(b.x=h(m))),{x:y.left+g.scrollLeft-b.x,y:y.top+g.scrollTop-b.y,width:y.width,height:y.height}}function g(e){var t=p(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function b(e){return"html"===l(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||d(e)}function x(e){return["html","body","#document"].indexOf(l(e))>=0?e.ownerDocument.body:r(e)&&v(e)?e:x(b(e))}function w(e,n){var r;void 0===n&&(n=[]);var o=x(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=t(o),s=i?[a].concat(a.visualViewport||[],v(o)?o:[]):o,f=n.concat(s);return i?f:f.concat(w(b(s)))}function O(e){return["table","td","th"].indexOf(l(e))>=0}function j(e){return r(e)&&"fixed"!==m(e).position?e.offsetParent:null}function E(e){for(var n=t(e),i=j(e);i&&O(i)&&"static"===m(i).position;)i=j(i);return i&&("html"===l(i)||"body"===l(i)&&"static"===m(i).position)?n:i||function(e){var t=/firefox/i.test(f());if(/Trident/i.test(f())&&r(e)&&"fixed"===m(e).position)return null;var n=b(e);for(o(n)&&(n=n.host);r(n)&&["html","body"].indexOf(l(n))<0;){var i=m(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||n}var D="top",A="bottom",L="right",P="left",M="auto",k=[D,A,L,P],W="start",B="end",H="viewport",T="popper",R=k.reduce((function(e,t){return e.concat([t+"-"+W,t+"-"+B])}),[]),S=[].concat(k,[M]).reduce((function(e,t){return e.concat([t,t+"-"+W,t+"-"+B])}),[]),V=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function q(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function C(e){return e.split("-")[0]}function N(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function I(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function _(e,r,o){return r===H?I(function(e,n){var r=t(e),o=d(e),i=r.visualViewport,a=o.clientWidth,s=o.clientHeight,f=0,p=0;if(i){a=i.width,s=i.height;var u=c();(u||!u&&"fixed"===n)&&(f=i.offsetLeft,p=i.offsetTop)}return{width:a,height:s,x:f+h(e),y:p}}(e,o)):n(r)?function(e,t){var n=p(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.lLine truncated
@@ -0,0 +1,236 @@
/* quarto syntax highlight colors */
:root {
--quarto-hl-ot-color: #003B4F;
--quarto-hl-at-color: #657422;
--quarto-hl-ss-color: #20794D;
--quarto-hl-an-color: #5E5E5E;
--quarto-hl-fu-color: #4758AB;
--quarto-hl-st-color: #20794D;
--quarto-hl-cf-color: #003B4F;
--quarto-hl-op-color: #5E5E5E;
--quarto-hl-er-color: #AD0000;
--quarto-hl-bn-color: #AD0000;
--quarto-hl-al-color: #AD0000;
--quarto-hl-va-color: #111111;
--quarto-hl-bu-color: inherit;
--quarto-hl-ex-color: inherit;
--quarto-hl-pp-color: #AD0000;
--quarto-hl-in-color: #5E5E5E;
--quarto-hl-vs-color: #20794D;
--quarto-hl-wa-color: #5E5E5E;
--quarto-hl-do-color: #5E5E5E;
--quarto-hl-im-color: #00769E;
--quarto-hl-ch-color: #20794D;
--quarto-hl-dt-color: #AD0000;
--quarto-hl-fl-color: #AD0000;
--quarto-hl-co-color: #5E5E5E;
--quarto-hl-cv-color: #5E5E5E;
--quarto-hl-cn-color: #8f5902;
--quarto-hl-sc-color: #5E5E5E;
--quarto-hl-dv-color: #AD0000;
--quarto-hl-kw-color: #003B4F;
}
/* other quarto variables */
:root {
--quarto-font-monospace: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
/* syntax highlight based on Pandoc's rules */
pre > code.sourceCode > span {
color: #003B4F;
}
code.sourceCode > span {
color: #003B4F;
}
div.sourceCode,
div.sourceCode pre.sourceCode {
color: #003B4F;
}
/* Normal */
code span {
color: #003B4F;
}
/* Alert */
code span.al {
color: #AD0000;
font-style: inherit;
}
/* Annotation */
code span.an {
color: #5E5E5E;
font-style: inherit;
}
/* Attribute */
code span.at {
color: #657422;
font-style: inherit;
}
/* BaseN */
code span.bn {
color: #AD0000;
font-style: inherit;
}
/* BuiltIn */
code span.bu {
font-style: inherit;
}
/* ControlFlow */
code span.cf {
color: #003B4F;
font-weight: bold;
font-style: inherit;
}
/* Char */
code span.ch {
color: #20794D;
font-style: inherit;
}
/* Constant */
code span.cn {
color: #8f5902;
font-style: inherit;
}
/* Comment */
code span.co {
color: #5E5E5E;
font-style: inherit;
}
/* CommentVar */
code span.cv {
color: #5E5E5E;
font-style: italic;
}
/* Documentation */
code span.do {
color: #5E5E5E;
font-style: italic;
}
/* DataType */
code span.dt {
color: #AD0000;
font-style: inherit;
}
/* DecVal */
code span.dv {
color: #AD0000;
font-style: inherit;
}
/* Error */
code span.er {
color: #AD0000;
font-style: inherit;
}
/* Extension */
code span.ex {
font-style: inherit;
}
/* Float */
code span.fl {
color: #AD0000;
font-style: inherit;
}
/* Function */
code span.fu {
color: #4758AB;
font-style: inherit;
}
/* Import */
code span.im {
color: #00769E;
font-style: inherit;
}
/* Information */
code span.in {
color: #5E5E5E;
font-style: inherit;
}
/* Keyword */
code span.kw {
color: #003B4F;
font-weight: bold;
font-style: inherit;
}
/* Operator */
code span.op {
color: #5E5E5E;
font-style: inherit;
}
/* Other */
code span.ot {
color: #003B4F;
font-style: inherit;
}
/* Preprocessor */
code span.pp {
color: #AD0000;
font-style: inherit;
}
/* SpecialChar */
code span.sc {
color: #5E5E5E;
font-style: inherit;
}
/* SpecialString */
code span.ss {
color: #20794D;
font-style: inherit;
}
/* String */
code span.st {
color: #20794D;
font-style: inherit;
}
/* Variable */
code span.va {
color: #111111;
font-style: inherit;
}
/* VerbatimString */
code span.vs {
color: #20794D;
font-style: inherit;
}
/* Warning */
code span.wa {
color: #5E5E5E;
font-style: italic;
}
.prevent-inlining {
content: "</";
}
/*# sourceMappingURL=39d13593ecb7db6d02e40e1582482a0e.css.map */
+845
View File
@@ -0,0 +1,845 @@
import * as tabsets from "./tabsets/tabsets.js";
const sectionChanged = new CustomEvent("quarto-sectionChanged", {
detail: {},
bubbles: true,
cancelable: false,
composed: false,
});
const layoutMarginEls = () => {
// Find any conflicting margin elements and add margins to the
// top to prevent overlap
const marginChildren = window.document.querySelectorAll(
".column-margin.column-container > *, .margin-caption, .aside"
);
let lastBottom = 0;
for (const marginChild of marginChildren) {
if (marginChild.offsetParent !== null) {
// clear the top margin so we recompute it
marginChild.style.marginTop = null;
const top = marginChild.getBoundingClientRect().top + window.scrollY;
if (top < lastBottom) {
const marginChildStyle = window.getComputedStyle(marginChild);
const marginBottom = parseFloat(marginChildStyle["marginBottom"]);
const margin = lastBottom - top + marginBottom;
marginChild.style.marginTop = `${margin}px`;
}
const styles = window.getComputedStyle(marginChild);
const marginTop = parseFloat(styles["marginTop"]);
lastBottom = top + marginChild.getBoundingClientRect().height + marginTop;
}
}
};
window.document.addEventListener("DOMContentLoaded", function (_event) {
// Recompute the position of margin elements anytime the body size changes
if (window.ResizeObserver) {
const resizeObserver = new window.ResizeObserver(
throttle(() => {
layoutMarginEls();
if (
window.document.body.getBoundingClientRect().width < 990 &&
isReaderMode()
) {
quartoToggleReader();
}
}, 50)
);
resizeObserver.observe(window.document.body);
}
const tocEl = window.document.querySelector('nav.toc-active[role="doc-toc"]');
const sidebarEl = window.document.getElementById("quarto-sidebar");
const leftTocEl = window.document.getElementById("quarto-sidebar-toc-left");
const marginSidebarEl = window.document.getElementById(
"quarto-margin-sidebar"
);
// function to determine whether the element has a previous sibling that is active
const prevSiblingIsActiveLink = (el) => {
const sibling = el.previousElementSibling;
if (sibling && sibling.tagName === "A") {
return sibling.classList.contains("active");
} else {
return false;
}
};
// dispatch for htmlwidgets
// they use slideenter event to trigger resize
function fireSlideEnter() {
const event = window.document.createEvent("Event");
event.initEvent("slideenter", true, true);
window.document.dispatchEvent(event);
}
const tabs = window.document.querySelectorAll('a[data-bs-toggle="tab"]');
tabs.forEach((tab) => {
tab.addEventListener("shown.bs.tab", fireSlideEnter);
});
// dispatch for shiny
// they use BS shown and hidden events to trigger rendering
function distpatchShinyEvents(previous, current) {
if (window.jQuery) {
if (previous) {
window.jQuery(previous).trigger("hidden");
}
if (current) {
window.jQuery(current).trigger("shown");
}
}
}
// tabby.js listener: Trigger event for htmlwidget and shiny
document.addEventListener(
"tabby",
function (event) {
fireSlideEnter();
distpatchShinyEvents(event.detail.previousTab, event.detail.tab);
},
false
);
// Track scrolling and mark TOC links as active
// get table of contents and sidebar (bail if we don't have at least one)
const tocLinks = tocEl
? [...tocEl.querySelectorAll("a[data-scroll-target]")]
: [];
const makeActive = (link) => tocLinks[link].classList.add("active");
const removeActive = (link) => tocLinks[link].classList.remove("active");
const removeAllActive = () =>
[...Array(tocLinks.length).keys()].forEach((link) => removeActive(link));
// activate the anchor for a section associated with this TOC entry
tocLinks.forEach((link) => {
link.addEventListener("click", () => {
if (link.href.indexOf("#") !== -1) {
const anchor = link.href.split("#")[1];
const heading = window.document.querySelector(
`[data-anchor-id="${anchor}"]`
);
if (heading) {
// Add the class
heading.classList.add("reveal-anchorjs-link");
// function to show the anchor
const handleMouseout = () => {
heading.classList.remove("reveal-anchorjs-link");
heading.removeEventListener("mouseout", handleMouseout);
};
// add a function to clear the anchor when the user mouses out of it
heading.addEventListener("mouseout", handleMouseout);
}
}
});
});
const sections = tocLinks.map((link) => {
const target = link.getAttribute("data-scroll-target");
if (target.startsWith("#")) {
return window.document.getElementById(decodeURI(`${target.slice(1)}`));
} else {
return window.document.querySelector(decodeURI(`${target}`));
}
});
const sectionMargin = 200;
let currentActive = 0;
// track whether we've initialized state the first time
let init = false;
const updateActiveLink = () => {
// The index from bottom to top (e.g. reversed list)
let sectionIndex = -1;
if (
window.innerHeight + window.pageYOffset >=
window.document.body.offsetHeight
) {
// This is the no-scroll case where last section should be the active one
sectionIndex = 0;
} else {
// This finds the last section visible on screen that should be made active
sectionIndex = [...sections].reverse().findIndex((section) => {
if (section) {
return window.pageYOffset >= section.offsetTop - sectionMargin;
} else {
return false;
}
});
}
if (sectionIndex > -1) {
const current = sections.length - sectionIndex - 1;
if (current !== currentActive) {
removeAllActive();
currentActive = current;
makeActive(current);
if (init) {
window.dispatchEvent(sectionChanged);
}
init = true;
}
}
};
const inHiddenRegion = (top, bottom, hiddenRegions) => {
for (const region of hiddenRegions) {
if (top <= region.bottom && bottom >= region.top) {
return true;
}
}
return false;
};
const categorySelector = "header.quarto-title-block .quarto-category";
const activateCategories = (href) => {
// Find any categories
// Surround them with a link pointing back to:
// #category=Authoring
try {
const categoryEls = window.document.querySelectorAll(categorySelector);
for (const categoryEl of categoryEls) {
const categoryText = categoryEl.textContent;
if (categoryText) {
const link = `${href}#category=${encodeURIComponent(categoryText)}`;
const linkEl = window.document.createElement("a");
linkEl.setAttribute("href", link);
for (const child of categoryEl.childNodes) {
linkEl.append(child);
}
categoryEl.appendChild(linkEl);
}
}
} catch {
// Ignore errors
}
};
function hasTitleCategories() {
return window.document.querySelector(categorySelector) !== null;
}
function offsetRelativeUrl(url) {
const offset = getMeta("quarto:offset");
return offset ? offset + url : url;
}
function offsetAbsoluteUrl(url) {
const offset = getMeta("quarto:offset");
const baseUrl = new URL(offset, window.location);
const projRelativeUrl = url.replace(baseUrl, "");
if (projRelativeUrl.startsWith("/")) {
return projRelativeUrl;
} else {
return "/" + projRelativeUrl;
}
}
// read a meta tag value
function getMeta(metaName) {
const metas = window.document.getElementsByTagName("meta");
for (let i = 0; i < metas.length; i++) {
if (metas[i].getAttribute("name") === metaName) {
return metas[i].getAttribute("content");
}
}
return "";
}
async function findAndActivateCategories() {
// Categories search with listing only use path without query
const currentPagePath = offsetAbsoluteUrl(
window.location.origin + window.location.pathname
);
const response = await fetch(offsetRelativeUrl("listings.json"));
if (response.status == 200) {
return response.json().then(function (listingPaths) {
const listingHrefs = [];
for (const listingPath of listingPaths) {
const pathWithoutLeadingSlash = listingPath.listing.substring(1);
for (const item of listingPath.items) {
const encodedItem = encodeURI(item);
if (
encodedItem === currentPagePath ||
encodedItem === currentPagePath + "index.html"
) {
// Resolve this path against the offset to be sure
// we already are using the correct path to the listing
// (this adjusts the listing urls to be rooted against
// whatever root the page is actually running against)
const relative = offsetRelativeUrl(pathWithoutLeadingSlash);
const baseUrl = window.location;
const resolvedPath = new URL(relative, baseUrl);
listingHrefs.push(resolvedPath.pathname);
break;
}
}
}
// Look up the tree for a nearby linting and use that if we find one
const nearestListing = findNearestParentListing(
offsetAbsoluteUrl(window.location.pathname),
listingHrefs
);
if (nearestListing) {
activateCategories(nearestListing);
} else {
// See if the referrer is a listing page for this item
const referredRelativePath = offsetAbsoluteUrl(document.referrer);
const referrerListing = listingHrefs.find((listingHref) => {
const isListingReferrer =
listingHref === referredRelativePath ||
listingHref === referredRelativePath + "index.html";
return isListingReferrer;
});
if (referrerListing) {
// Try to use the referrer if possible
activateCategories(referrerListing);
} else if (listingHrefs.length > 0) {
// Otherwise, just fall back to the first listing
activateCategories(listingHrefs[0]);
}
}
});
}
}
if (hasTitleCategories()) {
findAndActivateCategories();
}
const findNearestParentListing = (href, listingHrefs) => {
if (!href || !listingHrefs) {
return undefined;
}
// Look up the tree for a nearby linting and use that if we find one
const relativeParts = href.substring(1).split("/");
while (relativeParts.length > 0) {
const path = relativeParts.join("/");
for (const listingHref of listingHrefs) {
if (listingHref.startsWith(path)) {
return listingHref;
}
}
relativeParts.pop();
}
return undefined;
};
const manageSidebarVisiblity = (el, placeholderDescriptor) => {
let isVisible = true;
let elRect;
return (hiddenRegions) => {
if (el === null) {
return;
}
// Find the last element of the TOC
const lastChildEl = el.lastElementChild;
if (lastChildEl) {
// Converts the sidebar to a menu
const convertToMenu = () => {
for (const child of el.children) {
child.style.opacity = 0;
child.style.overflow = "hidden";
child.style.pointerEvents = "none";
}
nexttick(() => {
const toggleContainer = window.document.createElement("div");
toggleContainer.style.width = "100%";
toggleContainer.classList.add("zindex-over-content");
toggleContainer.classList.add("quarto-sidebar-toggle");
toggleContainer.classList.add("headroom-target"); // Marks this to be managed by headeroom
toggleContainer.id = placeholderDescriptor.id;
toggleContainer.style.position = "fixed";
const toggleIcon = window.document.createElement("i");
toggleIcon.classList.add("quarto-sidebar-toggle-icon");
toggleIcon.classList.add("bi");
toggleIcon.classList.add("bi-caret-down-fill");
const toggleTitle = window.document.createElement("div");
const titleEl = window.document.body.querySelector(
placeholderDescriptor.titleSelector
);
if (titleEl) {
toggleTitle.append(
titleEl.textContent || titleEl.innerText,
toggleIcon
);
}
toggleTitle.classList.add("zindex-over-content");
toggleTitle.classList.add("quarto-sidebar-toggle-title");
toggleContainer.append(toggleTitle);
const toggleContents = window.document.createElement("div");
toggleContents.classList = el.classList;
toggleContents.classList.add("zindex-over-content");
toggleContents.classList.add("quarto-sidebar-toggle-contents");
for (const child of el.children) {
if (child.id === "toc-title") {
continue;
}
const clone = child.cloneNode(true);
clone.style.opacity = 1;
clone.style.pointerEvents = null;
clone.style.display = null;
toggleContents.append(clone);
}
toggleContents.style.height = "0px";
const positionToggle = () => {
// position the element (top left of parent, same width as parent)
if (!elRect) {
elRect = el.getBoundingClientRect();
}
toggleContainer.style.left = `${elRect.left}px`;
toggleContainer.style.top = `${elRect.top}px`;
toggleContainer.style.width = `${elRect.width}px`;
};
positionToggle();
toggleContainer.append(toggleContents);
el.parentElement.prepend(toggleContainer);
// Process clicks
let tocShowing = false;
// Allow the caller to control whether this is dismissed
// when it is clicked (e.g. sidebar navigation supports
// opening and closing the nav tree, so don't dismiss on click)
const clickEl = placeholderDescriptor.dismissOnClick
? toggleContainer
: toggleTitle;
const closeToggle = () => {
if (tocShowing) {
toggleContainer.classList.remove("expanded");
toggleContents.style.height = "0px";
tocShowing = false;
}
};
// Get rid of any expanded toggle if the user scrolls
window.document.addEventListener(
"scroll",
throttle(() => {
closeToggle();
}, 50)
);
// Handle positioning of the toggle
window.addEventListener(
"resize",
throttle(() => {
elRect = undefined;
positionToggle();
}, 50)
);
window.addEventListener("quarto-hrChanged", () => {
elRect = undefined;
});
// Process the click
clickEl.onclick = () => {
if (!tocShowing) {
toggleContainer.classList.add("expanded");
toggleContents.style.height = null;
tocShowing = true;
} else {
closeToggle();
}
};
});
};
// Converts a sidebar from a menu back to a sidebar
const convertToSidebar = () => {
for (const child of el.children) {
child.style.opacity = 1;
child.style.overflow = null;
child.style.pointerEvents = null;
}
const placeholderEl = window.document.getElementById(
placeholderDescriptor.id
);
if (placeholderEl) {
placeholderEl.remove();
}
el.classList.remove("rollup");
};
if (isReaderMode()) {
convertToMenu();
isVisible = false;
} else {
// Find the top and bottom o the element that is being managed
const elTop = el.offsetTop;
const elBottom =
elTop + lastChildEl.offsetTop + lastChildEl.offsetHeight;
if (!isVisible) {
// If the element is current not visible reveal if there are
// no conflicts with overlay regions
if (!inHiddenRegion(elTop, elBottom, hiddenRegions)) {
convertToSidebar();
isVisible = true;
}
} else {
// If the element is visible, hide it if it conflicts with overlay regions
// and insert a placeholder toggle (or if we're in reader mode)
if (inHiddenRegion(elTop, elBottom, hiddenRegions)) {
convertToMenu();
isVisible = false;
}
}
}
}
};
};
const tabEls = document.querySelectorAll('a[data-bs-toggle="tab"]');
for (const tabEl of tabEls) {
const id = tabEl.getAttribute("data-bs-target");
if (id) {
const columnEl = document.querySelector(
`${id} .column-margin, .tabset-margin-content`
);
if (columnEl)
tabEl.addEventListener("shown.bs.tab", function (event) {
const el = event.srcElement;
if (el) {
const visibleCls = `${el.id}-margin-content`;
// walk up until we find a parent tabset
let panelTabsetEl = el.parentElement;
while (panelTabsetEl) {
if (panelTabsetEl.classList.contains("panel-tabset")) {
break;
}
panelTabsetEl = panelTabsetEl.parentElement;
}
if (panelTabsetEl) {
const prevSib = panelTabsetEl.previousElementSibling;
if (
prevSib &&
prevSib.classList.contains("tabset-margin-container")
) {
const childNodes = prevSib.querySelectorAll(
".tabset-margin-content"
);
for (const childEl of childNodes) {
if (childEl.classList.contains(visibleCls)) {
childEl.classList.remove("collapse");
} else {
childEl.classList.add("collapse");
}
}
}
}
}
layoutMarginEls();
});
}
}
// Manage the visibility of the toc and the sidebar
const marginScrollVisibility = manageSidebarVisiblity(marginSidebarEl, {
id: "quarto-toc-toggle",
titleSelector: "#toc-title",
dismissOnClick: true,
});
const sidebarScrollVisiblity = manageSidebarVisiblity(sidebarEl, {
id: "quarto-sidebarnav-toggle",
titleSelector: ".title",
dismissOnClick: false,
});
let tocLeftScrollVisibility;
if (leftTocEl) {
tocLeftScrollVisibility = manageSidebarVisiblity(leftTocEl, {
id: "quarto-lefttoc-toggle",
titleSelector: "#toc-title",
dismissOnClick: true,
});
}
// Find the first element that uses formatting in special columns
const conflictingEls = window.document.body.querySelectorAll(
'[class^="column-"], [class*=" column-"], aside, [class*="margin-caption"], [class*=" margin-caption"], [class*="margin-ref"], [class*=" margin-ref"]'
);
// Filter all the possibly conflicting elements into ones
// the do conflict on the left or ride side
const arrConflictingEls = Array.from(conflictingEls);
const leftSideConflictEls = arrConflictingEls.filter((el) => {
if (el.tagName === "ASIDE") {
return false;
}
return Array.from(el.classList).find((className) => {
return (
className !== "column-body" &&
className.startsWith("column-") &&
!className.endsWith("right") &&
!className.endsWith("container") &&
className !== "column-margin"
);
});
});
const rightSideConflictEls = arrConflictingEls.filter((el) => {
if (el.tagName === "ASIDE") {
return true;
}
const hasMarginCaption = Array.from(el.classList).find((className) => {
return className == "margin-caption";
});
if (hasMarginCaption) {
return true;
}
return Array.from(el.classList).find((className) => {
return (
className !== "column-body" &&
!className.endsWith("container") &&
className.startsWith("column-") &&
!className.endsWith("left")
);
});
});
const kOverlapPaddingSize = 10;
function toRegions(els) {
return els.map((el) => {
const boundRect = el.getBoundingClientRect();
const top =
boundRect.top +
document.documentElement.scrollTop -
kOverlapPaddingSize;
return {
top,
bottom: top + el.scrollHeight + 2 * kOverlapPaddingSize,
};
});
}
let hasObserved = false;
const visibleItemObserver = (els) => {
let visibleElements = [...els];
const intersectionObserver = new IntersectionObserver(
(entries, _observer) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
if (visibleElements.indexOf(entry.target) === -1) {
visibleElements.push(entry.target);
}
} else {
visibleElements = visibleElements.filter((visibleEntry) => {
return visibleEntry !== entry;
});
}
});
if (!hasObserved) {
hideOverlappedSidebars();
}
hasObserved = true;
},
{}
);
els.forEach((el) => {
intersectionObserver.observe(el);
});
return {
getVisibleEntries: () => {
return visibleElements;
},
};
};
const rightElementObserver = visibleItemObserver(rightSideConflictEls);
const leftElementObserver = visibleItemObserver(leftSideConflictEls);
const hideOverlappedSidebars = () => {
marginScrollVisibility(toRegions(rightElementObserver.getVisibleEntries()));
sidebarScrollVisiblity(toRegions(leftElementObserver.getVisibleEntries()));
if (tocLeftScrollVisibility) {
tocLeftScrollVisibility(
toRegions(leftElementObserver.getVisibleEntries())
);
}
};
window.quartoToggleReader = () => {
// Applies a slow class (or removes it)
// to update the transition speed
const slowTransition = (slow) => {
const manageTransition = (id, slow) => {
const el = document.getElementById(id);
if (el) {
if (slow) {
el.classList.add("slow");
} else {
el.classList.remove("slow");
}
}
};
manageTransition("TOC", slow);
manageTransition("quarto-sidebar", slow);
};
const readerMode = !isReaderMode();
setReaderModeValue(readerMode);
// If we're entering reader mode, slow the transition
if (readerMode) {
slowTransition(readerMode);
}
highlightReaderToggle(readerMode);
hideOverlappedSidebars();
// If we're exiting reader mode, restore the non-slow transition
if (!readerMode) {
slowTransition(!readerMode);
}
};
const highlightReaderToggle = (readerMode) => {
const els = document.querySelectorAll(".quarto-reader-toggle");
if (els) {
els.forEach((el) => {
if (readerMode) {
el.classList.add("reader");
} else {
el.classList.remove("reader");
}
});
}
};
const setReaderModeValue = (val) => {
if (window.location.protocol !== "file:") {
window.localStorage.setItem("quarto-reader-mode", val);
} else {
localReaderMode = val;
}
};
const isReaderMode = () => {
if (window.location.protocol !== "file:") {
return window.localStorage.getItem("quarto-reader-mode") === "true";
} else {
return localReaderMode;
}
};
let localReaderMode = null;
const tocOpenDepthStr = tocEl?.getAttribute("data-toc-expanded");
const tocOpenDepth = tocOpenDepthStr ? Number(tocOpenDepthStr) : 1;
// Walk the TOC and collapse/expand nodes
// Nodes are expanded if:
// - they are top level
// - they have children that are 'active' links
// - they are directly below an link that is 'active'
const walk = (el, depth) => {
// Tick depth when we enter a UL
if (el.tagName === "UL") {
depth = depth + 1;
}
// It this is active link
let isActiveNode = false;
if (el.tagName === "A" && el.classList.contains("active")) {
isActiveNode = true;
}
// See if there is an active child to this element
let hasActiveChild = false;
for (const child of el.children) {
hasActiveChild = walk(child, depth) || hasActiveChild;
}
// Process the collapse state if this is an UL
if (el.tagName === "UL") {
if (tocOpenDepth === -1 && depth > 1) {
// toc-expand: false
el.classList.add("collapse");
} else if (
depth <= tocOpenDepth ||
hasActiveChild ||
prevSiblingIsActiveLink(el)
) {
el.classList.remove("collapse");
} else {
el.classList.add("collapse");
}
// untick depth when we leave a UL
depth = depth - 1;
}
return hasActiveChild || isActiveNode;
};
// walk the TOC and expand / collapse any items that should be shown
if (tocEl) {
updateActiveLink();
walk(tocEl, 0);
}
// Throttle the scroll event and walk peridiocally
window.document.addEventListener(
"scroll",
throttle(() => {
if (tocEl) {
updateActiveLink();
walk(tocEl, 0);
}
if (!isReaderMode()) {
hideOverlappedSidebars();
}
}, 5)
);
window.addEventListener(
"resize",
throttle(() => {
if (tocEl) {
updateActiveLink();
walk(tocEl, 0);
}
if (!isReaderMode()) {
hideOverlappedSidebars();
}
}, 10)
);
hideOverlappedSidebars();
highlightReaderToggle(isReaderMode());
});
tabsets.init();
function throttle(func, wait) {
let waiting = false;
return function () {
if (!waiting) {
func.apply(this, arguments);
waiting = true;
setTimeout(function () {
waiting = false;
}, wait);
}
};
}
function nexttick(func) {
return setTimeout(func, 0);
}
@@ -0,0 +1,95 @@
// grouped tabsets
export function init() {
window.addEventListener("pageshow", (_event) => {
function getTabSettings() {
const data = localStorage.getItem("quarto-persistent-tabsets-data");
if (!data) {
localStorage.setItem("quarto-persistent-tabsets-data", "{}");
return {};
}
if (data) {
return JSON.parse(data);
}
}
function setTabSettings(data) {
localStorage.setItem(
"quarto-persistent-tabsets-data",
JSON.stringify(data)
);
}
function setTabState(groupName, groupValue) {
const data = getTabSettings();
data[groupName] = groupValue;
setTabSettings(data);
}
function toggleTab(tab, active) {
const tabPanelId = tab.getAttribute("aria-controls");
const tabPanel = document.getElementById(tabPanelId);
if (active) {
tab.classList.add("active");
tabPanel.classList.add("active");
} else {
tab.classList.remove("active");
tabPanel.classList.remove("active");
}
}
function toggleAll(selectedGroup, selectorsToSync) {
for (const [thisGroup, tabs] of Object.entries(selectorsToSync)) {
const active = selectedGroup === thisGroup;
for (const tab of tabs) {
toggleTab(tab, active);
}
}
}
function findSelectorsToSyncByLanguage() {
const result = {};
const tabs = Array.from(
document.querySelectorAll(`div[data-group] a[id^='tabset-']`)
);
for (const item of tabs) {
const div = item.parentElement.parentElement.parentElement;
const group = div.getAttribute("data-group");
if (!result[group]) {
result[group] = {};
}
const selectorsToSync = result[group];
const value = item.innerHTML;
if (!selectorsToSync[value]) {
selectorsToSync[value] = [];
}
selectorsToSync[value].push(item);
}
return result;
}
function setupSelectorSync() {
const selectorsToSync = findSelectorsToSyncByLanguage();
Object.entries(selectorsToSync).forEach(([group, tabSetsByValue]) => {
Object.entries(tabSetsByValue).forEach(([value, items]) => {
items.forEach((item) => {
item.addEventListener("click", (_event) => {
setTabState(group, value);
toggleAll(value, selectorsToSync[group]);
});
});
});
});
return selectorsToSync;
}
const selectorsToSync = setupSelectorSync();
for (const [group, selectedName] of Object.entries(getTabSettings())) {
const selectors = selectorsToSync[group];
// it's possible that stale state gives us empty selections, so we explicitly check here.
if (selectors) {
toggleAll(selectedName, selectors);
}
}
});
}
+1
View File
@@ -0,0 +1 @@
.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}
+2
View File
@@ -0,0 +1,2 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],t):(e=e||self).tippy=t(e.Popper)}(this,(function(e){"use strict";var t={passive:!0,capture:!0},n=function(){return document.body};function r(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function o(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function i(e,t){return"function"==typeof e?e.apply(void 0,t):e}function a(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function s(e,t){var n=Object.assign({},e);return t.forEach((function(e){delete n[e]})),n}function u(e){return[].concat(e)}function c(e,t){-1===e.indexOf(t)&&e.push(t)}function p(e){return e.split("-")[0]}function f(e){return[].slice.call(e)}function l(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function d(){return document.createElement("div")}function v(e){return["Element","Fragment"].some((function(t){return o(e,t)}))}function m(e){return o(e,"MouseEvent")}function g(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function h(e){return v(e)?[e]:function(e){return o(e,"NodeList")}(e)?f(e):Array.isArray(e)?e:f(document.querySelectorAll(e))}function b(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function y(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function w(e){var t,n=u(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function E(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function O(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var x={isTouch:!1},C=0;function T(){x.isTouch||(x.isTouch=!0,window.performance&&document.addEventListener("mousemove",A))}function A(){var e=performance.now();e-C<20&&(x.isTouch=!1,document.removeEventListener("mousemove",A)),C=e}function L(){var e=document.activeElement;if(g(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var D=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,R=Object.assign({appendTo:n,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),k=Object.keys(R);function P(e){var t=(e.plugins||[]).reduce((function(t,n){var r,o=n.name,i=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(r=R[o])?r:i);return t}),{});return Object.assign({},e,t)}function j(e,t){var n=Object.assign({},t,{content:i(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(P(Object.assign({},R,{plugins:t}))):k).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},R.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function M(e,t){e.innerHTML=t}function V(e){var t=d();return!0===e?t.className="tippy-arrow":(t.className="tippy-svg-arrow",v(e)?t.appendChild(e):M(t,e)),t}function I(e,t){v(t.content)?(M(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?M(e,t.content):e.textContent=t.content)}function S(e){var t=e.firstElementChild,n=f(t.children);return{box:t,content:n.find((function(e){return e.classList.contains("tippy-content")})),arrow:n.find((function(e){return e.classList.contains("tippy-arrow")||e.classList.contains("tippy-svg-arrow")})),backdrop:n.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function N(e){var t=d(),n=d();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=d();function o(n,r){var o=S(t),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==tyLine truncated
+1
View File
@@ -0,0 +1 @@
!function(t,e){"function"==typeof define&&define.amd?define([],e()):"object"==typeof module&&module.exports?module.exports=e():function n(){document&&document.body?t.zenscroll=e():setTimeout(n,9)}()}(this,function(){"use strict";var t=function(t){return t&&"getComputedStyle"in window&&"smooth"===window.getComputedStyle(t)["scroll-behavior"]};if("undefined"==typeof window||!("document"in window))return{};var e=function(e,n,o){n=n||999,o||0===o||(o=9);var i,r=function(t){i=t},u=function(){clearTimeout(i),r(0)},c=function(t){return Math.max(0,e.getTopOf(t)-o)},a=function(o,i,c){if(u(),0===i||i&&i<0||t(e.body))e.toY(o),c&&c();else{var a=e.getY(),f=Math.max(0,o)-a,s=(new Date).getTime();i=i||Math.min(Math.abs(f),n),function t(){r(setTimeout(function(){var n=Math.min(1,((new Date).getTime()-s)/i),o=Math.max(0,Math.floor(a+f*(n<.5?2*n*n:n*(4-2*n)-1)));e.toY(o),n<1&&e.getHeight()+o<e.body.scrollHeight?t():(setTimeout(u,99),c&&c())},9))}()}},f=function(t,e,n){a(c(t),e,n)},s=function(t,n,i){var r=t.getBoundingClientRect().height,u=e.getTopOf(t)+r,s=e.getHeight(),l=e.getY(),d=l+s;c(t)<l||r+o>s?f(t,n,i):u+o>d?a(u-s+o,n,i):i&&i()},l=function(t,n,o,i){a(Math.max(0,e.getTopOf(t)-e.getHeight()/2+(o||t.getBoundingClientRect().height/2)),n,i)};return{setup:function(t,e){return(0===t||t)&&(n=t),(0===e||e)&&(o=e),{defaultDuration:n,edgeOffset:o}},to:f,toY:a,intoView:s,center:l,stop:u,moving:function(){return!!i},getY:e.getY,getTopOf:e.getTopOf}},n=document.documentElement,o=function(){return window.scrollY||n.scrollTop},i=e({body:document.scrollingElement||document.body,toY:function(t){window.scrollTo(0,t)},getY:o,getHeight:function(){return window.innerHeight||n.clientHeight},getTopOf:function(t){return t.getBoundingClientRect().top+o()-n.offsetTop}});if(i.createScroller=function(t,o,i){return e({body:t,toY:function(e){t.scrollTop=e},getY:function(){return t.scrollTop},getHeight:function(){return Math.min(t.clientHeight,window.innerHeight||n.clientHeight)},getTopOf:function(t){return t.offsetTop}},o,i)},"addEventListener"in window&&!window.noZensmooth&&!t(document.body)){var r="history"in window&&"pushState"in history,u=r&&"scrollRestoration"in history;u&&(history.scrollRestoration="auto"),window.addEventListener("load",function(){u&&(setTimeout(function(){history.scrollRestoration="manual"},9),window.addEventListener("popstate",function(t){t.state&&"zenscrollY"in t.state&&i.toY(t.state.zenscrollY)},!1)),window.location.hash&&setTimeout(function(){var t=i.setup().edgeOffset;if(t){var e=document.getElementById(window.location.href.split("#")[1]);if(e){var n=Math.max(0,i.getTopOf(e)-t),o=i.getY()-n;0<=o&&o<9&&window.scrollTo(0,n)}}},9)},!1);var c=new RegExp("(^|\\s)noZensmooth(\\s|$)");window.addEventListener("click",function(t){for(var e=t.target;e&&"A"!==e.tagName;)e=e.parentNode;if(!(!e||1!==t.which||t.shiftKey||t.metaKey||t.ctrlKey||t.altKey)){if(u){var n=history.state&&"object"==typeof history.state?history.state:{};n.zenscrollY=i.getY();try{history.replaceState(n,"")}catch(t){}}var o=e.getAttribute("href")||"";if(0===o.indexOf("#")&&!c.test(e.className)){var a=0,f=document.getElementById(o.substring(1));if("#"!==o){if(!f)return;a=i.getTopOf(f)}t.preventDefault();var s=function(){window.location=o},l=i.setup().edgeOffset;l&&(a=Math.max(0,a-l),r&&(s=function(){history.pushState({},"",o)})),i.toY(a,null,s)}}},!1)}return i});
Loaded 100 of 191 files, more files were not shown because too many files have changed in this diff. Show more