Night-mode styling, French cross-references, and the log through Part VI
- theme.scss and figures draw with the extension's --calc-… tokens; light/dark pair plus the high-contrast button; a11y highlight style for html - figure labels split so none leaves its viewBox in any language - _quarto-fr.yml: French cross-reference prefixes - notes extension synced to 2.8.18 - conv/: Parts IV, V and VI logged, pasted terminal output redacted Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
No files matched your search
@@ -25,3 +25,6 @@
|
|||||||
# step 18 is committed on purpose (it is a record of that run); later boards
|
# step 18 is committed on purpose (it is a record of that run); later boards
|
||||||
# are runtime data.
|
# are runtime data.
|
||||||
SIN.04028-From-Calling-to-Eventing/supplemental-java/**/messageBoard-*/
|
SIN.04028-From-Calling-to-Eventing/supplemental-java/**/messageBoard-*/
|
||||||
|
|
||||||
|
# server files (temp here to test)
|
||||||
|
/_srv/
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
# [Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de} {#sec-step-0}
|
# [Step 0 — What this is about]{.en}[Étape 0 — De quoi il s'agit]{.fr}[Schritt 0 — Worum es geht]{.de} {#sec-step-0}
|
||||||
|
|
||||||
<!-- MULTILINGUAL: see the comment at the top of index.qmd. -->
|
<!-- MULTILINGUAL: see the comment at the top of index.qmd. -->
|
||||||
|
|
||||||
::: {.en}
|
::: {.en}
|
||||||
Step 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.
|
Step 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.
|
||||||
|
|
||||||
Two rules are set here and hold for the whole tutorial:
|
Two rules are set here and hold all the way through:
|
||||||
|
|
||||||
> **Meet each solution only after you have experienced the problem it solves.**
|
> **Meet each solution only after you have experienced the problem it solves.**
|
||||||
|
|
||||||
That 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.
|
That is why the build-up does not start with MQTT, and not with dynamic subscriptions either. A system with deliberately awkward mediators is built first, put into operation, and only then asked whether those mediators have earned their place.
|
||||||
|
|
||||||
The 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.
|
The second rule is about vocabulary: *Intent*, *Status/State* and *Event* are named only after they have been used. They appear around step 42, not before.
|
||||||
|
|
||||||
The planned route, from step 0:
|
The planned route, from step 0:
|
||||||
|
|
||||||
@@ -26,11 +26,11 @@ direct method calls → egoistic services → mediators → separate processes
|
|||||||
::: {.fr}
|
::: {.fr}
|
||||||
L'é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.
|
L'é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.
|
||||||
|
|
||||||
Deux règles sont posées ici et valent pour tout le tutoriel :
|
Deux règles sont posées ici et valent jusqu'au bout :
|
||||||
|
|
||||||
> **Ne rencontrer une solution qu'après avoir vécu le problème qu'elle résout.**
|
> **Ne rencontrer une solution qu'après avoir vécu le problème qu'elle résout.**
|
||||||
|
|
||||||
C'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.
|
C'est pourquoi la construction ne commence ni par MQTT, ni par les abonnements dynamiques. Un système aux médiateurs délibérément maladroits est bâti d'abord, mis en service, et l'on demande seulement ensuite s'ils ont mérité leur place.
|
||||||
|
|
||||||
La 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.
|
La 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.
|
||||||
|
|
||||||
@@ -47,11 +47,11 @@ direct method calls → egoistic services → mediators → separate processes
|
|||||||
::: {.de}
|
::: {.de}
|
||||||
Schritt 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.
|
Schritt 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.
|
||||||
|
|
||||||
Zwei Regeln werden hier gesetzt und gelten für das ganze Tutorial:
|
Zwei Regeln werden hier gesetzt und gelten bis zum Schluss:
|
||||||
|
|
||||||
> **Einer Lösung erst begegnen, nachdem man das Problem erlebt hat, das sie löst.**
|
> **Einer Lösung erst begegnen, nachdem man das Problem erlebt hat, das sie löst.**
|
||||||
|
|
||||||
Deshalb 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.
|
Deshalb beginnt der Aufbau nicht mit MQTT und auch nicht mit dynamischen Abonnements. Zuerst entsteht ein System mit absichtlich unbequemen Vermittlern, wird in Betrieb genommen, und erst dann wird gefragt, ob sie ihren Platz verdient haben.
|
||||||
|
|
||||||
Die 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.
|
Die 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.
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ direct method calls → egoistic services → mediators → separate processes
|
|||||||
::: {.en}
|
::: {.en}
|
||||||
The wording of the three questions matters, and it is easy to replace it with something weaker:
|
The wording of the three questions matters, and it is easy to replace it with something weaker:
|
||||||
|
|
||||||
| The tutorial asks | A weaker version |
|
| As asked here | A weaker version |
|
||||||
|---|---|
|
|---|---|
|
||||||
| Who **knows** whom? | who *communicates* with whom |
|
| Who **knows** whom? | who *communicates* with whom |
|
||||||
| Who **owns** what? | which *data* each part holds |
|
| Who **owns** what? | which *data* each part holds |
|
||||||
@@ -82,7 +82,7 @@ The wording of the three questions matters, and it is easy to replace it with so
|
|||||||
::: {.fr}
|
::: {.fr}
|
||||||
La formulation des trois questions compte, et il est facile de la remplacer par une version plus faible :
|
La formulation des trois questions compte, et il est facile de la remplacer par une version plus faible :
|
||||||
|
|
||||||
| Ce que demande le tutoriel | Une version plus faible |
|
| Telle qu'elle est posée ici | Une version plus faible |
|
||||||
|---|---|
|
|---|---|
|
||||||
| Qui **connaît** qui ? | qui *communique* avec qui |
|
| Qui **connaît** qui ? | qui *communique* avec qui |
|
||||||
| Qui **possède** quoi ? | quelles *données* détient chaque partie |
|
| Qui **possède** quoi ? | quelles *données* détient chaque partie |
|
||||||
@@ -94,7 +94,7 @@ La formulation des trois questions compte, et il est facile de la remplacer par
|
|||||||
::: {.de}
|
::: {.de}
|
||||||
Der Wortlaut der drei Fragen ist wichtig, und man ersetzt ihn leicht durch eine schwächere Fassung:
|
Der Wortlaut der drei Fragen ist wichtig, und man ersetzt ihn leicht durch eine schwächere Fassung:
|
||||||
|
|
||||||
| Das Tutorial fragt | Eine schwächere Fassung |
|
| So gefragt | Eine schwächere Fassung |
|
||||||
|---|---|
|
|---|---|
|
||||||
| Wer **kennt** wen? | wer mit wem *kommuniziert* |
|
| Wer **kennt** wen? | wer mit wem *kommuniziert* |
|
||||||
| Wer **besitzt** was? | welche *Daten* jeder Teil hält |
|
| Wer **besitzt** was? | welche *Daten* jeder Teil hält |
|
||||||
|
|||||||
@@ -98,19 +98,19 @@ Die Verfügbarkeitsgarantie lohnt eine eigene Erwähnung, denn sie verschwindet
|
|||||||
::: {.en}
|
::: {.en}
|
||||||
An **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(...)`.
|
An **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(...)`.
|
||||||
|
|
||||||
Removing 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`.
|
Removing those calls immediately creates a problem, best put 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`.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.fr}
|
::: {.fr}
|
||||||
Un 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(...)`.
|
Un 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(...)`.
|
||||||
|
|
||||||
Supprimer 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`.
|
Supprimer ces appels crée aussitôt un problème, qui se pose 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`.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.de}
|
::: {.de}
|
||||||
Eine **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(...)`.
|
Eine **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(...)`.
|
||||||
|
|
||||||
Das 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`.
|
Das Entfernen dieser Aufrufe schafft sofort ein Problem, das sich als Frage stellen lässt: 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`.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## [Step 3 — Give every capability a mailbox]{.en}[Étape 3 — Donner une boîte aux lettres à chaque capacité]{.fr}[Schritt 3 — Jeder Fähigkeit ein Postfach geben]{.de} {#sec-step-3}
|
## [Step 3 — Give every capability a mailbox]{.en}[Étape 3 — Donner une boîte aux lettres à chaque capacité]{.fr}[Schritt 3 — Jeder Fähigkeit ein Postfach geben]{.de} {#sec-step-3}
|
||||||
@@ -128,7 +128,7 @@ BlockingQueue<Message> mailbox(String name) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The 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.
|
These are **mailboxes**, not topics, and the distinction is worth insisting on: 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.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.fr}
|
::: {.fr}
|
||||||
@@ -144,7 +144,7 @@ BlockingQueue<Message> mailbox(String name) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Le 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.
|
Ce sont des **boîtes aux lettres** (*mailboxes*) et non des sujets (*topics*), et la distinction mérite qu'on y insiste : 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.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.de}
|
::: {.de}
|
||||||
@@ -160,7 +160,7 @@ BlockingQueue<Message> mailbox(String name) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Das 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.
|
Das sind bewusst **Postfächer** (*mailboxes*) und keine Topics, und der Unterschied ist wichtig: 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.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## [Steps 4–6 — The three capabilities become egoistic]{.en}[Étapes 4–6 — Les trois capacités deviennent égoïstes]{.fr}[Schritte 4–6 — Die drei Fähigkeiten werden egoistisch]{.de} {#sec-steps-4-6}
|
## [Steps 4–6 — The three capabilities become egoistic]{.en}[Étapes 4–6 — Les trois capacités deviennent égoïstes]{.fr}[Schritte 4–6 — Die drei Fähigkeiten werden egoistisch]{.de} {#sec-steps-4-6}
|
||||||
@@ -174,7 +174,7 @@ Each capability now touches only its own mailbox names:
|
|||||||
| ROT13 | `rot13.inbox` | `rot13.outbox` |
|
| ROT13 | `rot13.inbox` | `rot13.outbox` |
|
||||||
| ConsoleOut | `consoleOut.inbox` | the console |
|
| ConsoleOut | `consoleOut.inbox` | the console |
|
||||||
|
|
||||||
No 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`.
|
No capability contains the name of another, and that is exactly the result: three nicely isolated capabilities that do absolutely nothing together. Nothing moves a message from `consoleIn.outbox` to `rot13.inbox`, or from `rot13.outbox` to `consoleOut.inbox`.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.fr}
|
::: {.fr}
|
||||||
@@ -186,7 +186,7 @@ Chaque capacité ne touche plus que ses propres noms de boîtes :
|
|||||||
| ROT13 | `rot13.inbox` | `rot13.outbox` |
|
| ROT13 | `rot13.inbox` | `rot13.outbox` |
|
||||||
| ConsoleOut | `consoleOut.inbox` | la console |
|
| ConsoleOut | `consoleOut.inbox` | la console |
|
||||||
|
|
||||||
Aucune 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`.
|
Aucune capacité ne contient le nom d'une autre, et c'est exactement le résultat : trois capacités bien isolées qui ne font absolument rien ensemble. Rien ne déplace un message de `consoleIn.outbox` vers `rot13.inbox`, ni de `rot13.outbox` vers `consoleOut.inbox`.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.de}
|
::: {.de}
|
||||||
@@ -198,7 +198,7 @@ Jede Fähigkeit berührt nur noch ihre eigenen Postfachnamen:
|
|||||||
| ROT13 | `rot13.inbox` | `rot13.outbox` |
|
| ROT13 | `rot13.inbox` | `rot13.outbox` |
|
||||||
| ConsoleOut | `consoleOut.inbox` | die Konsole |
|
| ConsoleOut | `consoleOut.inbox` | die Konsole |
|
||||||
|
|
||||||
Keine 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`.
|
Keine Fähigkeit enthält den Namen einer anderen, und genau das ist das Ergebnis: drei schön isolierte Fähigkeiten, die zusammen absolut nichts tun. Nichts bewegt eine Nachricht von `consoleIn.outbox` nach `rot13.inbox` oder von `rot13.outbox` nach `consoleOut.inbox`.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## [Step 7 — Enter the mediator]{.en}[Étape 7 — Entre le médiateur]{.fr}[Schritt 7 — Auftritt des Vermittlers]{.de} {#sec-step-7}
|
## [Step 7 — Enter the mediator]{.en}[Étape 7 — Entre le médiateur]{.fr}[Schritt 7 — Auftritt des Vermittlers]{.de} {#sec-step-7}
|
||||||
@@ -255,7 +255,7 @@ void mediate(String from, String to) {
|
|||||||
::: {.en}
|
::: {.en}
|
||||||
Does 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()`.
|
Does 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()`.
|
||||||
|
|
||||||
This is the tutorial's first major result:
|
This is the first major result:
|
||||||
|
|
||||||
> **Decoupling often does not make knowledge disappear. It moves knowledge to where it belongs.**
|
> **Decoupling often does not make knowledge disappear. It moves knowledge to where it belongs.**
|
||||||
|
|
||||||
@@ -265,7 +265,7 @@ The capability "ROT13 transforms text" belongs to ROT13. The topology `ConsoleIn
|
|||||||
::: {.fr}
|
::: {.fr}
|
||||||
ConsoleIn 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()`.
|
ConsoleIn 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()`.
|
||||||
|
|
||||||
C'est le premier résultat majeur du tutoriel :
|
C'est le premier résultat majeur :
|
||||||
|
|
||||||
> **Le découplage ne fait souvent pas disparaître la connaissance. Il la déplace là où elle appartient.**
|
> **Le découplage ne fait souvent pas disparaître la connaissance. Il la déplace là où elle appartient.**
|
||||||
|
|
||||||
@@ -275,7 +275,7 @@ La capacité « ROT13 transforme du texte » appartient à ROT13. La topologie `
|
|||||||
::: {.de}
|
::: {.de}
|
||||||
Kennt ConsoleIn ROT13? Nein. Kennt ROT13 ConsoleIn oder ConsoleOut? Nein. Ist die Topologie verschwunden? Nein — sie steckt in den zwei `mediate(...)`-Aufrufen innerhalb von `main()`.
|
Kennt ConsoleIn ROT13? Nein. Kennt ROT13 ConsoleIn oder ConsoleOut? Nein. Ist die Topologie verschwunden? Nein — sie steckt in den zwei `mediate(...)`-Aufrufen innerhalb von `main()`.
|
||||||
|
|
||||||
Das ist das erste grosse Ergebnis des Tutorials:
|
Das ist das erste grosse Ergebnis:
|
||||||
|
|
||||||
> **Entkopplung lässt Wissen oft nicht verschwinden. Sie verschiebt Wissen dorthin, wo es hingehört.**
|
> **Entkopplung lässt Wissen oft nicht verschwinden. Sie verschiebt Wissen dorthin, wo es hingehört.**
|
||||||
|
|
||||||
@@ -287,19 +287,19 @@ Die Fähigkeit „ROT13 transformiert Text" gehört zu ROT13. Die Topologie `Con
|
|||||||
::: {.en}
|
::: {.en}
|
||||||
Five 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.
|
Five 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.
|
||||||
|
|
||||||
They 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.
|
They 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 evidence for the separation: the same architecture will run as separate processes in step 11, with no threads shared between the parts.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.fr}
|
::: {.fr}
|
||||||
Cinq 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.
|
Cinq 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.
|
||||||
|
|
||||||
C'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.
|
C'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 de cette séparation : la même architecture tournera en processus séparés à l'étape 11, sans aucun thread partagé entre les parties.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.de}
|
::: {.de}
|
||||||
Fü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.
|
Fü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.
|
||||||
|
|
||||||
Sie 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.
|
Sie 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 für die Trennung: dieselbe Architektur läuft in Schritt 11 als getrennte Prozesse, ohne geteilte Threads zwischen den Teilen.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## [Step 10 — Keep the services egoistic]{.en}[Étape 10 — Garder les services égoïstes]{.fr}[Schritt 10 — Die Dienste egoistisch halten]{.de} {#sec-step-10}
|
## [Step 10 — Keep the services egoistic]{.en}[Étape 10 — Garder les services égoïstes]{.fr}[Schritt 10 — Die Dienste egoistisch halten]{.de} {#sec-step-10}
|
||||||
@@ -314,7 +314,7 @@ Because ROT13 would then contain the name `consoleIn.outbox`, which means it wou
|
|||||||
| what changes | one argument of the mediator | `runRot13` itself |
|
| what changes | one argument of the mediator | `runRot13` itself |
|
||||||
| who is touched | no capability | ROT13, whose job did not change |
|
| who is touched | no capability | ROT13, whose job did not change |
|
||||||
|
|
||||||
The 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.
|
The price is worth stating plainly: this design may look indirect — even a little odd. There is another way to keep services egoistic *without* a mediator in every message's path, and it comes later.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.fr}
|
::: {.fr}
|
||||||
@@ -327,7 +327,7 @@ Parce que ROT13 contiendrait alors le nom `consoleIn.outbox`, c'est-à-dire qu'i
|
|||||||
| ce qui change | un argument du médiateur | `runRot13` lui-même |
|
| ce qui change | un argument du médiateur | `runRot13` lui-même |
|
||||||
| qui est touché | aucune capacité | ROT13, dont le travail n'a pas changé |
|
| qui est touché | aucune capacité | ROT13, dont le travail n'a pas changé |
|
||||||
|
|
||||||
Le 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.
|
Le prix mérite d'être dit clairement : ce design peut sembler indirect — voire un peu bizarre. Il existe une autre manière de garder les services égoïstes *sans* médiateur sur le chemin de chaque message ; elle viendra plus tard.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.de}
|
::: {.de}
|
||||||
@@ -340,7 +340,7 @@ Weil ROT13 dann den Namen `consoleIn.outbox` enthielte, also wüsste, dass Conso
|
|||||||
| was sich ändert | ein Argument des Vermittlers | `runRot13` selbst |
|
| was sich ändert | ein Argument des Vermittlers | `runRot13` selbst |
|
||||||
| wer berührt wird | keine Fähigkeit | ROT13, dessen Aufgabe unverändert blieb |
|
| wer berührt wird | keine Fähigkeit | ROT13, dessen Aufgabe unverändert blieb |
|
||||||
|
|
||||||
Das 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.
|
Der Preis gehört klar gesagt: dieses Design mag indirekt wirken — sogar etwas eigenartig. Es gibt einen anderen Weg, Dienste egoistisch zu halten, *ohne* Vermittler im Pfad jeder Nachricht; er kommt später.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## [What part I moved]{.en}[Ce que la partie I a déplacé]{.fr}[Was Teil I verschoben hat]{.de} {#sec-part-i-result}
|
## [What part I moved]{.en}[Ce que la partie I a déplacé]{.fr}[Was Teil I verschoben hat]{.de} {#sec-part-i-result}
|
||||||
@@ -351,7 +351,7 @@ Das Tutorial ist ehrlich über den Preis: dieses Design „mag indirekt wirken
|
|||||||
| step 1 | inside the capability code (`IO.println(rot13(text))`) | whoever edits that code |
|
| step 1 | inside the capability code (`IO.println(rot13(text))`) | whoever edits that code |
|
||||||
| steps 7–8 | in `main()`, as pairs of mailbox names | whoever edits `main()` |
|
| steps 7–8 | in `main()`, as pairs of mailbox names | whoever edits `main()` |
|
||||||
|
|
||||||
Functionality: unchanged. Lines of code: more. Parts that know each other: none. That is the trade the rest of the tutorial keeps testing.
|
Functionality: unchanged. Lines of code: more. Parts that know each other: none. That is the trade everything that follows keeps testing.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.fr}
|
::: {.fr}
|
||||||
@@ -360,7 +360,7 @@ Functionality: unchanged. Lines of code: more. Parts that know each other: none.
|
|||||||
| étape 1 | dans le code de la capacité (`IO.println(rot13(text))`) | celui qui édite ce code |
|
| étape 1 | dans le code de la capacité (`IO.println(rot13(text))`) | celui qui édite ce code |
|
||||||
| étapes 7–8 | dans `main()`, en paires de noms de boîtes | celui qui édite `main()` |
|
| étapes 7–8 | dans `main()`, en paires de noms de boîtes | celui qui édite `main()` |
|
||||||
|
|
||||||
Fonctionnalité : 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.
|
Fonctionnalité : inchangée. Lignes de code : davantage. Parties qui se connaissent : aucune. C'est le compromis que tout ce qui suit continue de mettre à l'épreuve.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.de}
|
::: {.de}
|
||||||
@@ -369,5 +369,5 @@ Fonctionnalité : inchangée. Lignes de code : davantage. Parties qui se connais
|
|||||||
| Schritt 1 | im Code der Fähigkeit (`IO.println(rot13(text))`) | wer diesen Code ändert |
|
| Schritt 1 | im Code der Fähigkeit (`IO.println(rot13(text))`) | wer diesen Code ändert |
|
||||||
| Schritte 7–8 | in `main()`, als Paare von Postfachnamen | wer `main()` ändert |
|
| Schritte 7–8 | in `main()`, als Paare von Postfachnamen | wer `main()` ändert |
|
||||||
|
|
||||||
Funktionalität: unverändert. Codezeilen: mehr. Teile, die einander kennen: keine. Das ist der Tauschhandel, den das restliche Tutorial immer wieder prüft.
|
Funktionalität: unverändert. Codezeilen: mehr. Teile, die einander kennen: keine. Das ist der Tauschhandel, den alles Folgende immer wieder prüft.
|
||||||
:::
|
:::
|
||||||
@@ -19,19 +19,19 @@ Die Schritte 11 bis 18 nehmen die Architektur aus Teil I und verteilen sie auf f
|
|||||||
::: {.en}
|
::: {.en}
|
||||||
Three 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.
|
Three 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.
|
||||||
|
|
||||||
TCP 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.
|
TCP would do, MQTT would do. The most primitive option is picked deliberately, the **filesystem**, for 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.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.fr}
|
::: {.fr}
|
||||||
Trois 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.
|
Trois 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.
|
||||||
|
|
||||||
TCP 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.
|
TCP conviendrait, MQTT conviendrait. C'est délibérément l'option la plus primitive qui est choisie, le **système de fichiers**, pour 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.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.de}
|
::: {.de}
|
||||||
Drei 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.
|
Drei 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.
|
||||||
|
|
||||||
TCP 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.
|
TCP würde gehen, MQTT würde gehen. Absichtlich fällt die Wahl auf 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.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## [Steps 12–13 — A directory becomes a mailbox]{.en}[Étapes 12–13 — Un répertoire devient une boîte aux lettres]{.fr}[Schritte 12–13 — Ein Verzeichnis wird zum Postfach]{.de} {#sec-steps-12-13}
|
## [Steps 12–13 — A directory becomes a mailbox]{.en}[Étapes 12–13 — Un répertoire devient une boîte aux lettres]{.fr}[Schritte 12–13 — Ein Verzeichnis wird zum Postfach]{.de} {#sec-steps-12-13}
|
||||||
@@ -196,7 +196,7 @@ mv messageBoard/consoleOut/inbox/manual.tmp messageBoard/consoleOut/inbox/manual
|
|||||||
|
|
||||||
**Observed:** 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.
|
**Observed:** 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.
|
||||||
|
|
||||||
The 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.
|
The architectural point reads `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.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.fr}
|
::: {.fr}
|
||||||
@@ -211,7 +211,7 @@ mv messageBoard/consoleOut/inbox/manual.tmp messageBoard/consoleOut/inbox/manual
|
|||||||
|
|
||||||
**Observé :** 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.
|
**Observé :** 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.
|
||||||
|
|
||||||
La 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.
|
Le point architectural s'écrit `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.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.de}
|
::: {.de}
|
||||||
@@ -226,7 +226,7 @@ mv messageBoard/consoleOut/inbox/manual.tmp messageBoard/consoleOut/inbox/manual
|
|||||||
|
|
||||||
**Beobachtet:** 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.
|
**Beobachtet:** 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.
|
||||||
|
|
||||||
Die 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.
|
Die architektonische Lehre lautet `producer → filesystem → consumer`: 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.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## [Steps 16–17 — Services and mediator become processes]{.en}[Étapes 16–17 — Services et médiateur deviennent des processus]{.fr}[Schritte 16–17 — Dienste und Vermittler werden Prozesse]{.de} {#sec-steps-16-17}
|
## [Steps 16–17 — Services and mediator become processes]{.en}[Étapes 16–17 — Services et médiateur deviennent des processus]{.fr}[Schritte 16–17 — Dienste und Vermittler werden Prozesse]{.de} {#sec-steps-16-17}
|
||||||
@@ -241,9 +241,9 @@ The three capabilities become three programs, and the mediator a fourth kind of
|
|||||||
| `ActuatorService.java` | ConsoleOut | `consoleOut/inbox` | the console |
|
| `ActuatorService.java` | ConsoleOut | `consoleOut/inbox` | the console |
|
||||||
| `Mediator.java <from> <to>` | the glue | `<from>` | `<to>` |
|
| `Mediator.java <from> <to>` | the glue | `<from>` | `<to>` |
|
||||||
|
|
||||||
The 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.
|
The mediator is generic: its route is not compiled in, it arrives as two startup arguments. But there is 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.
|
||||||
|
|
||||||
The 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.
|
The 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. This stays deliberately unfixed until the cost of the distributed mediators has been felt.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.fr}
|
::: {.fr}
|
||||||
@@ -256,9 +256,9 @@ Les trois capacités deviennent trois programmes, et le médiateur un quatrième
|
|||||||
| `ActuatorService.java` | ConsoleOut | `consoleOut/inbox` | la console |
|
| `ActuatorService.java` | ConsoleOut | `consoleOut/inbox` | la console |
|
||||||
| `Mediator.java <from> <to>` | la colle | `<from>` | `<to>` |
|
| `Mediator.java <from> <to>` | la colle | `<from>` | `<to>` |
|
||||||
|
|
||||||
Le 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.
|
Le médiateur est générique : sa route n'est pas compilée en dur, elle arrive en deux arguments de démarrage. Mais une asymétrie mérite d'être gardée 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.
|
||||||
|
|
||||||
Consé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.
|
Consé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. Ce point reste volontairement ouvert jusqu'à ce que le coût des médiateurs distribués ait été ressenti.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.de}
|
::: {.de}
|
||||||
@@ -271,9 +271,9 @@ Die drei Fähigkeiten werden drei Programme, und der Vermittler eine vierte Art
|
|||||||
| `ActuatorService.java` | ConsoleOut | `consoleOut/inbox` | die Konsole |
|
| `ActuatorService.java` | ConsoleOut | `consoleOut/inbox` | die Konsole |
|
||||||
| `Mediator.java <from> <to>` | der Klebstoff | `<from>` | `<to>` |
|
| `Mediator.java <from> <to>` | der Klebstoff | `<from>` | `<to>` |
|
||||||
|
|
||||||
Der 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.
|
Der Vermittler ist generisch: seine Route ist nicht einkompiliert, sie kommt als zwei Startargumente. Doch eine Asymmetrie sollte man im Kopf behalten: 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.
|
||||||
|
|
||||||
Praktische 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.
|
Praktische 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. Dieser Punkt bleibt absichtlich offen, bis die Kosten der verteilten Vermittler zu spüren waren.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## [Step 18 — Run the fully external local version]{.en}[Étape 18 — Exécuter la version entièrement externe, en local]{.fr}[Schritt 18 — Die vollständig externe lokale Fassung ausführen]{.de} {#sec-step-18}
|
## [Step 18 — Run the fully external local version]{.en}[Étape 18 — Exécuter la version entièrement externe, en local]{.fr}[Schritt 18 — Die vollständig externe lokale Fassung ausführen]{.de} {#sec-step-18}
|
||||||
@@ -291,7 +291,7 @@ java ActuatorService.java # terminal 5
|
|||||||
|
|
||||||
**Observed:** `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.
|
**Observed:** `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.
|
||||||
|
|
||||||
Count 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."
|
Count it: **five processes** for what step 1 did in one statement. This is not the moment to optimise: it is not meant to be comfortable yet.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.fr}
|
::: {.fr}
|
||||||
@@ -307,7 +307,7 @@ java ActuatorService.java # terminal 5
|
|||||||
|
|
||||||
**Observé :** `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.
|
**Observé :** `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.
|
||||||
|
|
||||||
Comptons : **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. »
|
Comptons : **cinq processus** pour ce que l'étape 1 faisait en une instruction. Ce n'est pas le moment d'optimiser : ce n'est pas encore censé être confortable.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.de}
|
::: {.de}
|
||||||
@@ -323,7 +323,7 @@ java ActuatorService.java # terminal 5
|
|||||||
|
|
||||||
**Beobachtet:** `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.
|
**Beobachtet:** `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.
|
||||||
|
|
||||||
Nachzä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."
|
Nachzählen: **fünf Prozesse** für das, was Schritt 1 in einer Anweisung tat. Jetzt ist nicht der Moment zu optimieren: bequem soll es noch nicht sein.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
![[The five processes and the four mailbox directories. In the web version, **Play** follows one line of text from the keyboard to the console.]{.en}[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.]{.fr}[Die fünf Prozesse und die vier Postfachverzeichnisse. In der Webfassung folgt **Abspielen** einer Textzeile von der Tastatur zur Konsole.]{.de}](figures/filesystem-processes-@tr{langcode}){#fig-filesystem-processes .flow-figure}
|
![[The five processes and the four mailbox directories. In the web version, **Play** follows one line of text from the keyboard to the console.]{.en}[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.]{.fr}[Die fünf Prozesse und die vier Postfachverzeichnisse. In der Webfassung folgt **Abspielen** einer Textzeile von der Tastatur zur Konsole.]{.de}](figures/filesystem-processes-@tr{langcode}){#fig-filesystem-processes .flow-figure}
|
||||||
|
|||||||
@@ -1,21 +1,28 @@
|
|||||||
5450bea48cd978a098105317ad733839 README.md
|
e1b695980dee84de5bfa19ff7bfab6c2 README.md
|
||||||
c7a6d67f7241268c6ba80e59824b7720 _extension.yml
|
a86fced789dc540cf13974d26391c92d _extension.yml
|
||||||
40495613a91f62b4caa736a8bebeafe0 calc-notes.css
|
9037e06faf2c5fde7b3d614039652eed audit-page.js
|
||||||
3754c29ead80b6c334397953e0636be4 calc-notes.js
|
f9f1c739b8a198b3e9c2c087a5904f85 audit.py
|
||||||
4488fd02675637ec10179a4e96aaa558 calc-notes.lua
|
a2f486f6e2dc382624f99801db209b75 calc-notes.css
|
||||||
9460f3985b27b3107182599992985adf exo.css
|
e9500e2554429fc8da7e9b2a6b51c8f1 calc-notes.js
|
||||||
|
c06ae335d8506b347298d2a8f0e04ef2 calc-notes.lua
|
||||||
|
e380e93d24a5968cc483dcbe48d99613 exo.css
|
||||||
1b1c35a5488c4e695a34b1f9efaeab4f exo.js
|
1b1c35a5488c4e695a34b1f9efaeab4f exo.js
|
||||||
0bb15846fbb2bc9be2bde88d77698de8 exo.lua
|
0bb15846fbb2bc9be2bde88d77698de8 exo.lua
|
||||||
62e03d6d5bd4f62830d71eadb66aa5ed fenced-divs.lua
|
62e03d6d5bd4f62830d71eadb66aa5ed fenced-divs.lua
|
||||||
8f938997710ad5d77e5d378735db451d glossary.css
|
8bd78a96d4553b922718a381d14a44a3 further.css
|
||||||
|
1b1237dd91ec14b2c8a9ad20c8ee844f further.lua
|
||||||
|
2a324dc0362a2a569ac4053b923c17f4 glossary.css
|
||||||
6144abf4ad62088ab51409542e5f28e1 glossary.js
|
6144abf4ad62088ab51409542e5f28e1 glossary.js
|
||||||
3dd15747646f60632313c8a1cacf7fe9 glossary.lua
|
3766b7d739c8aebb790b7092af31a57a glossary.lua
|
||||||
2aa159cbe6bfe1ee35e18d4290d67425 handin.sh
|
2aa159cbe6bfe1ee35e18d4290d67425 handin.sh
|
||||||
|
93c5c7dddcc07fd7dcedcf06ff32c0d3 high-contrast.css
|
||||||
691f5e66397d855e951c37a953701913 i18n.lua
|
691f5e66397d855e951c37a953701913 i18n.lua
|
||||||
061f762946d63ea672d4f989f762baf7 latex-tables.css
|
061f762946d63ea672d4f989f762baf7 latex-tables.css
|
||||||
bab632a49553476bc5275b9c583f457e latex-tables.lua
|
bab632a49553476bc5275b9c583f457e latex-tables.lua
|
||||||
6242f20acbe379c1da37d4b698de317e quiz.css
|
b846f2c4afd59aa0c9a328c71633425f narrow.css
|
||||||
|
f5b63a6c6c5d3f9df63766ade2719ff2 quiz.css
|
||||||
79e94885bf370abe27eeb6df81666946 quiz.js
|
79e94885bf370abe27eeb6df81666946 quiz.js
|
||||||
1695d57dcb6deb45f4fb2303dee6aa09 quiz.lua
|
1695d57dcb6deb45f4fb2303dee6aa09 quiz.lua
|
||||||
2b8ca7ff531d30903bc41240e8b77691 si-mathjax.lua
|
2b8ca7ff531d30903bc41240e8b77691 si-mathjax.lua
|
||||||
d32141259df2ce229400779c2ed284d9 sync.sh
|
d32141259df2ce229400779c2ed284d9 sync.sh
|
||||||
|
838bac386bf1e2b1e0323d91119c3632 theme.css
|
||||||
@@ -8,16 +8,21 @@ documents its syntax in the comment at its top; this page is the overview.
|
|||||||
| `calc-notes.lua` | `\begin{calc}` / `calc*` derivations with `\note{}` / `\mnote{}`; label with `$$ … $$ {#eq-x}` |
|
| `calc-notes.lua` | `\begin{calc}` / `calc*` derivations with `\note{}` / `\mnote{}`; label with `$$ … $$ {#eq-x}` |
|
||||||
| `exo.lua` | `::::{.exo}` exercises with `.hint` and `.solution` placed where written; hand-in mode |
|
| `exo.lua` | `::::{.exo}` exercises with `.hint` and `.solution` placed where written; hand-in mode |
|
||||||
| `quiz.lua` | `::::{.quiz}` tick-box self-checks with a **Check** button and per-option `.why` |
|
| `quiz.lua` | `::::{.quiz}` tick-box self-checks with a **Check** button and per-option `.why` |
|
||||||
| `glossary.lua` | `.gls-def`, `\gls{key}`, `[term]{.gls}`, `::: {.glossary}`; resolves across chapters |
|
| `glossary.lua` | `.gls-def`, `\gls{key}`, `\gls[variant]{key}` in maths (shows the variant, links to the entry), `[term]{.gls}`, `::: {.glossary}`; resolves across chapters, and links also work inside a definition and in a figure caption (pdf too) |
|
||||||
| `latex-tables.lua` | `tabular` environments rendered as HTML tables |
|
| `latex-tables.lua` | `tabular` environments rendered as HTML tables |
|
||||||
| `i18n.lua` | one source, several languages: `::: {.de}`, `[…]{.fr}`, `@tr{key}` |
|
| `i18n.lua` | one source, several languages: `::: {.de}`, `[…]{.fr}`, `@tr{key}` |
|
||||||
| `si-mathjax.lua` | `\SI`, `\si`, `\num`, `\ang` in HTML (PDF uses siunitx) |
|
| `si-mathjax.lua` | `\SI`, `\si`, `\num`, `\ang` in HTML (PDF uses siunitx) |
|
||||||
|
| `further.lua` | `::: {.further}` purple "to go further" notes, for material beside the lecture |
|
||||||
| `fenced-divs.lua` | repairs `:::` divs indented deeper than pandoc accepts (in numbered parts) |
|
| `fenced-divs.lua` | repairs `:::` divs indented deeper than pandoc accepts (in numbered parts) |
|
||||||
|
| `theme.css` | the palette every part shares, in light and in night mode |
|
||||||
|
| `high-contrast.css` | the high-contrast pair, after GitHub's two high-contrast VS Code themes |
|
||||||
|
| `narrow.css` | keeps the page inside a phone screen: formulas, code and tables scroll in place |
|
||||||
|
|
||||||
## Options (in `_quarto.yml`)
|
## Options (in `_quarto.yml`)
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
notecolor: "#B45309" # accent colour of notes, exercises, hints
|
notecolor: "#B45309" # accent colour of notes, exercises, hints
|
||||||
|
notecolor-dark: "#e0a361" # its night value; by default the same hue, lifted
|
||||||
|
|
||||||
exo:
|
exo:
|
||||||
pdf-solutions: inline # PDF: solutions in place (default: end of chapter)
|
pdf-solutions: inline # PDF: solutions in place (default: end of chapter)
|
||||||
@@ -31,11 +36,111 @@ quiz:
|
|||||||
check: "Vérifier" # right, wrong, score, true, false, hint, page
|
check: "Vérifier" # right, wrong, score, true, false, hint, page
|
||||||
|
|
||||||
siunitx-html: mathjax # leave \SI & co. to a MathJax siunitx extension
|
siunitx-html: mathjax # leave \SI & co. to a MathJax siunitx extension
|
||||||
|
furthercolor: "#6B3FA0" # the accent of the "to go further" notes
|
||||||
|
furthercolor-dark: "#c09ae8"
|
||||||
|
|
||||||
glossary-page: glossary.html
|
glossary-page: glossary.html
|
||||||
glossary-back: "→ definition in context" # follows `lang` (en/fr/de) by default
|
glossary-back: "→ definition in context" # follows `lang` (en/fr/de) by default
|
||||||
|
|
||||||
|
high-contrast: true # stronger palette, both modes (default: off)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Night mode
|
||||||
|
|
||||||
|
The extension carries one palette, in `theme.css`, and every colour it draws
|
||||||
|
with is a token on it. A book gets night mode by offering the two themes:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
format:
|
||||||
|
html:
|
||||||
|
theme:
|
||||||
|
light: [cosmo]
|
||||||
|
dark: [darkly]
|
||||||
|
```
|
||||||
|
|
||||||
|
Quarto then shows its light/dark toggle and sets `body.quarto-dark`, which is
|
||||||
|
what the dark values key off — never `prefers-color-scheme`, so a book
|
||||||
|
configured light-only stays light for a reader whose system is dark.
|
||||||
|
|
||||||
|
A book's own `notecolor` and `furthercolor` are kept in night mode, not
|
||||||
|
replaced: the print value is too dim on a dark ground, so it is lifted to a
|
||||||
|
light tone **at the same hue** (`oklch(from … 0.78 c h)`). A book that wants a
|
||||||
|
particular night colour sets `notecolor-dark:` / `furthercolor-dark:`. The
|
||||||
|
book's colour itself stays available as `--calc-notecolor-src`.
|
||||||
|
|
||||||
|
The tokens, should a book's own css want them: `--calc-ink`, `--calc-muted`,
|
||||||
|
`--calc-line`, `--calc-grid`, `--calc-accent-a/-b/-c`, `--calc-danger`,
|
||||||
|
`--calc-surface`, `--calc-faint`, `--calc-shadow`, `--calc-domface`,
|
||||||
|
`--calc-domtop`, and the two from the metadata, `--calc-notecolor` and
|
||||||
|
`--calc-furthercolor`.
|
||||||
|
|
||||||
|
A pinned `highlight-style` needs no pair: Quarto ships the light and the dark
|
||||||
|
variant of its bundled themes (`github`, `github-dark`, …) and swaps them with
|
||||||
|
the toggle as soon as a book offers two themes. theme.css deliberately leaves
|
||||||
|
code colours alone.
|
||||||
|
|
||||||
|
Generated line art (`main img[src$=".svg"]`) is inverted in night mode, hue
|
||||||
|
rotated so blue stays blue. An svg that is a photograph, or that brings its
|
||||||
|
own dark palette, opts out with `class="no-invert"`.
|
||||||
|
|
||||||
|
A built svg figure writes each colour as a token with its light value as the
|
||||||
|
fallback, `var(--calc-ink, #1a1a1a)`: inlined in the page it follows the
|
||||||
|
three modes, while an `<img>` and rsvg-convert (the PDF) draw the fallback.
|
||||||
|
No `prefers-color-scheme` block in figure CSS: it follows the system, not the
|
||||||
|
page's toggle.
|
||||||
|
|
||||||
|
**Plots from code (matplotlib).** A line plot (curves, points, bars, a few
|
||||||
|
colours) is an svg: `fig-format: svg` under `format: html` only, a
|
||||||
|
transparent figure and axes background, black ink and accents that survive
|
||||||
|
invert + hue-rotate(180°); it then turns with the page like other line art. A
|
||||||
|
plot whose colours carry data (a colour map, a surface, an image) is a png on
|
||||||
|
an opaque white ground and is never inverted — inverting would reverse the
|
||||||
|
scale; in night mode it shows as a white card, like a photograph. A png is
|
||||||
|
never inverted, so it needs no `no-invert`.
|
||||||
|
|
||||||
|
Text drawn in an accent colour needs 4.5:1, a stroke only 3:1: for text, mix
|
||||||
|
in a fifth of ink, `color-mix(in srgb, var(--calc-accent-a) 80%,
|
||||||
|
var(--calc-ink))` — same hue, and it passes in all four modes.
|
||||||
|
|
||||||
|
## High contrast
|
||||||
|
|
||||||
|
`high-contrast.css` is a second pair of themes, taken from GitHub's
|
||||||
|
**GitHub Light High Contrast** and **GitHub Dark High Contrast** VS Code
|
||||||
|
themes (the Primer `light_high_contrast` / `dark_high_contrast` scales). It
|
||||||
|
rides on top of the ordinary pair — the light/dark toggle keeps working — and
|
||||||
|
restyles the page, not only the extension: canvas, headings, links, the
|
||||||
|
sidebar and the table of contents, code blocks and their syntax colours,
|
||||||
|
tables, block quotes and the notes environments.
|
||||||
|
|
||||||
|
Following the two themes, it separates by outline rather than by fill: muted
|
||||||
|
ink goes to full strength, borders take `border.default`, and the tinted
|
||||||
|
panels of `.exo`, `.further`, `.quiz` and the glossary lose their tint for a
|
||||||
|
full-strength accent edge.
|
||||||
|
|
||||||
|
**The reader switches it** with the half-circle button next to Quarto's
|
||||||
|
light/dark toggle in the navigation bar. The choice is kept in `localStorage`
|
||||||
|
(`notes-contrast`) and applied from the `<head>` on the next page, so nothing
|
||||||
|
flashes. High contrast and night mode are two separate axes: either toggle
|
||||||
|
works whatever the other one says.
|
||||||
|
|
||||||
|
Three ways in, in order of precedence:
|
||||||
|
|
||||||
|
1. what the reader last picked with the button;
|
||||||
|
2. `high-contrast: true` in `_quarto.yml`, for the whole book;
|
||||||
|
3. the reader's system setting, `prefers-contrast: more`, which is watched, so
|
||||||
|
changing it takes effect without a reload — until the reader picks for
|
||||||
|
themselves, after which their choice stands.
|
||||||
|
|
||||||
|
Measured on a chapter of Analysis, contrast against the page (WCAG AA is 4.5);
|
||||||
|
captions re-measured with 2.8.4, which gives them the muted token:
|
||||||
|
|
||||||
|
| | body | link | toc | caption | code keyword | comment |
|
||||||
|
|---|---|---|---|---|---|---|
|
||||||
|
| ordinary light | 11.5 | 5.4 | 5.4 | 6.4 | — | — |
|
||||||
|
| high contrast light | 18.9 | 8.0 | 8.0 | 18.9 | 8.1 | 5.0 |
|
||||||
|
| ordinary dark | 15.9 | 6.5 | 6.5 | 6.3 | — | — |
|
||||||
|
| high contrast dark | 17.6 | 9.2 | 9.2 | 17.6 | 9.7 | 11.7 |
|
||||||
|
|
||||||
## Exercises
|
## Exercises
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
@@ -100,6 +205,30 @@ printed at the end of the chapter with a page reference back to the quiz
|
|||||||
Correct answers are part of the built HTML, as solutions are: the quiz is a
|
Correct answers are part of the built HTML, as solutions are: the quiz is a
|
||||||
self-check, not an assessment.
|
self-check, not an assessment.
|
||||||
|
|
||||||
|
## To go further
|
||||||
|
|
||||||
|
Material that sits beside the course's own statement — a formal construction, a
|
||||||
|
proof the lecture skipped, a pointer to the wider theory:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
::: {.further}
|
||||||
|
Everything in here is optional.
|
||||||
|
:::
|
||||||
|
|
||||||
|
::: {.further title="Cantor pairing"}
|
||||||
|
…
|
||||||
|
:::
|
||||||
|
```
|
||||||
|
|
||||||
|
In a multilingual book, wrap the body in `::: {.de}` / `{.fr}` / `{.en}` divs as
|
||||||
|
usual, and write the title as `title="@tr{key}"` — a literal `title=` is an
|
||||||
|
attribute and stays in whatever language you typed it.
|
||||||
|
|
||||||
|
It renders as a purple box, headed "To go further" (following `lang`: *Vertiefung*,
|
||||||
|
*Pour aller plus loin*). Override the heading with `further: label: "…"` and the
|
||||||
|
colour with `furthercolor:` in `_quarto.yml`. Use it whenever the handwritten
|
||||||
|
pages carry a "to go further" annotation.
|
||||||
|
|
||||||
## Tools
|
## Tools
|
||||||
|
|
||||||
**Hand in solutions.** Renders only the chosen exercises to `_handin/`, and
|
**Hand in solutions.** Renders only the chosen exercises to `_handin/`, and
|
||||||
@@ -123,3 +252,20 @@ _extensions/notes/sync.sh
|
|||||||
A copy that was edited in place (or has a higher `version:`) is skipped with a
|
A copy that was edited in place (or has a higher `version:`) is skipped with a
|
||||||
diff, so nothing is overwritten silently. Bump `version:` in `_extension.yml`
|
diff, so nothing is overwritten silently. Bump `version:` in `_extension.yml`
|
||||||
when you change something.
|
when you change something.
|
||||||
|
|
||||||
|
**Check contrast and phone width.** Loads every page of a build in light,
|
||||||
|
dark and both high-contrast modes, at 320 and 1280 px, and measures every
|
||||||
|
visible text node (folds opened, opacity counted) against its ground, and
|
||||||
|
anything wider than the screen. Point it at `_book/` or at a scratch render;
|
||||||
|
it works on a temporary copy and never writes to the build:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
quarto render --profile fr --to html --output-dir /tmp/fr-test
|
||||||
|
_extensions/notes/audit.py /tmp/fr-test # 320 and 1280 px
|
||||||
|
_extensions/notes/audit.py _book --widths 320 --json out.json
|
||||||
|
```
|
||||||
|
|
||||||
|
It prints the worst ratio per mode, every text under 4.5:1 with its element
|
||||||
|
and colour, and every page wider than the screen; the exit status is 1 if
|
||||||
|
anything fails. `audit-page.js` is the part that runs in the page. Needs
|
||||||
|
Playwright's `chrome-headless-shell` under `~/.cache/ms-playwright/`.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
title: notes
|
title: notes
|
||||||
author: Matsune
|
author: Matsune
|
||||||
version: 2.3.0
|
version: 2.8.18
|
||||||
quarto-required: ">=1.4.0"
|
quarto-required: ">=1.4.0"
|
||||||
contributes:
|
contributes:
|
||||||
filters:
|
filters:
|
||||||
@@ -20,6 +20,7 @@ contributes:
|
|||||||
- path: quiz.lua
|
- path: quiz.lua
|
||||||
at: pre-ast
|
at: pre-ast
|
||||||
- si-mathjax.lua
|
- si-mathjax.lua
|
||||||
|
- further.lua
|
||||||
- latex-tables.lua
|
- latex-tables.lua
|
||||||
# post-quarto: after Quarto's crossref, so {#eq-...} labels on calc blocks
|
# post-quarto: after Quarto's crossref, so {#eq-...} labels on calc blocks
|
||||||
# resolve; glossary last, so \gls{} inside a calc block is linked too
|
# resolve; glossary last, so \gls{} inside a calc block is linked too
|
||||||
|
|||||||
@@ -0,0 +1,133 @@
|
|||||||
|
// audit-page.js -- injected by audit.py into a copy of a built page.
|
||||||
|
//
|
||||||
|
// In light, dark, light + high contrast and dark + high contrast it measures
|
||||||
|
// * the contrast of every visible text node against its composited ground
|
||||||
|
// (opacity included; a disabled control is exempt, WCAG 1.4.3), and
|
||||||
|
// * horizontal overflow: text ranges and element boxes past the viewport,
|
||||||
|
// ignoring content inside a box that scrolls itself.
|
||||||
|
// Every <details> is opened first, so hints and solutions are measured too.
|
||||||
|
// The result goes, as JSON, into body[data-audit].
|
||||||
|
(function () {
|
||||||
|
var cv = document.createElement('canvas'); cv.width = cv.height = 1;
|
||||||
|
var cx = cv.getContext('2d', { willReadFrequently: true });
|
||||||
|
// any css colour (oklch, color-mix ...) -> [r, g, b, a], via a 1x1 canvas
|
||||||
|
function rgb(c) {
|
||||||
|
cx.clearRect(0, 0, 1, 1); cx.fillStyle = '#000'; cx.fillStyle = c; cx.fillRect(0, 0, 1, 1);
|
||||||
|
var d = cx.getImageData(0, 0, 1, 1).data; return [d[0], d[1], d[2], d[3] / 255];
|
||||||
|
}
|
||||||
|
function lum(p) {
|
||||||
|
var a = p.slice(0, 3).map(function (v) { v /= 255; return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4); });
|
||||||
|
return 0.2126 * a[0] + 0.7152 * a[1] + 0.0722 * a[2];
|
||||||
|
}
|
||||||
|
function blend(fg, bg) { var a = fg[3]; return [fg[0] * a + bg[0] * (1 - a), fg[1] * a + bg[1] * (1 - a), fg[2] * a + bg[2] * (1 - a), 1]; }
|
||||||
|
// the ground under an element: its translucent layers composited on the page
|
||||||
|
function bgOf(el) {
|
||||||
|
var layers = [];
|
||||||
|
for (var e = el; e; e = e.parentElement) {
|
||||||
|
var c = rgb(getComputedStyle(e).backgroundColor);
|
||||||
|
if (c[3] > 0) { layers.push(c); if (c[3] >= 0.99) break; }
|
||||||
|
}
|
||||||
|
var base = rgb(getComputedStyle(document.body).backgroundColor);
|
||||||
|
if (base[3] < 0.99) base = [255, 255, 255, 1];
|
||||||
|
for (var i = layers.length - 1; i >= 0; i--) base = blend(layers[i], base);
|
||||||
|
return base;
|
||||||
|
}
|
||||||
|
function ratio(f, b) { var L1 = lum(f), L2 = lum(b); return (Math.max(L1, L2) + 0.05) / (Math.min(L1, L2) + 0.05); }
|
||||||
|
function label(el) {
|
||||||
|
var s = el.tagName.toLowerCase();
|
||||||
|
if (el.id) s += '#' + el.id;
|
||||||
|
var cl = (typeof el.className === 'string' ? el.className : '').trim().split(/\s+/).filter(Boolean).slice(0, 2);
|
||||||
|
if (cl.length) s += '.' + cl.join('.');
|
||||||
|
var p = el.parentElement;
|
||||||
|
if (p) { var pc = (typeof p.className === 'string' ? p.className : '').trim().split(/\s+/).filter(Boolean)[0]; s = (p.tagName.toLowerCase() + (pc ? '.' + pc : '')) + ' > ' + s; }
|
||||||
|
var box = el.closest('.exo, .exo-hint, .exo-sol, .further, .callout, .quiz, .gls-inline, .calc-note, .cell-output, nav, .sidebar, header, footer');
|
||||||
|
if (box) s += ' [in ' + box.tagName.toLowerCase() + '.' + String(box.className).trim().split(/\s+/)[0] + ']';
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
function visible(el) {
|
||||||
|
if (!el.getClientRects().length) return false;
|
||||||
|
var cs = getComputedStyle(el);
|
||||||
|
if (cs.visibility === 'hidden' || +cs.opacity === 0) return false;
|
||||||
|
for (var e = el; e; e = e.parentElement) if (+getComputedStyle(e).opacity < 0.05) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
function scrollsX(el) {
|
||||||
|
for (var e = el; e && e !== document.body; e = e.parentElement) {
|
||||||
|
var o = getComputedStyle(e).overflowX;
|
||||||
|
if (o === 'auto' || o === 'scroll' || o === 'hidden' || o === 'clip') return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
function measure() {
|
||||||
|
var W = window.innerWidth, worst = [], over = [];
|
||||||
|
var walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
|
||||||
|
var seen = new Set(), n;
|
||||||
|
while ((n = walker.nextNode())) {
|
||||||
|
if (!n.nodeValue.trim()) continue;
|
||||||
|
var el = n.parentElement;
|
||||||
|
if (!el || seen.has(el)) continue;
|
||||||
|
seen.add(el);
|
||||||
|
if (/^(SCRIPT|STYLE|NOSCRIPT|TEMPLATE)$/.test(el.tagName)) continue;
|
||||||
|
if (el.closest('mjx-container, .MathJax, svg, [aria-hidden="true"], .visually-hidden, .sr-only')) continue;
|
||||||
|
if (!visible(el)) continue;
|
||||||
|
// a disabled control is exempt from the contrast minimum (WCAG 1.4.3)
|
||||||
|
if (el.closest('[disabled], [aria-disabled="true"], .exo-locked')) continue;
|
||||||
|
var cs = getComputedStyle(el), f = rgb(cs.color);
|
||||||
|
// opacity on the element or any ancestor fades the text into its ground
|
||||||
|
var op = 1;
|
||||||
|
for (var oe = el; oe; oe = oe.parentElement) op *= +getComputedStyle(oe).opacity;
|
||||||
|
f = [f[0], f[1], f[2], f[3] * op];
|
||||||
|
var b = bgOf(el); f = blend(f, b);
|
||||||
|
var r = ratio(f, b);
|
||||||
|
worst.push({ r: +r.toFixed(2), el: label(el), text: n.nodeValue.trim().slice(0, 40), fg: cs.color });
|
||||||
|
if (!scrollsX(el)) {
|
||||||
|
var rg = document.createRange(); rg.selectNodeContents(n);
|
||||||
|
var rr = rg.getBoundingClientRect();
|
||||||
|
if (rr.width && (rr.right > W + 1 || rr.left < -1)) over.push({ el: label(el), right: Math.round(rr.right), text: n.nodeValue.trim().slice(0, 40) });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
document.querySelectorAll('body *').forEach(function (el) {
|
||||||
|
if (!el.getClientRects().length || scrollsX(el)) return;
|
||||||
|
var r = el.getBoundingClientRect();
|
||||||
|
if (r.width && r.right > W + 1 && getComputedStyle(el).position !== 'fixed') over.push({ el: label(el), right: Math.round(r.right) });
|
||||||
|
});
|
||||||
|
worst.sort(function (a, b) { return a.r - b.r; });
|
||||||
|
var fails = worst.filter(function (w) { return w.r < 4.5; });
|
||||||
|
return { worst: worst.slice(0, 3), fails: fails.length, failList: fails.slice(0, 8), overflow: over.slice(0, 6), overflowCount: over.length, docWidth: document.documentElement.scrollWidth, W: W };
|
||||||
|
}
|
||||||
|
function run() {
|
||||||
|
var st = document.createElement('style'); st.textContent = '*,*::before,*::after{transition:none!important;animation:none!important}'; document.head.appendChild(st);
|
||||||
|
// measure what a reader can unfold: hints, solutions, notes
|
||||||
|
document.querySelectorAll('details').forEach(function (d) { d.open = true; });
|
||||||
|
var hasToggle = typeof window.quartoToggleColorScheme === 'function';
|
||||||
|
var out = { hasDarkToggle: hasToggle, hasHcButton: !!document.querySelector('.notes-contrast-toggle'), modes: [] };
|
||||||
|
var M = [[false, false], [true, false], [false, true], [true, true]], i = 0;
|
||||||
|
// Quarto loads the dark stylesheet only when the toggle asks for it:
|
||||||
|
// measuring before it arrives reads dark colours on the light ground
|
||||||
|
function sheetsReady() {
|
||||||
|
return Array.prototype.every.call(document.querySelectorAll('link[rel~="stylesheet"]'), function (l) {
|
||||||
|
if (l.disabled) return true;
|
||||||
|
try { return !!l.sheet && l.sheet.cssRules !== null; } catch (e) { return true; }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function step() {
|
||||||
|
if (i === M.length) { document.body.setAttribute('data-audit', JSON.stringify(out)); return; }
|
||||||
|
var m = M[i];
|
||||||
|
if (m[0] && !hasToggle) { out.modes.push({ dark: true, hc: m[1], skipped: 'no dark theme' }); i++; return step(); }
|
||||||
|
if (hasToggle && document.body.classList.contains('quarto-dark') !== m[0]) window.quartoToggleColorScheme();
|
||||||
|
document.documentElement.classList.toggle('hc', m[1]);
|
||||||
|
var tries = 0;
|
||||||
|
(function wait() {
|
||||||
|
if (!sheetsReady() && tries++ < 40) return setTimeout(wait, 100);
|
||||||
|
setTimeout(function () {
|
||||||
|
var r = measure();
|
||||||
|
r.dark = document.body.classList.contains('quarto-dark'); r.hc = document.documentElement.classList.contains('hc');
|
||||||
|
r.bodyBg = getComputedStyle(document.body).backgroundColor;
|
||||||
|
out.modes.push(r); i++; step();
|
||||||
|
}, 500);
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
step();
|
||||||
|
}
|
||||||
|
window.addEventListener('load', function () { setTimeout(run, 400); });
|
||||||
|
})();
|
||||||
@@ -0,0 +1,132 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""audit.py -- four-mode check of a built book: contrast and phone width.
|
||||||
|
|
||||||
|
_extensions/notes/audit.py <built dir> [--widths 320,1280] [--jobs 4] [--json out.json]
|
||||||
|
|
||||||
|
<built dir> is _book/ or a scratch render (quarto render --output-dir ...).
|
||||||
|
It is copied to a temporary folder -- the build itself is never written to --
|
||||||
|
and audit-page.js is injected into a copy of every page. The copy is served on
|
||||||
|
127.0.0.2 (the language switcher is off on localhost) and each page is loaded
|
||||||
|
in chrome-headless-shell at each width, with overlay scrollbars as on a phone.
|
||||||
|
|
||||||
|
For light, dark, light + high contrast and dark + high contrast it prints the
|
||||||
|
worst text contrast, every text below 4.5:1 (WCAG AA), and any page wider than
|
||||||
|
the screen. Needs Playwright's headless shell:
|
||||||
|
~/.cache/ms-playwright/chromium_headless_shell-*/chrome-headless-shell-linux64/
|
||||||
|
"""
|
||||||
|
import argparse, concurrent.futures as cf, glob, html, json, os, re, shutil, subprocess, sys, tempfile, threading
|
||||||
|
from functools import partial
|
||||||
|
from http.server import ThreadingHTTPServer, SimpleHTTPRequestHandler
|
||||||
|
|
||||||
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
SHELLS = sorted(glob.glob(os.path.expanduser(
|
||||||
|
"~/.cache/ms-playwright/chromium_headless_shell-*/chrome-headless-shell-linux64/chrome-headless-shell")))
|
||||||
|
# the switcher redirects a page whose language differs from the remembered one
|
||||||
|
PIN_LANG = ("<script>document.cookie='notes-lang='+(document.documentElement.lang||'en')"
|
||||||
|
".slice(0,2)+'; path=/';</script>")
|
||||||
|
MODES = ["light", "dark", "light+hc", "dark+hc"]
|
||||||
|
|
||||||
|
|
||||||
|
def mirror(src):
|
||||||
|
dst = os.path.join(tempfile.mkdtemp(prefix="notes-audit-"), "site")
|
||||||
|
shutil.copytree(src, dst, ignore=shutil.ignore_patterns("*.pdf", "*.ipynb", "*.zip"))
|
||||||
|
shutil.copy(os.path.join(HERE, "audit-page.js"), os.path.join(dst, "__audit.js"))
|
||||||
|
pages = []
|
||||||
|
for p in glob.glob(os.path.join(dst, "**", "*.html"), recursive=True):
|
||||||
|
rel = os.path.relpath(p, dst)
|
||||||
|
if "site_libs" in rel or "/figures/" in "/" + rel:
|
||||||
|
continue
|
||||||
|
s = open(p, encoding="utf-8").read()
|
||||||
|
if "quarto" not in s or "<main" not in s:
|
||||||
|
continue
|
||||||
|
s = re.sub(r"<head>", "<head>" + PIN_LANG, s, count=1)
|
||||||
|
s = s.replace("</body>", '<script src="/__audit.js"></script></body>', 1)
|
||||||
|
out = p[:-5] + ".audit.html"
|
||||||
|
open(out, "w", encoding="utf-8").write(s)
|
||||||
|
pages.append(os.path.relpath(out, dst))
|
||||||
|
return dst, sorted(pages)
|
||||||
|
|
||||||
|
|
||||||
|
def load(shell, url, width):
|
||||||
|
cmd = [shell, "--headless", "--disable-gpu", "--no-sandbox", "--hide-scrollbars",
|
||||||
|
f"--window-size={width},900", "--virtual-time-budget=15000", "--dump-dom", url]
|
||||||
|
try:
|
||||||
|
dom = subprocess.run(cmd, capture_output=True, text=True, timeout=90).stdout
|
||||||
|
except subprocess.TimeoutExpired:
|
||||||
|
return {"error": "timeout"}
|
||||||
|
m = re.search(r'data-audit="([^"]*)"', dom)
|
||||||
|
return json.loads(html.unescape(m.group(1))) if m else {"error": "no result"}
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
ap = argparse.ArgumentParser(description=__doc__.split("\n")[0])
|
||||||
|
ap.add_argument("built")
|
||||||
|
ap.add_argument("--widths", default="320,1280")
|
||||||
|
ap.add_argument("--port", type=int, default=0, help="0 = any free port")
|
||||||
|
ap.add_argument("--jobs", type=int, default=4)
|
||||||
|
ap.add_argument("--json")
|
||||||
|
a = ap.parse_args()
|
||||||
|
if not SHELLS:
|
||||||
|
sys.exit("audit: no chrome-headless-shell under ~/.cache/ms-playwright")
|
||||||
|
dst, pages = mirror(os.path.abspath(a.built))
|
||||||
|
|
||||||
|
class Quiet(SimpleHTTPRequestHandler):
|
||||||
|
def log_message(self, *x):
|
||||||
|
pass
|
||||||
|
srv = ThreadingHTTPServer(("127.0.0.2", a.port), partial(Quiet, directory=dst))
|
||||||
|
port = srv.server_address[1]
|
||||||
|
threading.Thread(target=srv.serve_forever, daemon=True).start()
|
||||||
|
widths = [int(w) for w in a.widths.split(",")]
|
||||||
|
jobs = [(p, w) for p in pages for w in widths]
|
||||||
|
results = {}
|
||||||
|
with cf.ThreadPoolExecutor(a.jobs) as ex:
|
||||||
|
futs = {ex.submit(load, SHELLS[-1], f"http://127.0.0.2:{port}/{p}", w): (p, w) for p, w in jobs}
|
||||||
|
for f in cf.as_completed(futs):
|
||||||
|
results[futs[f]] = f.result()
|
||||||
|
srv.shutdown()
|
||||||
|
shutil.rmtree(os.path.dirname(dst), ignore_errors=True)
|
||||||
|
|
||||||
|
worst = {n: (99, None) for n in MODES}
|
||||||
|
fails, overflow, errors, flags_bad, no_toggle = [], [], [], [], set()
|
||||||
|
for (p, w), r in sorted(results.items()):
|
||||||
|
if "error" in r:
|
||||||
|
errors.append(f"{p} @{w}: {r['error']}"); continue
|
||||||
|
if not r.get("hasDarkToggle") or not r.get("hasHcButton"):
|
||||||
|
no_toggle.add(p)
|
||||||
|
for i, m in enumerate(r["modes"]):
|
||||||
|
n = MODES[i]
|
||||||
|
if m.get("skipped"):
|
||||||
|
continue
|
||||||
|
if m["dark"] != (i in (1, 3)) or m["hc"] != (i in (2, 3)):
|
||||||
|
flags_bad.append(f"{p} @{w} {n}")
|
||||||
|
if m["worst"] and m["worst"][0]["r"] < worst[n][0]:
|
||||||
|
worst[n] = (m["worst"][0]["r"], f"{p} @{w}: {m['worst'][0]['el']} «{m['worst'][0]['text']}»")
|
||||||
|
for fl in m["failList"]:
|
||||||
|
fails.append((fl["r"], n, w, p, fl["el"], fl["text"], fl["fg"]))
|
||||||
|
if m["overflowCount"] or m["docWidth"] > m["W"]:
|
||||||
|
overflow.append((n, w, p, m["docWidth"], m["W"], m["overflow"][:3]))
|
||||||
|
print(f"pages: {len(pages)} widths: {widths} runs: {len(jobs)} errors: {len(errors)}")
|
||||||
|
if no_toggle:
|
||||||
|
print(f"WITHOUT dark toggle or ◐ button: {len(no_toggle)} page(s), e.g. {sorted(no_toggle)[0]}")
|
||||||
|
if flags_bad:
|
||||||
|
print("MODE FLAGS WRONG:", flags_bad[:5])
|
||||||
|
for n in MODES:
|
||||||
|
print(f" worst {n:9s} {worst[n][0]:6.2f} {worst[n][1] or '(not measured)'}")
|
||||||
|
uniq = {}
|
||||||
|
for f in sorted(fails):
|
||||||
|
uniq.setdefault((f[1], f[4], f[6]), f)
|
||||||
|
print(f"text below 4.5: {len(fails)} element-runs, {len(uniq)} distinct (mode, element, colour)")
|
||||||
|
for f in list(uniq.values())[:25]:
|
||||||
|
print(f" {f[0]:5.2f} {f[1]:9s} @{f[2]} {f[3]}: {f[4]} «{f[5]}» {f[6]}")
|
||||||
|
print(f"overflow: {len(overflow)} page-runs")
|
||||||
|
for o in overflow[:10]:
|
||||||
|
print(f" {o[0]} @{o[1]} {o[2]}: page {o[3]}px in a {o[4]}px screen {o[5]}")
|
||||||
|
for e in errors[:10]:
|
||||||
|
print(" ERROR", e)
|
||||||
|
if a.json:
|
||||||
|
json.dump({f"{p}@{w}": r for (p, w), r in results.items()}, open(a.json, "w"), indent=1)
|
||||||
|
sys.exit(1 if (fails or overflow or errors or flags_bad) else 0)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -43,8 +43,8 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
list-style: none; /* remove the default triangle ... */
|
list-style: none; /* remove the default triangle ... */
|
||||||
user-select: none;
|
user-select: none;
|
||||||
opacity: 0.7;
|
font-style: italic; /* quiet by style and --calc-muted (theme.css), not by
|
||||||
font-style: italic;
|
opacity, which took it under 4.5:1 */
|
||||||
}
|
}
|
||||||
.calc-note > summary::-webkit-details-marker { display: none; }
|
.calc-note > summary::-webkit-details-marker { display: none; }
|
||||||
.calc-note > summary::before { content: "▸ "; font-style: normal; }
|
.calc-note > summary::before { content: "▸ "; font-style: normal; }
|
||||||
@@ -98,3 +98,18 @@
|
|||||||
.calc-full { grid-column: 1 / 3; }
|
.calc-full { grid-column: 1 / 3; }
|
||||||
.calc-tag { grid-column: 1 / -1; }
|
.calc-tag { grid-column: 1 / -1; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --- interactive figures ------------------------------------------------
|
||||||
|
A figure that is dragged — a rotatable 3d view, a point moved with the
|
||||||
|
mouse — must not select its own labels while the pointer travels over
|
||||||
|
them: the browser would paint the axis names and captions as selected
|
||||||
|
text. The readouts and captions around the drawing stay selectable, so a
|
||||||
|
value can still be copied. The hooks are the ones every course's figure
|
||||||
|
scripts build into. */
|
||||||
|
[data-notes-fig] svg,
|
||||||
|
[data-notes-plot] svg,
|
||||||
|
[data-notes-fig] canvas,
|
||||||
|
[data-notes-plot] canvas {
|
||||||
|
-webkit-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
@@ -13,3 +13,58 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
// --- high contrast: a switch of its own, beside Quarto's light/dark one ----
|
||||||
|
// The class is already set before the first paint by the script calc-notes.lua
|
||||||
|
// puts in the head; this only builds the control and remembers a choice.
|
||||||
|
// Precedence: what the reader picked here, then `high-contrast: true` in the
|
||||||
|
// book, then the reader's system setting.
|
||||||
|
(function () {
|
||||||
|
var KEY = "notes-contrast";
|
||||||
|
var root = document.documentElement;
|
||||||
|
|
||||||
|
var LABELS = {
|
||||||
|
de: { on: "Hoher Kontrast aus", off: "Hoher Kontrast ein" },
|
||||||
|
fr: { on: "Désactiver le contraste élevé", off: "Activer le contraste élevé" },
|
||||||
|
en: { on: "Turn high contrast off", off: "Turn high contrast on" }
|
||||||
|
};
|
||||||
|
var lang = (root.lang || "en").slice(0, 2).toLowerCase();
|
||||||
|
var L = LABELS[lang] || LABELS.en;
|
||||||
|
|
||||||
|
function store(v) {
|
||||||
|
try { localStorage.setItem(KEY, v ? "more" : "normal"); } catch (e) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
function paint() {
|
||||||
|
var on = root.classList.contains("hc");
|
||||||
|
document.querySelectorAll(".notes-contrast-toggle").forEach(function (b) {
|
||||||
|
b.setAttribute("aria-pressed", String(on));
|
||||||
|
b.setAttribute("title", on ? L.on : L.off);
|
||||||
|
b.setAttribute("aria-label", on ? L.on : L.off);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function build() {
|
||||||
|
var anchors = document.querySelectorAll(".quarto-color-scheme-toggle");
|
||||||
|
if (anchors.length === 0) return; // a page without Quarto's own tools
|
||||||
|
anchors.forEach(function (a) {
|
||||||
|
var b = document.createElement("button");
|
||||||
|
b.type = "button";
|
||||||
|
b.className = "quarto-navigation-tool px-1 notes-contrast-toggle";
|
||||||
|
// bootstrap-icons ships with these books; the glyph is the fallback
|
||||||
|
b.innerHTML = '<i class="bi bi-circle-half" aria-hidden="true"></i>';
|
||||||
|
b.addEventListener("click", function () {
|
||||||
|
var on = !root.classList.contains("hc");
|
||||||
|
root.classList.toggle("hc", on);
|
||||||
|
store(on);
|
||||||
|
paint();
|
||||||
|
});
|
||||||
|
a.parentNode.insertBefore(b, a.nextSibling);
|
||||||
|
});
|
||||||
|
paint();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.readyState === "loading") {
|
||||||
|
document.addEventListener("DOMContentLoaded", build);
|
||||||
|
} else { build(); }
|
||||||
|
})();
|
||||||
@@ -385,16 +385,54 @@ function Meta(m)
|
|||||||
if m.notecolor then
|
if m.notecolor then
|
||||||
notecolor = pandoc.utils.stringify(m.notecolor)
|
notecolor = pandoc.utils.stringify(m.notecolor)
|
||||||
end
|
end
|
||||||
|
local notecolor_dark = m["notecolor-dark"] ~= nil
|
||||||
|
and pandoc.utils.stringify(m["notecolor-dark"]) or nil
|
||||||
if quarto == nil or quarto.doc == nil then return end -- plain pandoc: skip injection
|
if quarto == nil or quarto.doc == nil then return end -- plain pandoc: skip injection
|
||||||
if fmt_is("html") then
|
if fmt_is("html") then
|
||||||
quarto.doc.add_html_dependency({
|
quarto.doc.add_html_dependency({
|
||||||
name = "calc-notes",
|
name = "calc-notes",
|
||||||
version = "1.0.0",
|
version = "1.0.0",
|
||||||
stylesheets = { "calc-notes.css" },
|
stylesheets = { "theme.css", "high-contrast.css", "calc-notes.css", "narrow.css" },
|
||||||
scripts = { "calc-notes.js" },
|
scripts = { "calc-notes.js" },
|
||||||
})
|
})
|
||||||
quarto.doc.include_text("in-header",
|
-- `-src` holds the book's own colour, which theme.css lifts for a dark
|
||||||
"<style>:root { --calc-notecolor: " .. notecolor .. "; }</style>")
|
-- page rather than replacing; `-dark` is a book's explicit override.
|
||||||
|
quarto.doc.include_text("in-header", table.concat({
|
||||||
|
"<style>:root {",
|
||||||
|
" --calc-notecolor-src: " .. notecolor .. ";",
|
||||||
|
" --calc-notecolor: var(--calc-notecolor-src);",
|
||||||
|
notecolor_dark and (" --calc-notecolor-dark: " .. notecolor_dark .. ";") or "",
|
||||||
|
"}</style>",
|
||||||
|
}, "\n"))
|
||||||
|
-- Mark <html> while the head is still parsing, so high-contrast.css is in
|
||||||
|
-- force before the first paint and the page never flashes the ordinary
|
||||||
|
-- palette. Three ways in, in this order of precedence: what the reader
|
||||||
|
-- last picked with the toggle in the navigation bar, `high-contrast: true`
|
||||||
|
-- in the book, and the reader's own system setting, which is watched so
|
||||||
|
-- that changing it takes effect without a reload.
|
||||||
|
local forced = (m["high-contrast"] == true) or
|
||||||
|
(m["high-contrast"] ~= nil and pandoc.utils.stringify(m["high-contrast"]) == "true")
|
||||||
|
quarto.doc.include_text("in-header", table.concat({
|
||||||
|
"<script>(function (e) {",
|
||||||
|
" var KEY = 'notes-contrast', forced = " .. (forced and "true" or "false") .. ";",
|
||||||
|
" var picked = null;",
|
||||||
|
" try { picked = localStorage.getItem(KEY); } catch (err) {}",
|
||||||
|
" var q = null;",
|
||||||
|
" try { q = window.matchMedia && window.matchMedia('(prefers-contrast: more)'); } catch (err) {}",
|
||||||
|
" if (picked === 'more' || (picked !== 'normal' && (forced || (q && q.matches)))) {",
|
||||||
|
" e.classList.add('hc');",
|
||||||
|
" }",
|
||||||
|
" if (q) {",
|
||||||
|
" var f = function () {",
|
||||||
|
" var p = null;",
|
||||||
|
" try { p = localStorage.getItem(KEY); } catch (err) {}",
|
||||||
|
" if (p === null) e.classList.toggle('hc', forced || q.matches);",
|
||||||
|
" };",
|
||||||
|
" if (q.addEventListener) q.addEventListener('change', f);",
|
||||||
|
" else if (q.addListener) q.addListener(f);",
|
||||||
|
" }",
|
||||||
|
"})(document.documentElement);</script>",
|
||||||
|
}, "\n"))
|
||||||
elseif fmt_is("latex") then
|
elseif fmt_is("latex") then
|
||||||
quarto.doc.use_latex_package("mathtools") -- \Aboxed
|
quarto.doc.use_latex_package("mathtools") -- \Aboxed
|
||||||
quarto.doc.use_latex_package("xcolor")
|
quarto.doc.use_latex_package("xcolor")
|
||||||
|
|||||||
@@ -66,6 +66,8 @@
|
|||||||
padding: 0.35rem 0.1rem 0.1rem;
|
padding: 0.35rem 0.1rem 0.1rem;
|
||||||
scroll-margin-top: 5rem;
|
scroll-margin-top: 5rem;
|
||||||
}
|
}
|
||||||
|
/* Quarto greys every summary (#6c757d): 3.4:1 on darkly */
|
||||||
|
.exo-sol > summary { color: var(--calc-muted, #57606a); }
|
||||||
/* in a numbered part, the fold lines up with the part's text */
|
/* in a numbered part, the fold lines up with the part's text */
|
||||||
.exo li > details { margin-left: 0; }
|
.exo li > details { margin-left: 0; }
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
/* further — "to go further" notes: optional material, set apart in purple */
|
||||||
|
|
||||||
|
.further {
|
||||||
|
margin: 1.1rem 0;
|
||||||
|
padding: 0.5rem 0.9rem 0.6rem;
|
||||||
|
border: 1px solid color-mix(in srgb, var(--calc-furthercolor, #6B3FA0) 30%, transparent);
|
||||||
|
border-left: 3px solid var(--calc-furthercolor, #6B3FA0);
|
||||||
|
border-radius: 0.35rem;
|
||||||
|
background: color-mix(in srgb, var(--calc-furthercolor, #6B3FA0) 4%, transparent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.further-head {
|
||||||
|
color: var(--calc-furthercolor, #6B3FA0);
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 0.92em;
|
||||||
|
margin-bottom: 0.35rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.further-body > p:first-child { margin-top: 0; }
|
||||||
|
.further-body > p:last-child { margin-bottom: 0; }
|
||||||
|
|
||||||
|
/* keep wide content inside the box, as .calc and .exo do */
|
||||||
|
.further mjx-container[display="true"],
|
||||||
|
.further .katex-display {
|
||||||
|
max-width: 100%;
|
||||||
|
overflow-x: auto;
|
||||||
|
overflow-y: hidden;
|
||||||
|
padding-bottom: 0.35em;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
justify-content: safe center;
|
||||||
|
}
|
||||||
|
.further :is(pre, table) { max-width: 100%; overflow-x: auto; }
|
||||||
|
.further img, .further svg { max-width: 100%; }
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
-- further.lua — "to go further" notes, for material beside the lecture's own
|
||||||
|
--
|
||||||
|
-- ::: {.further}
|
||||||
|
-- Everything in here is optional reading.
|
||||||
|
-- :::
|
||||||
|
--
|
||||||
|
-- ::: {.further title="Cantor pairing"}
|
||||||
|
-- ...
|
||||||
|
-- :::
|
||||||
|
--
|
||||||
|
-- The box is purple, so it reads as an aside and never as the course's own
|
||||||
|
-- statement. HTML: a box with a heading. PDF: a tcolorbox in the same colour.
|
||||||
|
--
|
||||||
|
-- Metadata:
|
||||||
|
-- furthercolor: "#6B3FA0" # the accent of these notes
|
||||||
|
-- further:
|
||||||
|
-- label: "Pour aller plus loin" # defaults to the document `lang`
|
||||||
|
|
||||||
|
local LABELS = {
|
||||||
|
en = "To go further",
|
||||||
|
fr = "Pour aller plus loin",
|
||||||
|
de = "Vertiefung",
|
||||||
|
}
|
||||||
|
|
||||||
|
local DEFAULT_COLOR = "#6B3FA0"
|
||||||
|
|
||||||
|
local label = LABELS.en
|
||||||
|
local color = DEFAULT_COLOR
|
||||||
|
|
||||||
|
local function fmt_is(name)
|
||||||
|
if quarto and quarto.doc and quarto.doc.is_format then
|
||||||
|
return quarto.doc.is_format(name)
|
||||||
|
end
|
||||||
|
return FORMAT ~= nil and FORMAT:match(name) ~= nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local function str(v)
|
||||||
|
if v == nil then return nil end
|
||||||
|
if type(v) == "boolean" then return tostring(v) end
|
||||||
|
return pandoc.utils.stringify(v)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function esc_html(s)
|
||||||
|
return (s:gsub("&", "&"):gsub("<", "<"):gsub(">", ">"):gsub('"', """))
|
||||||
|
end
|
||||||
|
|
||||||
|
local function read_meta(meta)
|
||||||
|
local lang = (str(meta.lang) or "en"):lower():gsub("[_-].*$", "")
|
||||||
|
label = LABELS[lang] or LABELS.en
|
||||||
|
if type(meta.further) == "table" and meta.further.label ~= nil then
|
||||||
|
label = str(meta.further.label)
|
||||||
|
end
|
||||||
|
if meta.furthercolor ~= nil then
|
||||||
|
color = str(meta.furthercolor)
|
||||||
|
end
|
||||||
|
local color_dark = meta["furthercolor-dark"] ~= nil
|
||||||
|
and str(meta["furthercolor-dark"]) or nil
|
||||||
|
|
||||||
|
if quarto ~= nil and quarto.doc ~= nil then
|
||||||
|
if fmt_is("html") then
|
||||||
|
quarto.doc.add_html_dependency({
|
||||||
|
name = "calc-further",
|
||||||
|
version = "1.0.0",
|
||||||
|
stylesheets = { "further.css" },
|
||||||
|
})
|
||||||
|
-- as for notecolor: the book's own colour is kept, and theme.css
|
||||||
|
-- lifts it for a dark page instead of replacing it
|
||||||
|
quarto.doc.include_text("in-header", table.concat({
|
||||||
|
"<style>:root {",
|
||||||
|
" --calc-furthercolor-src: " .. color .. ";",
|
||||||
|
" --calc-furthercolor: var(--calc-furthercolor-src);",
|
||||||
|
color_dark and (" --calc-furthercolor-dark: " .. color_dark .. ";") or "",
|
||||||
|
"}</style>",
|
||||||
|
}, "\n"))
|
||||||
|
elseif fmt_is("latex") then
|
||||||
|
-- same options as Quarto's callouts, so the two never clash
|
||||||
|
quarto.doc.use_latex_package("tcolorbox", "skins,breakable")
|
||||||
|
quarto.doc.use_latex_package("xcolor")
|
||||||
|
quarto.doc.include_text("in-header",
|
||||||
|
"\\definecolor{furthercolor}{HTML}{" .. color:gsub("^#", "") .. "}")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return meta
|
||||||
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------ render
|
||||||
|
|
||||||
|
-- `sep`: what goes between the label and a title= of its own. LaTeX fonts
|
||||||
|
-- often lack the U+2002 glyph, so the pdf gets \enspace instead.
|
||||||
|
local function head_text(el, sep)
|
||||||
|
local title = el.attributes.title
|
||||||
|
if title ~= nil and title ~= "" then
|
||||||
|
return label .. (sep or "\u{2002}—\u{2002}") .. title
|
||||||
|
end
|
||||||
|
return label
|
||||||
|
end
|
||||||
|
|
||||||
|
local function html_box(el)
|
||||||
|
local blocks = pandoc.Blocks({ pandoc.RawBlock("html",
|
||||||
|
'<div class="further"><div class="further-head">'
|
||||||
|
.. esc_html(head_text(el)) .. '</div><div class="further-body">') })
|
||||||
|
blocks:extend(el.content)
|
||||||
|
blocks:insert(pandoc.RawBlock("html", "</div></div>"))
|
||||||
|
return blocks
|
||||||
|
end
|
||||||
|
|
||||||
|
local function latex_box(el)
|
||||||
|
local blocks = pandoc.Blocks({ pandoc.RawBlock("latex",
|
||||||
|
"\\begin{tcolorbox}[enhanced jigsaw,breakable,"
|
||||||
|
.. "colback=furthercolor!4!white,colframe=furthercolor!55!white,"
|
||||||
|
.. "boxrule=0.4pt,arc=1pt,colbacktitle=furthercolor!12!white,"
|
||||||
|
.. "coltitle=furthercolor!80!black,fonttitle=\\small\\bfseries,"
|
||||||
|
.. "title={" .. head_text(el, "\\enspace---\\enspace{}") .. "},"
|
||||||
|
.. "left=2mm,right=1.5mm,top=1mm,bottom=1mm]") })
|
||||||
|
blocks:extend(el.content)
|
||||||
|
blocks:insert(pandoc.RawBlock("latex", "\\end{tcolorbox}"))
|
||||||
|
return blocks
|
||||||
|
end
|
||||||
|
|
||||||
|
local function Div(el)
|
||||||
|
if not el.classes:includes("further") then return nil end
|
||||||
|
if fmt_is("html") then return html_box(el) end
|
||||||
|
if fmt_is("latex") then return latex_box(el) end
|
||||||
|
-- any other format: a plain titled block
|
||||||
|
local blocks = pandoc.Blocks({
|
||||||
|
pandoc.Para({ pandoc.Strong({ pandoc.Str(head_text(el) .. ".") }) }) })
|
||||||
|
blocks:extend(el.content)
|
||||||
|
return pandoc.Div(blocks, pandoc.Attr("", { "further" }))
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
{ Meta = read_meta },
|
||||||
|
{ Div = Div },
|
||||||
|
}
|
||||||
@@ -32,9 +32,9 @@ mjx-container a {
|
|||||||
padding: 0.5rem 0.75rem;
|
padding: 0.5rem 0.75rem;
|
||||||
border: 1px solid var(--calc-notecolor, #B45309);
|
border: 1px solid var(--calc-notecolor, #B45309);
|
||||||
border-radius: 0.4rem;
|
border-radius: 0.4rem;
|
||||||
background: var(--bs-body-bg, #fff);
|
background: var(--calc-surface, #fff);
|
||||||
color: var(--bs-body-color, #1a1a1a);
|
color: var(--bs-body-color, #1a1a1a);
|
||||||
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
|
box-shadow: 0 4px 14px var(--calc-shadow, rgba(0, 0, 0, 0.15));
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
}
|
}
|
||||||
@@ -62,8 +62,7 @@ mjx-container a {
|
|||||||
scroll-margin-top: 5rem;
|
scroll-margin-top: 5rem;
|
||||||
}
|
}
|
||||||
.gls-back {
|
.gls-back {
|
||||||
font-size: 0.85em;
|
font-size: 0.85em; /* smaller, not fainter: at 0.75 opacity the link read 3.4:1 */
|
||||||
opacity: 0.75;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* standalone property cards keep the section flow (no indent) */
|
/* standalone property cards keep the section flow (no indent) */
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
--
|
--
|
||||||
-- Usage (works for entries and properties):
|
-- Usage (works for entries and properties):
|
||||||
-- in math: \gls{laplacian} \gls{laplacian.linearity}
|
-- in math: \gls{laplacian} \gls{laplacian.linearity}
|
||||||
|
-- \gls[\nabla^2 g]{laplacian} (shows a variant, links to the entry)
|
||||||
-- in prose: [laplacian]{.gls} [by linearity]{.gls key=laplacian.linearity}
|
-- in prose: [laplacian]{.gls} [by linearity]{.gls key=laplacian.linearity}
|
||||||
-- the list: ::: {.glossary}\n:::
|
-- the list: ::: {.glossary}\n:::
|
||||||
--
|
--
|
||||||
@@ -330,7 +331,11 @@ local function register_inline(el)
|
|||||||
if b.t == "Div" and b.classes:includes("gls-prop") then
|
if b.t == "Div" and b.classes:includes("gls-prop") then
|
||||||
local pk = b.attributes.key
|
local pk = b.attributes.key
|
||||||
if pk == nil then
|
if pk == nil then
|
||||||
io.stderr:write("[glossary] .gls-prop without key= (in " .. key .. ")\n")
|
-- keep the text: it stays in the definition, unlisted as a property
|
||||||
|
io.stderr:write("[glossary] WARNING: .gls-prop without key= in '" .. key
|
||||||
|
.. "': its text is kept in the definition but is not listed as a"
|
||||||
|
.. " property; add key=<name> to list it\n")
|
||||||
|
entry.def:extend(b.content)
|
||||||
else
|
else
|
||||||
entry.props[pk] = {
|
entry.props[pk] = {
|
||||||
sym = math_of_attr(b.attributes.symbol),
|
sym = math_of_attr(b.attributes.symbol),
|
||||||
@@ -356,21 +361,30 @@ end
|
|||||||
|
|
||||||
------------------------------------------------------------------ pass 3: usages & rendering
|
------------------------------------------------------------------ pass 3: usages & rendering
|
||||||
|
|
||||||
-- rewrite \gls{...} occurrences inside a TeX/math string
|
-- rewrite \gls{key} and \gls[shown]{key} occurrences inside a TeX/math
|
||||||
|
-- string. The optional [shown] is what the formula displays instead of the
|
||||||
|
-- entry's own symbol -- a variant of it, M_{n \times p}(\mathbb{K}) for the
|
||||||
|
-- entry M_{m \times n}(\mathbb{K}) -- and it links to the entry all the same.
|
||||||
|
local function gls_link(key, shown, target)
|
||||||
|
local r = resolve(key)
|
||||||
|
if r == nil then
|
||||||
|
warn_key(key)
|
||||||
|
return "\\text{??" .. key .. "??}"
|
||||||
|
end
|
||||||
|
local disp = shown or math_display(r)
|
||||||
|
if target == "latex" then
|
||||||
|
-- \protect: a link may sit in a moving argument (a figure caption)
|
||||||
|
return "\\protect\\hyperlink{" .. r.id .. "}{" .. disp .. "}"
|
||||||
|
end
|
||||||
|
return "\\href{" .. r.href .. "}{\\class{gls-sym gls-key-" .. key .. "}{" .. disp .. "}}"
|
||||||
|
end
|
||||||
|
|
||||||
local function replace_gls(txt, target)
|
local function replace_gls(txt, target)
|
||||||
|
txt = txt:gsub("\\gls%s*(%b[])%s*(%b{})", function(bracketed, braced)
|
||||||
|
return gls_link(braced:sub(2, -2), bracketed:sub(2, -2), target)
|
||||||
|
end)
|
||||||
return (txt:gsub("\\gls(%b{})", function(braced)
|
return (txt:gsub("\\gls(%b{})", function(braced)
|
||||||
local key = braced:sub(2, -2)
|
return gls_link(braced:sub(2, -2), nil, target)
|
||||||
local r = resolve(key)
|
|
||||||
if r == nil then
|
|
||||||
warn_key(key)
|
|
||||||
return "\\text{??" .. key .. "??}"
|
|
||||||
end
|
|
||||||
local disp = math_display(r)
|
|
||||||
if target == "latex" then
|
|
||||||
return "\\hyperlink{" .. r.id .. "}{" .. disp .. "}"
|
|
||||||
else
|
|
||||||
return "\\href{" .. r.href .. "}{\\class{gls-sym gls-key-" .. key .. "}{" .. disp .. "}}"
|
|
||||||
end
|
|
||||||
end))
|
end))
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -397,7 +411,7 @@ local function usage(key, display)
|
|||||||
end
|
end
|
||||||
local out = pandoc.Inlines({})
|
local out = pandoc.Inlines({})
|
||||||
if fmt_is("latex") then
|
if fmt_is("latex") then
|
||||||
out:insert(pandoc.RawInline("latex", "\\hyperlink{" .. r.id .. "}{"))
|
out:insert(pandoc.RawInline("latex", "\\protect\\hyperlink{" .. r.id .. "}{"))
|
||||||
out:extend(display)
|
out:extend(display)
|
||||||
out:insert(pandoc.RawInline("latex", "}"))
|
out:insert(pandoc.RawInline("latex", "}"))
|
||||||
elseif fmt_is("html") then
|
elseif fmt_is("html") then
|
||||||
@@ -436,6 +450,8 @@ end
|
|||||||
|
|
||||||
local function RawInline(el)
|
local function RawInline(el)
|
||||||
if el.format ~= "tex" and el.format ~= "latex" then return nil end
|
if el.format ~= "tex" and el.format ~= "latex" then return nil end
|
||||||
|
-- (no [shown] form here: pandoc reads \gls[..]{..} in prose as plain text,
|
||||||
|
-- never as raw tex; a variant in prose is [$...$]{.gls key=...})
|
||||||
local key = el.text:match("^\\gls%s*{(.-)}$")
|
local key = el.text:match("^\\gls%s*{(.-)}$")
|
||||||
if key == nil then return nil end
|
if key == nil then return nil end
|
||||||
local r = resolve(key)
|
local r = resolve(key)
|
||||||
@@ -443,6 +459,15 @@ local function RawInline(el)
|
|||||||
return usage(key, pandoc.Inlines({ pandoc.Math("InlineMath", math_display(r)) }))
|
return usage(key, pandoc.Inlines({ pandoc.Math("InlineMath", math_display(r)) }))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- A definition is stored in pass 2, before its own usages are resolved: run
|
||||||
|
-- them on the stored copy wherever it is shown (in place, in the list, in
|
||||||
|
-- the tooltip data and the cross-file cache), or a \gls{..} / [..]{.gls}
|
||||||
|
-- written inside a definition would come out unresolved.
|
||||||
|
local function resolved(blocks)
|
||||||
|
if blocks == nil then return blocks end
|
||||||
|
return blocks:walk({ Math = Math, RawBlock = RawBlock, RawInline = RawInline, Span = Span })
|
||||||
|
end
|
||||||
|
|
||||||
-- head line "sym — **term**" (+ latex hypertarget when with_anchor)
|
-- head line "sym — **term**" (+ latex hypertarget when with_anchor)
|
||||||
local function head_line(id, sym, term, with_anchor)
|
local function head_line(id, sym, term, with_anchor)
|
||||||
local head = pandoc.Inlines({})
|
local head = pandoc.Inlines({})
|
||||||
@@ -460,7 +485,7 @@ end
|
|||||||
local function prop_div(base, pk, p, with_anchor)
|
local function prop_div(base, pk, p, with_anchor)
|
||||||
local id = anchor(base .. "." .. pk)
|
local id = anchor(base .. "." .. pk)
|
||||||
local blocks = pandoc.Blocks({ head_line(id, p.sym, p.term, with_anchor) })
|
local blocks = pandoc.Blocks({ head_line(id, p.sym, p.term, with_anchor) })
|
||||||
blocks:extend(p.def:clone())
|
blocks:extend(resolved(p.def:clone()))
|
||||||
return pandoc.Div(blocks,
|
return pandoc.Div(blocks,
|
||||||
pandoc.Attr(with_anchor and id or "", { "gls-entry", "gls-prop-entry" }))
|
pandoc.Attr(with_anchor and id or "", { "gls-entry", "gls-prop-entry" }))
|
||||||
end
|
end
|
||||||
@@ -473,7 +498,7 @@ local function render_inline_def(el)
|
|||||||
if e == nil or not e.inline then return nil end
|
if e == nil or not e.inline then return nil end
|
||||||
local id = anchor(key)
|
local id = anchor(key)
|
||||||
local blocks = pandoc.Blocks({ head_line(id, e.sym, e.term, true) })
|
local blocks = pandoc.Blocks({ head_line(id, e.sym, e.term, true) })
|
||||||
blocks:extend(e.def:clone())
|
blocks:extend(resolved(e.def:clone()))
|
||||||
for _, pk in ipairs(e.porder) do
|
for _, pk in ipairs(e.porder) do
|
||||||
if not e.props[pk].standalone then -- standalone props render at their own spot
|
if not e.props[pk].standalone then -- standalone props render at their own spot
|
||||||
blocks:insert(prop_div(key, pk, e.props[pk], true))
|
blocks:insert(prop_div(key, pk, e.props[pk], true))
|
||||||
@@ -493,7 +518,7 @@ local function render_list(el)
|
|||||||
-- the list clone links back instead of re-anchoring
|
-- the list clone links back instead of re-anchoring
|
||||||
local with_anchor = not e.inline
|
local with_anchor = not e.inline
|
||||||
local entry = pandoc.Blocks({ head_line(id, e.sym, e.term, with_anchor) })
|
local entry = pandoc.Blocks({ head_line(id, e.sym, e.term, with_anchor) })
|
||||||
entry:extend(e.def:clone())
|
entry:extend(resolved(e.def:clone()))
|
||||||
if e.inline then
|
if e.inline then
|
||||||
for _, pk in ipairs(e.porder) do
|
for _, pk in ipairs(e.porder) do
|
||||||
local p = e.props[pk]
|
local p = e.props[pk]
|
||||||
@@ -610,11 +635,11 @@ local function write_cache()
|
|||||||
for pk, p in pairs(e.props) do
|
for pk, p in pairs(e.props) do
|
||||||
props[pk] = { sym = p.sym,
|
props[pk] = { sym = p.sym,
|
||||||
term = pandoc.utils.stringify(p.term),
|
term = pandoc.utils.stringify(p.term),
|
||||||
def_html = blocks_to_html(p.def) }
|
def_html = blocks_to_html(resolved(p.def)) }
|
||||||
end
|
end
|
||||||
entries[key] = { sym = e.sym,
|
entries[key] = { sym = e.sym,
|
||||||
term = pandoc.utils.stringify(e.term),
|
term = pandoc.utils.stringify(e.term),
|
||||||
def_html = blocks_to_html(e.def),
|
def_html = blocks_to_html(resolved(e.def)),
|
||||||
page = current_page,
|
page = current_page,
|
||||||
props = props }
|
props = props }
|
||||||
end
|
end
|
||||||
@@ -645,13 +670,23 @@ local function inject_data(doc)
|
|||||||
if not fmt_is("html") then return doc end
|
if not fmt_is("html") then return doc end
|
||||||
write_cache()
|
write_cache()
|
||||||
if quarto == nil or quarto.doc == nil then return doc end
|
if quarto == nil or quarto.doc == nil then return doc end
|
||||||
|
-- in sorted order: pairs() walks a table in a different order on every
|
||||||
|
-- run, which rewrote every page of a book on each rebuild
|
||||||
|
local function sorted_keys(t)
|
||||||
|
local ks = {}
|
||||||
|
for k in pairs(t) do ks[#ks + 1] = k end
|
||||||
|
table.sort(ks)
|
||||||
|
return ks
|
||||||
|
end
|
||||||
local parts = {}
|
local parts = {}
|
||||||
for key, e in pairs(glossary) do
|
for _, key in ipairs(sorted_keys(glossary)) do
|
||||||
|
local e = glossary[key]
|
||||||
parts[#parts + 1] = '"' .. js_escape(key) .. '":"'
|
parts[#parts + 1] = '"' .. js_escape(key) .. '":"'
|
||||||
.. js_escape(head_html(e.sym, e.term) .. blocks_to_html(e.def)) .. '"'
|
.. js_escape(head_html(e.sym, e.term) .. blocks_to_html(resolved(e.def))) .. '"'
|
||||||
for pk, p in pairs(e.props) do
|
for _, pk in ipairs(sorted_keys(e.props)) do
|
||||||
|
local p = e.props[pk]
|
||||||
parts[#parts + 1] = '"' .. js_escape(key .. "." .. pk) .. '":"'
|
parts[#parts + 1] = '"' .. js_escape(key .. "." .. pk) .. '":"'
|
||||||
.. js_escape(head_html(p.sym, p.term) .. blocks_to_html(p.def)) .. '"'
|
.. js_escape(head_html(p.sym, p.term) .. blocks_to_html(resolved(p.def))) .. '"'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if #parts == 0 then return doc end
|
if #parts == 0 then return doc end
|
||||||
|
|||||||
@@ -0,0 +1,316 @@
|
|||||||
|
/* high-contrast.css — the high-contrast pair, taken from GitHub's
|
||||||
|
"GitHub Light High Contrast" and "GitHub Dark High Contrast" VS Code
|
||||||
|
themes (the Primer `light_high_contrast` / `dark_high_contrast` scales).
|
||||||
|
|
||||||
|
It is switched by `hc` on <html>, which calc-notes.lua sets from
|
||||||
|
|
||||||
|
high-contrast: true
|
||||||
|
|
||||||
|
in the document metadata, and which the same in-header script sets for a
|
||||||
|
reader whose system asks for `prefers-contrast: more`. One class rather
|
||||||
|
than a class and a media query, so the palette below is written once.
|
||||||
|
|
||||||
|
It rides on top of the ordinary light/dark pair: `html.hc` restyles the
|
||||||
|
light theme, `html.hc body.quarto-dark` the night one, so the reader's own
|
||||||
|
light/dark toggle keeps working.
|
||||||
|
|
||||||
|
GitHub's two high-contrast themes separate things by outline rather than by
|
||||||
|
fill: text sits at full strength (fg.muted == fg.default), borders are
|
||||||
|
strong, and the tinted panels of the ordinary themes lose their tint. The
|
||||||
|
rules here do the same to the notes environments. */
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------- light -- */
|
||||||
|
html.hc {
|
||||||
|
/* Primer light_high_contrast */
|
||||||
|
--hc-canvas: #ffffff; /* canvas.default */
|
||||||
|
--hc-inset: #ffffff; /* canvas.inset — separation is by border */
|
||||||
|
--hc-fg: #0e1116; /* fg.default, and fg.muted, which equals it */
|
||||||
|
--hc-subtle: #66707b; /* fg.subtle — the only softened ink */
|
||||||
|
--hc-border: #20252c; /* border.default */
|
||||||
|
--hc-border-soft: #88929d; /* border.muted */
|
||||||
|
--hc-accent: #0349b4; /* accent.fg */
|
||||||
|
--hc-danger: #a0111f; /* danger.fg */
|
||||||
|
--hc-success: #055d20; /* success.fg */
|
||||||
|
--hc-attention: #4e2c00; /* attention.fg */
|
||||||
|
--hc-severe: #702c00; /* severe.fg */
|
||||||
|
--hc-done: #622cbc; /* done.fg */
|
||||||
|
|
||||||
|
/* the extension's own tokens */
|
||||||
|
--calc-ink: var(--hc-fg);
|
||||||
|
--calc-muted: var(--hc-fg);
|
||||||
|
--calc-line: var(--hc-border);
|
||||||
|
--calc-grid: var(--hc-border-soft);
|
||||||
|
--calc-accent-a: var(--hc-accent);
|
||||||
|
--calc-accent-b: var(--hc-severe);
|
||||||
|
--calc-accent-c: var(--hc-success);
|
||||||
|
--calc-danger: var(--hc-danger);
|
||||||
|
--calc-surface: var(--hc-canvas);
|
||||||
|
--calc-faint: var(--hc-border-soft);
|
||||||
|
--calc-shadow: rgba(14, 17, 22, 0.4);
|
||||||
|
--calc-domface: var(--hc-canvas);
|
||||||
|
--calc-domtop: #d8dee4;
|
||||||
|
--calc-notecolor: var(--hc-attention);
|
||||||
|
--calc-furthercolor: var(--hc-done);
|
||||||
|
|
||||||
|
/* the page itself */
|
||||||
|
--bs-body-bg: var(--hc-canvas);
|
||||||
|
--bs-body-color: var(--hc-fg);
|
||||||
|
--bs-emphasis-color: var(--hc-fg);
|
||||||
|
--bs-secondary-color: var(--hc-fg);
|
||||||
|
--bs-tertiary-color: var(--hc-subtle);
|
||||||
|
--bs-border-color: var(--hc-border);
|
||||||
|
--bs-link-color: var(--hc-accent);
|
||||||
|
--bs-link-hover-color: var(--hc-accent);
|
||||||
|
--bs-code-color: var(--hc-fg);
|
||||||
|
--bs-heading-color: var(--hc-fg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------- dark -- */
|
||||||
|
html.hc body.quarto-dark {
|
||||||
|
/* Primer dark_high_contrast, except for the canvas: the theme's own
|
||||||
|
#0a0c10 still reads as a very dark grey next to a black one, so the page
|
||||||
|
goes fully black and every other value keeps its relation to it. */
|
||||||
|
--hc-canvas: #000000; /* canvas.default is #0a0c10 upstream */
|
||||||
|
--hc-inset: #000000; /* canvas.inset */
|
||||||
|
--hc-subtle-bg: #272b33; /* canvas.subtle */
|
||||||
|
--hc-fg: #f0f3f6; /* fg.default == fg.muted */
|
||||||
|
--hc-subtle: #9ea7b3; /* fg.subtle */
|
||||||
|
--hc-border: #7a828e; /* border.default */
|
||||||
|
--hc-border-soft: #7a828e; /* border.muted — the same in this theme */
|
||||||
|
--hc-accent: #71b7ff; /* accent.fg */
|
||||||
|
--hc-danger: #ff9492; /* danger.fg */
|
||||||
|
--hc-success: #26cd4d; /* success.fg */
|
||||||
|
--hc-attention: #f0b72f; /* attention.fg */
|
||||||
|
--hc-severe: #ff803d; /* severe.fg */
|
||||||
|
--hc-done: #cb9eff; /* done.fg */
|
||||||
|
|
||||||
|
/* a stroke on near-black wants the text colour, not the border grey */
|
||||||
|
--calc-line: var(--hc-fg);
|
||||||
|
--calc-grid: var(--hc-border);
|
||||||
|
--calc-domface: var(--hc-subtle-bg);
|
||||||
|
--calc-domtop: #3d444d;
|
||||||
|
--calc-shadow: rgba(1, 4, 9, 0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the tokens that only alias, so they follow whichever block is in force */
|
||||||
|
html.hc body.quarto-dark {
|
||||||
|
--calc-ink: var(--hc-fg);
|
||||||
|
--calc-muted: var(--hc-fg);
|
||||||
|
--calc-accent-a: var(--hc-accent);
|
||||||
|
--calc-accent-b: var(--hc-severe);
|
||||||
|
--calc-accent-c: var(--hc-success);
|
||||||
|
--calc-danger: var(--hc-danger);
|
||||||
|
--calc-surface: var(--hc-canvas);
|
||||||
|
--calc-faint: var(--hc-border);
|
||||||
|
--calc-notecolor: var(--hc-attention);
|
||||||
|
--calc-furthercolor: var(--hc-done);
|
||||||
|
|
||||||
|
--bs-body-bg: var(--hc-canvas);
|
||||||
|
--bs-body-color: var(--hc-fg);
|
||||||
|
--bs-emphasis-color: var(--hc-fg);
|
||||||
|
--bs-secondary-color: var(--hc-fg);
|
||||||
|
--bs-tertiary-color: var(--hc-subtle);
|
||||||
|
--bs-border-color: var(--hc-border);
|
||||||
|
--bs-link-color: var(--hc-accent);
|
||||||
|
--bs-link-hover-color: var(--hc-accent);
|
||||||
|
--bs-code-color: var(--hc-fg);
|
||||||
|
--bs-heading-color: var(--hc-fg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------- page chrome -- */
|
||||||
|
/* Quarto's own furniture is compiled from the bootswatch theme, so the
|
||||||
|
variables above do not reach all of it. */
|
||||||
|
html.hc body {
|
||||||
|
background-color: var(--hc-canvas);
|
||||||
|
color: var(--hc-fg);
|
||||||
|
}
|
||||||
|
html.hc :is(h1, h2, h3, h4, h5, h6, p, li, dt, dd, caption, figcaption, th, td) {
|
||||||
|
color: var(--hc-fg);
|
||||||
|
}
|
||||||
|
html.hc :is(.text-muted, .quarto-figure figcaption, figcaption.figure-caption,
|
||||||
|
.quarto-title-meta-heading, .quarto-title-meta-contents,
|
||||||
|
.callout-title-container, .footnotes) {
|
||||||
|
color: var(--hc-fg);
|
||||||
|
}
|
||||||
|
html.hc a:not(.nav-link):not(.sidebar-item-text) { color: var(--hc-accent); }
|
||||||
|
html.hc a:focus-visible,
|
||||||
|
html.hc button:focus-visible,
|
||||||
|
html.hc summary:focus-visible { outline: 2px solid var(--hc-accent); outline-offset: 2px; }
|
||||||
|
|
||||||
|
html.hc :is(#quarto-sidebar, #quarto-margin-sidebar, .sidebar, .sidebar-navigation,
|
||||||
|
#quarto-header, .navbar, .quarto-secondary-nav) {
|
||||||
|
background-color: var(--hc-canvas);
|
||||||
|
color: var(--hc-fg);
|
||||||
|
border-color: var(--hc-border);
|
||||||
|
}
|
||||||
|
html.hc :is(.sidebar-item-text, .sidebar .nav-link, nav[role="doc-toc"] a, .navbar .nav-link,
|
||||||
|
.quarto-secondary-nav .nav-link) {
|
||||||
|
color: var(--hc-fg);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
html.hc .sidebar nav[role="doc-toc"] ul > li > a,
|
||||||
|
html.hc .sidebar-navigation .sidebar-item a,
|
||||||
|
html.hc .sidebar-navigation .sidebar-item .sidebar-item-text {
|
||||||
|
color: var(--hc-fg);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
/* the active entry: Quarto writes its colour with !important, so this is the
|
||||||
|
one place the palette has to answer in kind */
|
||||||
|
html.hc .sidebar nav[role="doc-toc"] ul > li > a.active,
|
||||||
|
html.hc .sidebar nav[role="doc-toc"] ul > li > ul > li > a.active,
|
||||||
|
html.hc .sidebar nav[role="doc-toc"] ul > li > a:hover,
|
||||||
|
html.hc .sidebar-navigation .sidebar-item a.active,
|
||||||
|
html.hc .sidebar-navigation .sidebar-item a:hover {
|
||||||
|
color: var(--hc-accent) !important;
|
||||||
|
border-left-color: var(--hc-accent);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
html.hc nav[role="doc-toc"] { border-left: 1px solid var(--hc-border-soft); }
|
||||||
|
/* the breadcrumb of the collapsed header carries its own fill in both
|
||||||
|
bootswatch themes, and its ink is the weakest contrast on the page */
|
||||||
|
html.hc .breadcrumb {
|
||||||
|
background-color: var(--hc-canvas);
|
||||||
|
border: 1px solid var(--hc-border);
|
||||||
|
}
|
||||||
|
html.hc :is(.breadcrumb, .breadcrumb-item, .breadcrumb-item a, .quarto-btn-toggle) {
|
||||||
|
color: var(--hc-fg);
|
||||||
|
}
|
||||||
|
html.hc .breadcrumb-item a { color: var(--hc-accent); }
|
||||||
|
html.hc :is(hr, .quarto-title-block .quarto-title-banner, header#title-block-header) {
|
||||||
|
border-color: var(--hc-border);
|
||||||
|
}
|
||||||
|
html.hc hr { background-color: var(--hc-border); opacity: 1; }
|
||||||
|
html.hc blockquote {
|
||||||
|
border-left: 4px solid var(--hc-border);
|
||||||
|
color: var(--hc-fg);
|
||||||
|
}
|
||||||
|
html.hc :is(table, th, td) { border-color: var(--hc-border-soft); }
|
||||||
|
html.hc thead { border-bottom: 2px solid var(--hc-border); }
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------- code ----- */
|
||||||
|
/* GitHub's high-contrast themes give a block an outline instead of a fill. */
|
||||||
|
html.hc :is(pre, div.sourceCode, pre.sourceCode) {
|
||||||
|
background-color: var(--hc-inset);
|
||||||
|
border: 1px solid var(--hc-border);
|
||||||
|
color: var(--hc-fg);
|
||||||
|
}
|
||||||
|
html.hc :not(pre) > code {
|
||||||
|
background-color: var(--hc-inset);
|
||||||
|
border: 1px solid var(--hc-border-soft);
|
||||||
|
border-radius: 3px;
|
||||||
|
color: var(--hc-fg);
|
||||||
|
padding: 0 0.2em;
|
||||||
|
}
|
||||||
|
html.hc code { color: var(--hc-fg); }
|
||||||
|
|
||||||
|
/* the syntax palette of the same two themes, mapped onto pandoc's classes */
|
||||||
|
html.hc code span:is(.co, .cv, .do, .an, .in) { color: var(--hc-subtle); font-style: italic; }
|
||||||
|
html.hc code span:is(.kw, .cf) { color: var(--hc-danger); }
|
||||||
|
html.hc code span:is(.st, .ch, .sc, .ss, .vs){ color: #032563; }
|
||||||
|
html.hc code span:is(.dv, .bn, .fl, .cn) { color: #023b95; }
|
||||||
|
html.hc code span:is(.fu, .ex) { color: #512598; }
|
||||||
|
html.hc code span:is(.va, .at) { color: var(--hc-severe); }
|
||||||
|
html.hc code span:is(.dt, .bu) { color: var(--hc-success); }
|
||||||
|
html.hc code span:is(.im, .pp) { color: var(--hc-severe); }
|
||||||
|
html.hc code span:is(.er, .wa, .al) { color: var(--hc-danger); font-weight: 600; }
|
||||||
|
html.hc code span:is(.op, .ot) { color: var(--hc-fg); }
|
||||||
|
|
||||||
|
html.hc body.quarto-dark code span:is(.st, .ch, .sc, .ss, .vs) { color: #addcff; }
|
||||||
|
html.hc body.quarto-dark code span:is(.dv, .bn, .fl, .cn) { color: #91cbff; }
|
||||||
|
html.hc body.quarto-dark code span:is(.fu, .ex) { color: #dbb7ff; }
|
||||||
|
html.hc body.quarto-dark code span:is(.co, .cv, .do, .an, .in) { color: #bdc4cc; }
|
||||||
|
|
||||||
|
/* ------------------------------------------- the notes environments ----- */
|
||||||
|
/* out goes the tint; the outline carries the box, at full accent strength */
|
||||||
|
html.hc :is(.exo, .further, .quiz, .gls-inline, .gls-float, .calc-note,
|
||||||
|
.exo-sol, .exo-hint, .quiz-opt) {
|
||||||
|
background: var(--hc-canvas);
|
||||||
|
}
|
||||||
|
html.hc .exo { border-color: var(--calc-notecolor); }
|
||||||
|
html.hc :is(.exo-sol, .exo-hint) { border-color: var(--calc-notecolor); }
|
||||||
|
html.hc .exo-head strong,
|
||||||
|
html.hc .exo-hint > summary { color: var(--calc-notecolor); }
|
||||||
|
html.hc .further { border-color: var(--calc-furthercolor); }
|
||||||
|
html.hc .gls-float { border-color: var(--calc-notecolor); box-shadow: 0 4px 14px var(--calc-shadow); }
|
||||||
|
html.hc :is(.gls-inline, .calc-note) { border-left-width: 4px; }
|
||||||
|
html.hc .gls-sym { text-decoration-color: var(--calc-notecolor); }
|
||||||
|
html.hc .quiz { --quiz-ok: var(--hc-success); --quiz-bad: var(--hc-danger); --quiz-ink: var(--hc-fg); }
|
||||||
|
html.hc :is(.quiz-opt.quiz-ok, .quiz-opt.quiz-bad) { background: var(--hc-canvas); }
|
||||||
|
html.hc .quiz-opt.quiz-ok { outline: 2px solid var(--hc-success); }
|
||||||
|
html.hc .quiz-opt.quiz-bad { outline: 2px solid var(--hc-danger); }
|
||||||
|
|
||||||
|
/* Quarto's own callouts, so a page does not mix outlined boxes with filled
|
||||||
|
ones; the callout keeps its colour, in its left bar and its title */
|
||||||
|
html.hc .callout {
|
||||||
|
background-color: var(--hc-canvas) !important;
|
||||||
|
border: 1px solid var(--hc-border);
|
||||||
|
}
|
||||||
|
html.hc .callout > .callout-header {
|
||||||
|
background-color: var(--hc-canvas) !important;
|
||||||
|
border-bottom: 1px solid var(--hc-border-soft);
|
||||||
|
}
|
||||||
|
html.hc :is(.callout-body, .callout-title-container, .callout-body-container p) {
|
||||||
|
color: var(--hc-fg);
|
||||||
|
}
|
||||||
|
html.hc .callout.callout-style-default > div.callout-header { font-weight: 600; }
|
||||||
|
|
||||||
|
/* Quarto's search box: its widget is not themed by the bootswatch pair, so it
|
||||||
|
stays white on a dark page unless it is told otherwise (see theme.css) */
|
||||||
|
html.hc :is(.aa-Form, .aa-InputWrapper, .aa-Panel, .aa-Item) {
|
||||||
|
background-color: var(--hc-canvas);
|
||||||
|
color: var(--hc-fg);
|
||||||
|
border-color: var(--hc-border);
|
||||||
|
}
|
||||||
|
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
|
||||||
|
.aa-Form .aa-InputWrapper .aa-Input,
|
||||||
|
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
|
||||||
|
.aa-Form .aa-InputWrapperSuffix .aa-ClearButton,
|
||||||
|
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
|
||||||
|
.aa-Form .aa-InputWrapperPrefix :is(.aa-Label, .aa-LoadingIndicator) svg {
|
||||||
|
color: var(--hc-fg);
|
||||||
|
}
|
||||||
|
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
|
||||||
|
.aa-Form .aa-InputWrapper .aa-Input::placeholder {
|
||||||
|
color: var(--hc-fg);
|
||||||
|
opacity: 0.75;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the results panel: Quarto colours the cards through an id, so this does too */
|
||||||
|
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item .search-item,
|
||||||
|
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item .search-item
|
||||||
|
:is(.search-result-title-container, .search-result-text-container,
|
||||||
|
.search-result-section, .search-result-text, .search-result-more) {
|
||||||
|
background-color: var(--hc-canvas);
|
||||||
|
color: var(--hc-fg);
|
||||||
|
}
|
||||||
|
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item[aria-selected="true"] .search-item,
|
||||||
|
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item[aria-selected="true"] .search-item
|
||||||
|
:is(.search-result-title-container, .search-result-text-container,
|
||||||
|
.search-result-section, .search-result-text, .search-result-more) {
|
||||||
|
background-color: var(--hc-accent);
|
||||||
|
color: var(--hc-canvas);
|
||||||
|
}
|
||||||
|
/* a hit is marked by weight and a rule, not by a block of colour */
|
||||||
|
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item .search-item
|
||||||
|
:is(mark.search-match, .search-match.mark) {
|
||||||
|
background-color: transparent;
|
||||||
|
color: inherit;
|
||||||
|
font-weight: 700;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the figure buttons of the animated schemes */
|
||||||
|
html.hc :is(.ns-btn, .nc-btn, .nd-replay) {
|
||||||
|
background: var(--hc-canvas);
|
||||||
|
color: var(--hc-fg);
|
||||||
|
border-color: var(--hc-border);
|
||||||
|
}
|
||||||
|
html.hc :is(.notes-spiral, .notes-cantor) :is(.ns-btn, .nc-btn)[aria-pressed="true"] {
|
||||||
|
background: var(--hc-canvas);
|
||||||
|
border-color: var(--hc-accent);
|
||||||
|
color: var(--hc-accent);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the last tinted fills: a calc box and a note keep their outline instead */
|
||||||
|
html.hc :is(.calc-box, .calc-note, .calc-note[open]) { background: transparent; }
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
/* narrow.css — the book on a phone.
|
||||||
|
Nothing in the flow may be wider than the screen: a wide formula, table or
|
||||||
|
figure scrolls inside its own box instead of pushing the whole page
|
||||||
|
sideways (which leaves the text cut off at the left edge).
|
||||||
|
Loaded with calc-notes.css, so every page of every book gets it. */
|
||||||
|
|
||||||
|
/* --- display maths ------------------------------------------------------
|
||||||
|
The boxes of this extension (.calc, .exo, .further) already scroll their
|
||||||
|
own maths; this covers every other display formula on the page. */
|
||||||
|
:is(main, .quarto-title-block) :is(mjx-container[display="true"], .math.display) {
|
||||||
|
max-width: 100%;
|
||||||
|
overflow-x: auto;
|
||||||
|
overflow-y: hidden; /* Firefox computes phantom vertical overflow */
|
||||||
|
padding-bottom: 0.35em; /* keep descenders clear of a scrollbar */
|
||||||
|
/* a centred formula that overflows would hide its left side out of reach,
|
||||||
|
so centre it only while it fits */
|
||||||
|
justify-content: safe center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- everything else that can be wider than a phone ---------------------- */
|
||||||
|
main :is(pre, .sourceCode) { max-width: 100%; overflow-x: auto; }
|
||||||
|
main :is(img, svg) { max-width: 100%; height: auto; }
|
||||||
|
main table:not(.ltx-table) { display: block; max-width: 100%; overflow-x: auto; }
|
||||||
|
|
||||||
|
/* the animated figures of lesson-style chapters */
|
||||||
|
.notes-cantor, .notes-spiral, .notes-dominos { max-width: 100%; overflow-x: auto; }
|
||||||
|
|
||||||
|
/* the glossary popup: never wider than the screen */
|
||||||
|
.gls-float { max-width: min(92vw, 26rem); }
|
||||||
|
|
||||||
|
/* --- phone-sized screens ------------------------------------------------- */
|
||||||
|
@media (max-width: 575.98px) {
|
||||||
|
/* the equation number of a labelled calc block goes under the line, so the
|
||||||
|
formula keeps the full width */
|
||||||
|
.calc { grid-template-columns: max-content 1fr; }
|
||||||
|
|
||||||
|
/* figure captions and the fold summaries read better tight */
|
||||||
|
.exo, .further { padding-left: 0.6rem; padding-right: 0.6rem; }
|
||||||
|
|
||||||
|
/* A bare url in prose, or a long identifier in a code span, is one word to
|
||||||
|
the line breaker and paints past its block on a narrow screen — no
|
||||||
|
element is oversized, so only the text itself overflows. */
|
||||||
|
#quarto-document-content :is(a, code) { overflow-wrap: break-word; }
|
||||||
|
|
||||||
|
/* Quarto lets inline code wrap only inside a <p> (white-space: pre-wrap);
|
||||||
|
in a list item or a table it keeps one line, and a formula such as
|
||||||
|
"{PersN} → {PersN, Name, Position, Room, …}" pushed a page to 947px. */
|
||||||
|
#quarto-document-content :not(pre) > code:not(.sourceCode) { white-space: pre-wrap; }
|
||||||
|
|
||||||
|
/* A long compound in running text — "Unternehmensarchitekturmanagement" in
|
||||||
|
a list item is 348px — has no break opportunity. The page's lang picks
|
||||||
|
the hyphenation dictionary; overflow-wrap is the fallback without one. */
|
||||||
|
#quarto-document-content { hyphens: auto; overflow-wrap: break-word; }
|
||||||
|
|
||||||
|
/* An inline formula MathJax cannot break (one long fraction or product)
|
||||||
|
is wider than a phone: 413px in ModernPhysics' first exercise. It scrolls
|
||||||
|
inside its own box instead of pushing the page; the padding keeps tall
|
||||||
|
glyphs clear of the box's edge. */
|
||||||
|
/* A Bootstrap grid (::: {.grid} with .g-col-* items) has 12 columns and 11
|
||||||
|
gaps of 1.5rem: 264px of gaps alone, more than a callout on a phone
|
||||||
|
(248px in SoftwareEngineering's git appendix), so the columns collapse to
|
||||||
|
0 and a full-width item overflows. A smaller gap keeps the layout;
|
||||||
|
min-width: 0 lets an item's text wrap instead of widening its track. */
|
||||||
|
.grid { --bs-gap: 0.75rem; }
|
||||||
|
.grid > [class*="g-col"] { min-width: 0; }
|
||||||
|
|
||||||
|
#quarto-document-content mjx-container:not([display="true"]) {
|
||||||
|
display: inline-block;
|
||||||
|
max-width: 100%;
|
||||||
|
overflow-x: auto;
|
||||||
|
overflow-y: hidden;
|
||||||
|
vertical-align: middle;
|
||||||
|
padding-block: 0.15em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Quarto's own previous/next footer: the chapter titles are laid out in a
|
||||||
|
row that will not shrink, so a long title pushes the page sideways. */
|
||||||
|
.page-navigation { flex-wrap: wrap; row-gap: 0.75em; }
|
||||||
|
.nav-page, .nav-page .nav-page-text { min-width: 0; }
|
||||||
|
.nav-page .chapter-title { overflow-wrap: break-word; }
|
||||||
|
|
||||||
|
/* A long compound in a heading — "Implementierungsentscheidungen" is 366px
|
||||||
|
at h3 size — is wider than a 320px screen. The page's lang picks the
|
||||||
|
hyphenation dictionary; overflow-wrap is the fallback without one. */
|
||||||
|
#quarto-document-content :is(h1, h2, h3, h4, h5, h6),
|
||||||
|
.quarto-title .title {
|
||||||
|
hyphens: auto;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The bar at the top of a phone page: menu button, the chapter's title,
|
||||||
|
search. The title is a flex item that will not shrink, so a long one
|
||||||
|
("3 Komplexitätsanalyse" in darkly's wider font) pushes the search button
|
||||||
|
off the screen. It now shrinks and ends in an ellipsis. */
|
||||||
|
.quarto-secondary-nav nav.quarto-page-breadcrumbs { min-width: 0; }
|
||||||
|
.quarto-secondary-nav nav.quarto-page-breadcrumbs .breadcrumb {
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.quarto-secondary-nav nav.quarto-page-breadcrumbs .breadcrumb-item {
|
||||||
|
min-width: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -160,12 +160,10 @@
|
|||||||
|
|
||||||
/* ---- dark theme ----------------------------------------------------- */
|
/* ---- dark theme ----------------------------------------------------- */
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
body.quarto-dark .quiz {
|
||||||
.quiz {
|
--quiz-ok: #4cb08a;
|
||||||
--quiz-ok: #4cb08a;
|
--quiz-bad: #e2798f;
|
||||||
--quiz-bad: #e2798f;
|
--quiz-ink: #8b98a8;
|
||||||
--quiz-ink: #8b98a8;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---- print ----------------------------------------------------------
|
/* ---- print ----------------------------------------------------------
|
||||||
|
|||||||
@@ -0,0 +1,240 @@
|
|||||||
|
/* theme.css — one palette for every part of the notes extension, in light
|
||||||
|
mode, in night mode and in high contrast.
|
||||||
|
|
||||||
|
Night mode keys off Quarto's own `body.quarto-dark`, which the light/dark
|
||||||
|
toggle sets — never off `prefers-color-scheme`, so a book configured
|
||||||
|
light-only stays light for a reader whose system is dark.
|
||||||
|
A book opts in with, in _quarto.yml:
|
||||||
|
format:
|
||||||
|
html:
|
||||||
|
theme:
|
||||||
|
light: [cosmo]
|
||||||
|
dark: [darkly]
|
||||||
|
|
||||||
|
High contrast is a separate sheet, high-contrast.css, after GitHub's two
|
||||||
|
high-contrast VS Code themes. It keys off `hc` on <html>, which
|
||||||
|
calc-notes.lua sets from `high-contrast: true` in the metadata and for a
|
||||||
|
reader whose system asks for `prefers-contrast: more`.
|
||||||
|
|
||||||
|
Loaded with calc-notes.css, so every page of every book has these tokens. */
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--calc-ink: #1a1a1a; /* figure text, strong strokes */
|
||||||
|
--calc-muted: #57606a; /* captions, readouts, button text */
|
||||||
|
--calc-line: #444444; /* axes and rules */
|
||||||
|
--calc-grid: #cccccc; /* lattice dots, faint grid */
|
||||||
|
--calc-accent-a: #1F6FB4; /* lineA of the tikz preamble */
|
||||||
|
--calc-accent-b: #D1541F; /* lineB */
|
||||||
|
--calc-accent-c: #2E8B57; /* lineC */
|
||||||
|
--calc-danger: #B91C1C; /* an error state, e.g. a failed code run */
|
||||||
|
--calc-surface: var(--bs-body-bg, #ffffff);
|
||||||
|
--calc-faint: #e7e9ec; /* hairlines between rows */
|
||||||
|
--calc-shadow: rgba(0, 0, 0, 0.15); /* floats above the page */
|
||||||
|
--calc-domface: #DCE7F2; /* the domino figure's front face */
|
||||||
|
--calc-domtop: #B8CFE4; /* its top face */
|
||||||
|
/* --calc-notecolor-src and --calc-furthercolor-src come from the document
|
||||||
|
metadata (calc-notes.lua / further.lua) and are the book's own colours;
|
||||||
|
--calc-notecolor and --calc-furthercolor are what everything draws with,
|
||||||
|
and equal the source here. The dark block lifts them. */
|
||||||
|
}
|
||||||
|
|
||||||
|
body.quarto-dark {
|
||||||
|
--calc-ink: #e6e9ed;
|
||||||
|
--calc-muted: #9aa4b2;
|
||||||
|
--calc-line: #b6bec7;
|
||||||
|
--calc-grid: #4b535d;
|
||||||
|
--calc-accent-a: #6fb0ea;
|
||||||
|
--calc-accent-b: #f0956a;
|
||||||
|
--calc-accent-c: #64c49a;
|
||||||
|
--calc-danger: #f08a8a;
|
||||||
|
--calc-faint: #3a4049;
|
||||||
|
--calc-shadow: rgba(0, 0, 0, 0.55);
|
||||||
|
--calc-domface: #2b3b4d;
|
||||||
|
--calc-domtop: #365070;
|
||||||
|
/* The book's own accent is kept, not replaced: its print value is too dim
|
||||||
|
on a dark ground, so it is lifted to a light tone at the same hue rather
|
||||||
|
than swapped for a generic amber. A book that wants a specific night
|
||||||
|
value sets `notecolor-dark:` / `furthercolor-dark:` in its metadata.
|
||||||
|
On a browser without relative colour syntax the lift is dropped and the
|
||||||
|
book's own colour is used unchanged. */
|
||||||
|
--calc-notecolor:
|
||||||
|
var(--calc-notecolor-dark,
|
||||||
|
oklch(from var(--calc-notecolor-src, #B45309) 0.78 c h));
|
||||||
|
--calc-furthercolor:
|
||||||
|
var(--calc-furthercolor-dark,
|
||||||
|
oklch(from var(--calc-furthercolor-src, #6B3FA0) 0.80 c h));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- generated line art -------------------------------------------------
|
||||||
|
The tikz figures are black-and-colour line drawings on transparent white.
|
||||||
|
Inverting them keeps the drawing readable and, with the hue rotation,
|
||||||
|
keeps blue blue and orange orange. Photographs live under img/ and are
|
||||||
|
left alone; an svg that is a photograph, or that carries its own dark
|
||||||
|
palette, opts out with class="no-invert". */
|
||||||
|
body.quarto-dark main img[src$=".svg"]:not(.no-invert) {
|
||||||
|
filter: invert(1) hue-rotate(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- captions -----------------------------------------------------------
|
||||||
|
Quarto's caption grey reads 4.4:1 on cosmo's white, under WCAG AA. The
|
||||||
|
muted token reads about 6.4:1 in light and in dark, and high contrast
|
||||||
|
makes it the foreground. The list ends with Quarto's most specific caption
|
||||||
|
selector so that :is() gives every entry its weight. */
|
||||||
|
:is(.panel-caption, .figure-caption, .subfigure-caption, .table-caption,
|
||||||
|
figcaption, caption, .margin-caption, .column-margin figcaption,
|
||||||
|
.quarto-layout-cell[data-ref-parent] caption) {
|
||||||
|
color: var(--calc-muted, #57606a);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- breadcrumbs --------------------------------------------------------
|
||||||
|
Quarto greys the current page (#6c757d) and Bootstrap the separators; on
|
||||||
|
darkly's breadcrumb band that reads 2.1:1. The ink token passes in every
|
||||||
|
mode. `body` outweighs Quarto's own selectors; pseudo-elements cannot go
|
||||||
|
inside :is(), hence the separate rule. */
|
||||||
|
body :is(.quarto-title-breadcrumbs .breadcrumb li:last-of-type a,
|
||||||
|
.breadcrumb-item.active) {
|
||||||
|
color: var(--calc-ink, #1a1a1a);
|
||||||
|
}
|
||||||
|
body .breadcrumb-item + .breadcrumb-item::before,
|
||||||
|
body .quarto-secondary-nav nav.quarto-page-breadcrumbs .breadcrumb-item::before,
|
||||||
|
body .quarto-secondary-nav nav.quarto-page-breadcrumbs a {
|
||||||
|
color: var(--calc-ink, #1a1a1a);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Quarto's other greys -----------------------------------------------
|
||||||
|
Quarto hard-codes #6c757d for every fold label (details > summary) and for
|
||||||
|
the previous/next page links, and a mid grey for section numbers: 3.4:1 on
|
||||||
|
darkly, 4.4:1 on cosmo. The muted token reads about 6.4:1 in both, and
|
||||||
|
high contrast makes it the foreground. An exercise hint keeps its accent
|
||||||
|
(.exo-hint > summary outweighs these), and the active entry of the
|
||||||
|
contents still inherits its colour. */
|
||||||
|
body details > summary,
|
||||||
|
body .nav-page a,
|
||||||
|
body .header-section-number {
|
||||||
|
color: var(--calc-muted, #57606a);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Quoted text: Quarto's .blockquote grey is 4.4:1 on cosmo, and it names the
|
||||||
|
paragraphs, so they are named here too. */
|
||||||
|
body :is(blockquote, .blockquote, blockquote p, .blockquote p) {
|
||||||
|
color: var(--calc-muted, #57606a);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Inline code: Bootstrap's pill is #f8f9fa in both themes, so darkly's light
|
||||||
|
code text sat on near-white (1.05:1). The pill is now a faint tint of the
|
||||||
|
page, which keeps each theme's code colour readable, and inherited muted
|
||||||
|
text (code in a caption) too. */
|
||||||
|
body :not(pre) > code:not(.sourceCode) {
|
||||||
|
background-color: color-mix(in srgb, var(--calc-faint, #e7e9ec) 60%,
|
||||||
|
var(--calc-surface, #ffffff));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* A code block inside a tinted box (exercise, hint, solution, "to go
|
||||||
|
further", quiz): Quarto's block ground is 65% opaque, so the tint shows
|
||||||
|
through and a11y-light's keyword red drops to 4.4:1. Here the ground is
|
||||||
|
opaque, and the same light grey as on the page. */
|
||||||
|
body :is(.exo, .exo-hint, .exo-sol, .further, .quiz) div.sourceCode {
|
||||||
|
background-color: color-mix(in srgb, var(--calc-faint, #e7e9ec) 45%,
|
||||||
|
var(--calc-surface, #ffffff));
|
||||||
|
}
|
||||||
|
/* A static (not executed) block also gives its <code> the translucent
|
||||||
|
ground, so the two layers stack and darken it. The block carries the
|
||||||
|
ground; the code inside is transparent, as in an executed cell. */
|
||||||
|
body div.sourceCode > pre > code.sourceCode { background-color: transparent; }
|
||||||
|
|
||||||
|
/* --- Jupyter output: ANSI colours ---------------------------------------
|
||||||
|
A traceback comes out in the notebook's terminal palette, made for a dark
|
||||||
|
terminal: yellow is 1.9:1 and cyan 2.0:1 on the page. Each colour name
|
||||||
|
takes the matching token with a fifth of ink, which keeps the hue and passes
|
||||||
|
in all four modes. IPython's 256-colour spans carry inline styles and no
|
||||||
|
name, so they take the text colour. */
|
||||||
|
body :is(.ansi-black-fg, .ansi-bright-black-fg) { color: var(--calc-ink); }
|
||||||
|
body :is(.ansi-white-fg, .ansi-bright-white-fg) { color: var(--calc-muted); }
|
||||||
|
body :is(.ansi-red-fg, .ansi-bright-red-fg) {
|
||||||
|
color: color-mix(in srgb, var(--calc-danger) 85%, var(--calc-ink));
|
||||||
|
}
|
||||||
|
body :is(.ansi-green-fg, .ansi-bright-green-fg) {
|
||||||
|
color: color-mix(in srgb, var(--calc-accent-c) 75%, var(--calc-ink));
|
||||||
|
}
|
||||||
|
body :is(.ansi-yellow-fg, .ansi-bright-yellow-fg) {
|
||||||
|
color: color-mix(in srgb, var(--calc-accent-b) 75%, var(--calc-ink));
|
||||||
|
}
|
||||||
|
body :is(.ansi-blue-fg, .ansi-bright-blue-fg) {
|
||||||
|
color: color-mix(in srgb, var(--calc-accent-a) 80%, var(--calc-ink));
|
||||||
|
}
|
||||||
|
body :is(.ansi-magenta-fg, .ansi-bright-magenta-fg) {
|
||||||
|
color: color-mix(in srgb, var(--calc-furthercolor) 85%, var(--calc-ink));
|
||||||
|
}
|
||||||
|
body :is(.ansi-cyan-fg, .ansi-bright-cyan-fg) {
|
||||||
|
color: color-mix(in srgb,
|
||||||
|
color-mix(in srgb, var(--calc-accent-a) 50%, var(--calc-accent-c)) 75%,
|
||||||
|
var(--calc-ink));
|
||||||
|
}
|
||||||
|
body .ansi-escaped-output span[style*="color"] { color: inherit !important; }
|
||||||
|
|
||||||
|
/* --- higher contrast ---------------------------------------------------
|
||||||
|
The high-contrast pair lives in high-contrast.css, which is loaded with
|
||||||
|
this file and keys off `hc` on <html>. */
|
||||||
|
|
||||||
|
/* --- Quarto's search box -------------------------------------------------
|
||||||
|
The search widget keeps its own white surface whatever the bootswatch
|
||||||
|
theme says, so on a dark page it is a white slab with dark text. It is
|
||||||
|
given the page's own surface here rather than in each book. */
|
||||||
|
body.quarto-dark :is(.aa-Form, .aa-InputWrapper, .aa-Panel, .aa-Item,
|
||||||
|
.aa-DetachedContainer, .aa-DetachedFormContainer) {
|
||||||
|
background-color: var(--calc-surface, #222);
|
||||||
|
color: var(--calc-ink, #e6e9ed);
|
||||||
|
border-color: var(--calc-faint, #3a4049);
|
||||||
|
}
|
||||||
|
/* The ink inside the form is a separate problem from its surface: Quarto's
|
||||||
|
dark bundle sets the input, its placeholder, the clear button and the
|
||||||
|
magnifier to rgb(45,45,45) through a four-class selector, so a short one
|
||||||
|
loses the cascade and the typed text stays unreadable. The shape below
|
||||||
|
matches Quarto's own, which is the only way to win without !important. */
|
||||||
|
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
|
||||||
|
.aa-Form .aa-InputWrapper .aa-Input,
|
||||||
|
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
|
||||||
|
.aa-Form .aa-InputWrapperSuffix .aa-ClearButton,
|
||||||
|
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
|
||||||
|
.aa-Form .aa-InputWrapperPrefix :is(.aa-Label, .aa-LoadingIndicator) svg {
|
||||||
|
color: var(--calc-ink, #e6e9ed);
|
||||||
|
}
|
||||||
|
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
|
||||||
|
.aa-Form .aa-InputWrapper .aa-Input::placeholder {
|
||||||
|
color: var(--calc-muted, #9aa4b2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- search: the selected result ----------------------------------------
|
||||||
|
Quarto marks it with cosmo's primary (#2780e3) under white text, 3.97:1,
|
||||||
|
and its matched words with a lighter blue, worse still. The same hue at a
|
||||||
|
lower lightness passes. Night mode (darkly's #375a7f, 7.2:1) and high
|
||||||
|
contrast (high-contrast.css) keep their own. */
|
||||||
|
html:not(.hc) body:not(.quarto-dark) :is(.aa-DetachedOverlay, #quarto-search-results)
|
||||||
|
li.aa-Item[aria-selected="true"] :is(.search-item, .search-item *:not(mark, .mark)) {
|
||||||
|
background-color: oklch(from var(--bs-primary, #2780e3) 0.42 c h);
|
||||||
|
}
|
||||||
|
html:not(.hc) body:not(.quarto-dark) :is(.aa-DetachedOverlay, #quarto-search-results)
|
||||||
|
li.aa-Item[aria-selected="true"] .search-item :is(mark.search-match, .search-match.mark) {
|
||||||
|
background-color: oklch(from var(--bs-primary, #2780e3) 0.52 c h);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- the high-contrast switch -------------------------------------------
|
||||||
|
Built by calc-notes.js next to Quarto's light/dark toggle, and styled to
|
||||||
|
sit with it rather than stand out. */
|
||||||
|
.notes-contrast-toggle {
|
||||||
|
background: none;
|
||||||
|
border: 0;
|
||||||
|
color: inherit;
|
||||||
|
line-height: 1;
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 0.85;
|
||||||
|
}
|
||||||
|
.notes-contrast-toggle:hover { opacity: 1; }
|
||||||
|
.notes-contrast-toggle[aria-pressed="true"] {
|
||||||
|
opacity: 1;
|
||||||
|
color: var(--calc-accent-a, #1F6FB4);
|
||||||
|
}
|
||||||
|
.notes-contrast-toggle:focus-visible {
|
||||||
|
outline: 2px solid var(--calc-accent-a, #1F6FB4);
|
||||||
|
outline-offset: 2px;
|
||||||
|
}
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
nothing is attached to the links themselves: one capture-phase listener on
|
nothing is attached to the links themselves: one capture-phase listener on
|
||||||
the document reads the link's final address at click time.
|
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:
|
If a language has not been built, its pages do not exist:
|
||||||
the target is checked first and a short note is shown instead of a
|
the target is checked first and a short note is shown instead of a
|
||||||
"Not Found" page.
|
"Not Found" page.
|
||||||
|
|
||||||
@@ -26,12 +26,9 @@
|
|||||||
var ROOT_LANG = 'en'; // the language at the top of _book/
|
var ROOT_LANG = 'en'; // the language at the top of _book/
|
||||||
var COOKIE = 'notes-lang';
|
var COOKIE = 'notes-lang';
|
||||||
var NOTE = {
|
var NOTE = {
|
||||||
de: 'Diese Sprache wurde noch nicht erstellt. Einmal ./render-all.sh ausführen – '
|
de: 'Diese Sprache ist hier noch nicht verfügbar.',
|
||||||
+ 'danach funktioniert der Wechsel auch in der Vorschau.',
|
fr: 'Cette langue n’est pas encore disponible ici.',
|
||||||
fr: 'Cette langue n’a pas encore été générée. Lancez une fois ./render-all.sh : '
|
en: 'This language is not available here yet.'
|
||||||
+ '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);
|
var here = (document.documentElement.lang || ROOT_LANG).slice(0, 2);
|
||||||
@@ -45,9 +42,20 @@
|
|||||||
var m = document.cookie.match(/(?:^|;\s*)notes-lang=(de|fr|en)(?:;|$)/);
|
var m = document.cookie.match(/(?:^|;\s*)notes-lang=(de|fr|en)(?:;|$)/);
|
||||||
return m ? m[1] : null;
|
return m ? m[1] : null;
|
||||||
}
|
}
|
||||||
|
// path '/' on purpose: every book of these notes is served from one host,
|
||||||
|
// each under its own folder, so a language picked in any of them is the
|
||||||
|
// language all of them open in. A book hosted on its own would be no worse
|
||||||
|
// off -- the cookie simply has nothing else to reach.
|
||||||
|
var COOKIE_PATH = '/';
|
||||||
function remember(code) {
|
function remember(code) {
|
||||||
document.cookie = COOKIE + '=' + code + '; path=' + root + '; max-age=31536000; SameSite=Lax'
|
document.cookie = COOKIE + '=' + code + '; path=' + COOKIE_PATH
|
||||||
|
+ '; max-age=31536000; SameSite=Lax'
|
||||||
+ (location.protocol === 'https:' ? '; Secure' : '');
|
+ (location.protocol === 'https:' ? '; Secure' : '');
|
||||||
|
// a copy written under the book's own path by an earlier version would be
|
||||||
|
// the more specific one and would shadow the shared cookie for good
|
||||||
|
if (root !== COOKIE_PATH) {
|
||||||
|
document.cookie = COOKIE + '=; path=' + root + '; max-age=0';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// a returning reader lands in the language picked last time
|
// a returning reader lands in the language picked last time
|
||||||
@@ -69,7 +77,11 @@
|
|||||||
box.style.cssText = 'position:fixed;left:50%;bottom:1.25rem;transform:translateX(-50%);'
|
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;'
|
+ '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;'
|
+ 'background:#1f2328;color:#fff;font-size:.85rem;line-height:1.4;z-index:2000;'
|
||||||
+ 'box-shadow:0 4px 16px rgba(0,0,0,.25)';
|
// a status message, so it keeps its own dark surface in either mode; the
|
||||||
|
// hairline is the page's rule colour, invisible on a light page and an
|
||||||
|
// edge against a dark one, where the shadow alone no longer separates it
|
||||||
|
+ 'border:1px solid var(--calc-line,#444);'
|
||||||
|
+ 'box-shadow:0 4px 16px var(--calc-shadow,rgba(0,0,0,.25))';
|
||||||
document.body.appendChild(box);
|
document.body.appendChild(box);
|
||||||
setTimeout(function () { box.remove(); }, 7000);
|
setTimeout(function () { box.remove(); }, 7000);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ babel-lang: german
|
|||||||
project:
|
project:
|
||||||
output-dir: _book/de
|
output-dir: _book/de
|
||||||
book:
|
book:
|
||||||
title: "Vom Aufruf zum Ereignis"
|
title: "Prozesssteuerung"
|
||||||
abstract: "Schrittweise Zusammenfassungen des Tutorials SIN.04028 „From Calling to Eventing“, vom direkten Methodenaufruf zu einer ereignisgetriebenen Architektur über MQTT. Process Control, gehalten von Reto Konig, Universität Freiburg, Herbstsemester 2026."
|
abstract: "Ein kleines Programm, Schritt für Schritt neu gebaut — vom direkten Methodenaufruf zu einer ereignisgetriebenen Architektur über MQTT: was sich bei jedem Schritt verschiebt und wer am Ende wen kennt."
|
||||||
chapters:
|
chapters:
|
||||||
- index.qmd
|
- index.qmd
|
||||||
- 00-orientation.qmd
|
- 00-orientation.qmd
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ babeloptions: provide=*
|
|||||||
project:
|
project:
|
||||||
output-dir: _book/fr
|
output-dir: _book/fr
|
||||||
book:
|
book:
|
||||||
title: "De l'appel à l'événement"
|
title: "Contrôle de processus"
|
||||||
abstract: "Résumés pas à pas du tutoriel SIN.04028 « From Calling to Eventing », de l'appel de méthode direct à une architecture événementielle sur MQTT. Process Control, donné par Reto Konig, Université de Fribourg, semestre d'automne 2026."
|
abstract: "Un petit programme, reconstruit pas à pas de l'appel de méthode direct à une architecture événementielle sur MQTT : ce qui bouge à chaque étape, et qui finit par connaître qui."
|
||||||
chapters:
|
chapters:
|
||||||
- index.qmd
|
- index.qmd
|
||||||
- 00-orientation.qmd
|
- 00-orientation.qmd
|
||||||
@@ -25,6 +25,16 @@ book:
|
|||||||
href: index.html
|
href: index.html
|
||||||
- text: Deutsch
|
- text: Deutsch
|
||||||
href: ../de/index.html
|
href: ../de/index.html
|
||||||
|
# French cross-references: Quarto prints "Figure 1.1" and "Table 1.1"
|
||||||
|
# mid-sentence, with an English "Table" and a capital that French does not want.
|
||||||
|
# In a book `sec-prefix` is ignored and `ch-prefix` fails validation, so a
|
||||||
|
# reference to a section or a chapter is written by hand:
|
||||||
|
# "(section [-@sec-x])", "le chapitre [-@sec-x]".
|
||||||
|
crossref:
|
||||||
|
fig-prefix: "figure"
|
||||||
|
tbl-title: "Tableau"
|
||||||
|
tbl-prefix: "tableau"
|
||||||
|
|
||||||
format:
|
format:
|
||||||
html:
|
html:
|
||||||
toc-title: "Sur cette page"
|
toc-title: "Sur cette page"
|
||||||
@@ -11,7 +11,7 @@ project:
|
|||||||
# the other two. Build all three with ./render-all.sh -- a full English render
|
# the other two. Build all three with ./render-all.sh -- a full English render
|
||||||
# (plain `quarto render`) empties _book/ and so removes fr/ and de/.
|
# (plain `quarto render`) empties _book/ and so removes fr/ and de/.
|
||||||
#
|
#
|
||||||
# English is the verified source here: the tutorial these notes summarise
|
# English is the verified source here: the material these notes are built from
|
||||||
# (SIN.04028-From-Calling-to-Eventing/README.md) is written in English.
|
# (SIN.04028-From-Calling-to-Eventing/README.md) is written in English.
|
||||||
profile:
|
profile:
|
||||||
default: en
|
default: en
|
||||||
@@ -22,11 +22,11 @@ metadata-files:
|
|||||||
- i18n.yml
|
- i18n.yml
|
||||||
|
|
||||||
book:
|
book:
|
||||||
title: "From Calling to Eventing"
|
title: "Process Control"
|
||||||
author:
|
author:
|
||||||
- name: "Romain De Groote"
|
- name: "Romain De Groote"
|
||||||
email: "romain@de-groote.ch"
|
email: "romain@de-groote.ch"
|
||||||
abstract: "Step-by-step summaries of the SIN.04028 tutorial \"From Calling to Eventing\", from direct method calls to an Event-Driven Architecture over MQTT. Process Control, given by Reto Konig, University of Fribourg, autumn semester 2026."
|
abstract: "One small program, rebuilt step by step from direct method calls to an Event-Driven Architecture over MQTT: what moves at each step, and who ends up knowing whom."
|
||||||
date: last-modified
|
date: last-modified
|
||||||
date-format: "D MMMM YYYY"
|
date-format: "D MMMM YYYY"
|
||||||
search: true
|
search: true
|
||||||
@@ -50,9 +50,16 @@ format:
|
|||||||
# a figure is written as figures/<name>-@tr{langcode}, with no extension,
|
# a figure is written as figures/<name>-@tr{langcode}, with no extension,
|
||||||
# so each format picks the file it can use: the svg here, the pdf below.
|
# so each format picks the file it can use: the svg here, the pdf below.
|
||||||
default-image-extension: svg
|
default-image-extension: svg
|
||||||
|
# Light first: Quarto stores the reader's pick as "default"/"alternate",
|
||||||
|
# so the order has to be the same in every book. The ◐ high-contrast
|
||||||
|
# button appears next to the toggle by itself (notes extension).
|
||||||
theme:
|
theme:
|
||||||
- cosmo
|
light: [cosmo, theme.scss]
|
||||||
- theme.scss
|
dark: [darkly, theme.scss]
|
||||||
|
# github-dark drops comments to 2.4:1 on darkly's ground; a11y ships a
|
||||||
|
# light and a dark variant that both clear AA, and Quarto swaps them with
|
||||||
|
# the toggle.
|
||||||
|
highlight-style: a11y
|
||||||
include-in-header:
|
include-in-header:
|
||||||
# language menu + remembered language (in the head: redirects before drawing)
|
# language menu + remembered language (in the head: redirects before drawing)
|
||||||
- _i18n-switcher.html
|
- _i18n-switcher.html
|
||||||
@@ -90,7 +97,7 @@ format:
|
|||||||
- bottom=2.3cm
|
- bottom=2.3cm
|
||||||
- inner=2.5cm
|
- inner=2.5cm
|
||||||
- outer=2.1cm
|
- outer=2.1cm
|
||||||
# DejaVu Sans Mono is required: the ASCII diagrams copied from the tutorial
|
# DejaVu Sans Mono is required: the ASCII diagrams in these notes
|
||||||
# use box-drawing glyphs and arrows that Latin Modern Mono does not have.
|
# use box-drawing glyphs and arrows that Latin Modern Mono does not have.
|
||||||
# On Arch: pacman -S ttf-dejavu
|
# On Arch: pacman -S ttf-dejavu
|
||||||
mainfont: "Latin Modern Roman"
|
mainfont: "Latin Modern Roman"
|
||||||
@@ -124,5 +131,10 @@ execute:
|
|||||||
filters:
|
filters:
|
||||||
- notes
|
- notes
|
||||||
|
|
||||||
|
# The book's accent: the teal this book has drawn with from the start. Night
|
||||||
|
# mode keeps the hue and lifts the lightness by itself (theme.css), so there is
|
||||||
|
# no notecolor-dark here. Everything else draws with the extension's tokens.
|
||||||
|
notecolor: "#20666f"
|
||||||
|
|
||||||
# where a metadata-defined glossary entry lives, so a usage can link to it
|
# where a metadata-defined glossary entry lives, so a usage can link to it
|
||||||
glossary-page: glossary.html
|
glossary-page: glossary.html
|
||||||
@@ -9,12 +9,12 @@ The full log is split into one file per tutorial part, in [`conv/`](conv/). Each
|
|||||||
| [Setup & Step 0](conv/00-setup-and-step-0.md) | 0 — What This Tutorial Is About | 1–7 | done |
|
| [Setup & Step 0](conv/00-setup-and-step-0.md) | 0 — What This Tutorial Is About | 1–7 | done |
|
||||||
| [Part I — Start With What You Already Know](conv/01-part-I.md) | 1–10 | 8–28 | done |
|
| [Part I — Start With What You Already Know](conv/01-part-I.md) | 1–10 | 8–28 | done |
|
||||||
| [Part II — Cross the Process Boundary](conv/02-part-II.md) | 11–18 | 29–44 | done |
|
| [Part II — Cross the Process Boundary](conv/02-part-II.md) | 11–18 | 29–44 | done |
|
||||||
| [Part III — Make It Actually Distributed](conv/03-part-III.md) | 19–27 | 45– | in progress |
|
| [Part III — Make It Actually Distributed](conv/03-part-III.md) | 19–27 | 45–61 | done |
|
||||||
| Part IV — Rewind | 28–34 | — | not started |
|
| [Part IV — Rewind](conv/04-part-IV.md) | 28–34 | 62 | done |
|
||||||
| Part V — Replay the Dynamic Idea Across Processes | 35–38 | — | not started |
|
| [Part V — Replay the Dynamic Idea Across Processes](conv/05-part-V.md) | 35–38 | 63–67 | done |
|
||||||
| Part VI — Replay It Over Syncthing | 39–47 | — | not started |
|
| [Part VI — Replay It Over Syncthing](conv/06-part-VI.md) | 39–47 | 68– | in progress (39 parked) |
|
||||||
| Part VII — Now Merge the Two Architectural Ideas | 48–52 | — | not started |
|
| Part VII — Now Merge the Two Architectural Ideas | 48–52 | — | not started |
|
||||||
| Part VIII — The Filesystem Has Done Its Job | 53 | — | not started |
|
| Part VIII — The Filesystem Has Done Its Job | 53 | — | not started |
|
||||||
| Part IX — MQTT (+ optional epilogue) | 54–81 | — | not started |
|
| Part IX — MQTT (+ optional epilogue) | 54–81 | — | not started |
|
||||||
|
|
||||||
**Current position:** Part III, Steps 19–20. Detour: installing Syncthing on Arch.
|
**Current position:** Part VI, Steps 46–47 (vocabulary and the one-writer rule). Step 39 parked until the home server is free.
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<!-- nav -->
|
<!-- nav -->
|
||||||
> ⬅ Previous: *(none)* · [Index](../conv.md) · [Next: Part I ➡](01-part-I.md)
|
> ⬅ Previous: *(none)* · [Index](../conv.md) · [Next: Part I ➡](01-part-I.md)
|
||||||
>
|
>
|
||||||
> All parts: **Setup & Step 0** · [Part I](01-part-I.md) · [Part II](02-part-II.md) · [Part III](03-part-III.md)
|
> All parts: **Setup & Step 0** · [Part I](01-part-I.md) · [Part II](02-part-II.md) · [Part III](03-part-III.md) · [Part IV](04-part-IV.md) · [Part V](05-part-V.md) · [Part VI](06-part-VI.md)
|
||||||
<!-- /nav -->
|
<!-- /nav -->
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -309,5 +309,5 @@ java --version
|
|||||||
<!-- nav -->
|
<!-- nav -->
|
||||||
> ⬅ Previous: *(none)* · [Index](../conv.md) · [Next: Part I ➡](01-part-I.md)
|
> ⬅ Previous: *(none)* · [Index](../conv.md) · [Next: Part I ➡](01-part-I.md)
|
||||||
>
|
>
|
||||||
> All parts: **Setup & Step 0** · [Part I](01-part-I.md) · [Part II](02-part-II.md) · [Part III](03-part-III.md)
|
> All parts: **Setup & Step 0** · [Part I](01-part-I.md) · [Part II](02-part-II.md) · [Part III](03-part-III.md) · [Part IV](04-part-IV.md) · [Part V](05-part-V.md) · [Part VI](06-part-VI.md)
|
||||||
<!-- /nav -->
|
<!-- /nav -->
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<!-- nav -->
|
<!-- nav -->
|
||||||
> [⬅ Previous: Setup & Step 0](00-setup-and-step-0.md) · [Index](../conv.md) · [Next: Part II ➡](02-part-II.md)
|
> [⬅ Previous: Setup & Step 0](00-setup-and-step-0.md) · [Index](../conv.md) · [Next: Part II ➡](02-part-II.md)
|
||||||
>
|
>
|
||||||
> All parts: [Setup & Step 0](00-setup-and-step-0.md) · **Part I** · [Part II](02-part-II.md) · [Part III](03-part-III.md)
|
> All parts: [Setup & Step 0](00-setup-and-step-0.md) · **Part I** · [Part II](02-part-II.md) · [Part III](03-part-III.md) · [Part IV](04-part-IV.md) · [Part V](05-part-V.md) · [Part VI](06-part-VI.md)
|
||||||
<!-- /nav -->
|
<!-- /nav -->
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
then, after being asked to actually run the command:
|
then, after being asked to actually run the command:
|
||||||
|
|
||||||
```
|
```
|
||||||
[matsune@nitro5 ProcessControl]$ java --version
|
[#user@#laptop ProcessControl]$ java --version
|
||||||
openjdk 25.0.4.1 2026-08-18
|
openjdk 25.0.4.1 2026-08-18
|
||||||
OpenJDK Runtime Environment (build 25.0.4.1)
|
OpenJDK Runtime Environment (build 25.0.4.1)
|
||||||
OpenJDK 64-Bit Server VM (build 25.0.4.1, mixed mode, sharing)
|
OpenJDK 64-Bit Server VM (build 25.0.4.1, mixed mode, sharing)
|
||||||
@@ -740,5 +740,5 @@ Read section 10 (lines 644–694) to see it in the README's words. Note that the
|
|||||||
<!-- nav -->
|
<!-- nav -->
|
||||||
> [⬅ Previous: Setup & Step 0](00-setup-and-step-0.md) · [Index](../conv.md) · [Next: Part II ➡](02-part-II.md)
|
> [⬅ Previous: Setup & Step 0](00-setup-and-step-0.md) · [Index](../conv.md) · [Next: Part II ➡](02-part-II.md)
|
||||||
>
|
>
|
||||||
> All parts: [Setup & Step 0](00-setup-and-step-0.md) · **Part I** · [Part II](02-part-II.md) · [Part III](03-part-III.md)
|
> All parts: [Setup & Step 0](00-setup-and-step-0.md) · **Part I** · [Part II](02-part-II.md) · [Part III](03-part-III.md) · [Part IV](04-part-IV.md) · [Part V](05-part-V.md) · [Part VI](06-part-VI.md)
|
||||||
<!-- /nav -->
|
<!-- /nav -->
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<!-- nav -->
|
<!-- nav -->
|
||||||
> [⬅ Previous: Part I](01-part-I.md) · [Index](../conv.md) · [Next: Part III ➡](03-part-III.md)
|
> [⬅ Previous: Part I](01-part-I.md) · [Index](../conv.md) · [Next: Part III ➡](03-part-III.md)
|
||||||
>
|
>
|
||||||
> All parts: [Setup & Step 0](00-setup-and-step-0.md) · [Part I](01-part-I.md) · **Part II** · [Part III](03-part-III.md)
|
> All parts: [Setup & Step 0](00-setup-and-step-0.md) · [Part I](01-part-I.md) · **Part II** · [Part III](03-part-III.md) · [Part IV](04-part-IV.md) · [Part V](05-part-V.md) · [Part VI](06-part-VI.md)
|
||||||
<!-- /nav -->
|
<!-- /nav -->
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -503,5 +503,5 @@ Each time it moved *away* from the capabilities. It never disappeared. (Bookmark
|
|||||||
<!-- nav -->
|
<!-- nav -->
|
||||||
> [⬅ Previous: Part I](01-part-I.md) · [Index](../conv.md) · [Next: Part III ➡](03-part-III.md)
|
> [⬅ Previous: Part I](01-part-I.md) · [Index](../conv.md) · [Next: Part III ➡](03-part-III.md)
|
||||||
>
|
>
|
||||||
> All parts: [Setup & Step 0](00-setup-and-step-0.md) · [Part I](01-part-I.md) · **Part II** · [Part III](03-part-III.md)
|
> All parts: [Setup & Step 0](00-setup-and-step-0.md) · [Part I](01-part-I.md) · **Part II** · [Part III](03-part-III.md) · [Part IV](04-part-IV.md) · [Part V](05-part-V.md) · [Part VI](06-part-VI.md)
|
||||||
<!-- /nav -->
|
<!-- /nav -->
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
# Conversation Log — Part III — Make It Actually Distributed · Steps 19–27 (turns 45–)
|
# Conversation Log — Part III — Make It Actually Distributed · Steps 19–27 (turns 45–)
|
||||||
|
|
||||||
<!-- nav -->
|
<!-- nav -->
|
||||||
> [⬅ Previous: Part II](02-part-II.md) · [Index](../conv.md) · Next: *(not started yet)* ➡
|
> [⬅ Previous: Part II](02-part-II.md) · [Index](../conv.md) · [Next: Part IV ➡](04-part-IV.md)
|
||||||
>
|
>
|
||||||
> All parts: [Setup & Step 0](00-setup-and-step-0.md) · [Part I](01-part-I.md) · [Part II](02-part-II.md) · **Part III**
|
> All parts: [Setup & Step 0](00-setup-and-step-0.md) · [Part I](01-part-I.md) · [Part II](02-part-II.md) · **Part III** · [Part IV](04-part-IV.md) · [Part V](05-part-V.md) · [Part VI](06-part-VI.md)
|
||||||
<!-- /nav -->
|
<!-- /nav -->
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -60,12 +60,12 @@ Repeat on every other machine you'll use. For Step 21 you need **at least two**,
|
|||||||
## [46] Student
|
## [46] Student
|
||||||
|
|
||||||
```
|
```
|
||||||
[matsune@nitro5 ProcessControl]$ sudo pacman -S synchting
|
[#user@#laptop ProcessControl]$ sudo pacman -S synchting
|
||||||
[sudo] password for matsune:
|
[sudo] password for matsune:
|
||||||
error: target not found: synchting
|
error: target not found: synchting
|
||||||
[matsune@nitro5 ProcessControl]$ pacman -Ql syncthing | grep systemd
|
[#user@#laptop ProcessControl]$ pacman -Ql syncthing | grep systemd
|
||||||
error: package 'syncthing' was not found
|
error: package 'syncthing' was not found
|
||||||
[matsune@nitro5 ProcessControl]$
|
[#user@#laptop ProcessControl]$
|
||||||
```
|
```
|
||||||
|
|
||||||
## [46] Tutor — actions taken
|
## [46] Tutor — actions taken
|
||||||
@@ -96,9 +96,9 @@ pacman -Ql syncthing | grep systemd
|
|||||||
## [47] Student
|
## [47] Student
|
||||||
|
|
||||||
```
|
```
|
||||||
[matsune@nitro5 ProcessControl]$ syncthing --version
|
[#user@#laptop ProcessControl]$ syncthing --version
|
||||||
syncthing v2.1.5 "Hafnium Hornet" (go1.27.0-X:nodwarf5 linux-amd64) syncthing@archlinux 2026-09-08 10:28:56 UTC [libsqlite3, noupgrade]
|
syncthing v2.1.5 "Hafnium Hornet" (go1.27.0-X:nodwarf5 linux-amd64) syncthing@archlinux 2026-09-08 10:28:56 UTC [libsqlite3, noupgrade]
|
||||||
[matsune@nitro5 ProcessControl]$
|
[#user@#laptop ProcessControl]$
|
||||||
```
|
```
|
||||||
|
|
||||||
## [47] Tutor — actions taken
|
## [47] Tutor — actions taken
|
||||||
@@ -259,8 +259,115 @@ Noted, nothing built. Back to the Syncthing detour for Steps 19–20.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## [53] Student (2026-10-05)
|
||||||
|
|
||||||
|
> Hi, i'm ready to take back from where i left
|
||||||
|
|
||||||
|
## [53] Tutor — actions taken
|
||||||
|
|
||||||
|
- Read-only checks of the Syncthing detour's state: `systemctl --user is-enabled syncthing.service` → **enabled**, `is-active` → **active**, and the web GUI answers on `http://127.0.0.1:8384` (HTTP 200). So the service was started since turn [47].
|
||||||
|
- Read `~/.local/state/syncthing/config.xml`: one device, this machine (`nitro5`), and no shared folder configured yet. Step 21 items 2–4 are therefore still open.
|
||||||
|
- Schedule check against `Schedule.md`: Parts II–VIII were due 29 Sep by my inferred mapping; today is 5 Oct, so this part is 6 days past that date — more than the two days that call for a word about it. The next sessions are 06 Oct "Now You Do It" and 13 Oct "Graded Exercise I".
|
||||||
|
|
||||||
|
## [53] Tutor — reply
|
||||||
|
|
||||||
|
Welcome back. Syncthing is running now (enabled, active, GUI up), so that half of the detour is done. Still open: a second device and a shared folder, plus the Step 20 question.
|
||||||
|
|
||||||
|
**Schedule, honestly:** Part III was due 29 Sep by my reading of the plan; it is 5 Oct. The sessions ahead are "Now You Do It" tomorrow and **Graded Exercise I on 13 Oct**, where your own system and report are presented. Parts IV–VIII (steps 28–53) are what turn the five awkward mediators into the dynamic version the graded exercise wants you to defend, and Part IX (MQTT) is the transport the group work uses. You are free to keep going at your pace, and you can work ahead whenever you like, but if only one thing fits before the 13th, the rewind in Part IV is worth more than finishing Syncthing.
|
||||||
|
|
||||||
|
That gives you a choice for right now:
|
||||||
|
|
||||||
|
- **(a) Finish Part III properly:** pair a second device, share one folder, run the `hello.txt` test (Step 22), then distribute the five processes across two machines (Step 24) and count what one keystroke costs (Step 25).
|
||||||
|
- **(b) Park Syncthing at "it runs"** and jump to Part IV, the rewind, where the mediators get questioned and the services start subscribing for themselves. The filesystem transport keeps working locally for every later step; only the "two computers" demonstration waits.
|
||||||
|
|
||||||
|
**Either way, two small things first:**
|
||||||
|
1. The Step 20 question is still open: why is Syncthing **not** a message broker, even though our messages travel through it?
|
||||||
|
2. If you pick (a): which second machine, and does it have Syncthing yet?
|
||||||
|
|
||||||
|
**Progress record**
|
||||||
|
- Current step: 19–20 (Part III); Syncthing installed, enabled and running
|
||||||
|
- Last observed result: service active, GUI on `http://127.0.0.1:8384`, one device (`nitro5`), no shared folder yet
|
||||||
|
- Unresolved problem: six days past the inferred due date for Parts II–VIII; Graded Exercise I on 13 Oct
|
||||||
|
- Next action: student answers the broker question and picks (a) finish Part III or (b) park Syncthing and start Part IV
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## [54] Student
|
||||||
|
|
||||||
|
> i go with (a), concerning the open question: syncthing is a file synchroniser, it doesn't send any notification or anything, but the apeparence of a file can be used as a trigger, i can also try to install java in a separate docker and then delete it at the end of the tutorial (if it is possible)
|
||||||
|
|
||||||
|
## [54] Tutor — actions taken
|
||||||
|
|
||||||
|
- Read-only check of the live Syncthing config: devices `nitro5`, `homeserver`, `Nothing Phone`; folders Camera, Documents (`/mnt/data/Documents`), Downloads, Music, Pictures, Videos, all `sendreceive`. The course material therefore already replicates to the homeserver, since it lives under `/mnt/data/Documents`.
|
||||||
|
- Read README lines 1415–1491 (Step 24 "Distribute the Five Processes") to give the two-machine split.
|
||||||
|
|
||||||
|
## [54] Tutor — reply
|
||||||
|
|
||||||
|
Step 20 answered correctly, folder choice (a) noted, and the Docker idea works. Sharpened the broker answer, gave the two-machine split for Step 24 and the container shape, and asked for the Step 22 result first.
|
||||||
|
|
||||||
|
**Progress record**
|
||||||
|
- Current step: 21–22 (Part III)
|
||||||
|
- Last observed result: three paired devices; Step 20 answered (Syncthing replicates, our own WatchService is the trigger)
|
||||||
|
- Unresolved problem: dedicated folder not created yet; Java on the homeserver pending (Docker plan)
|
||||||
|
- Next action: student creates the shared folder, runs the `hello.txt` test, and checks a JDK image in Docker
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## [55] Student (2026-10-06)
|
||||||
|
|
||||||
|
Reported the Docker container created on the homeserver with `-v ~/course-message-board:/board -v ~/pc-src:/src:ro`, container id `3830338da4a9`, and "got that" for the file copy.
|
||||||
|
|
||||||
|
Earlier in the same exchange: `rm -rf ~/'…'` failed with permission denied (Docker had created that tree as root), and `find ~ -type d -path '*03-static-filesystem'` found nothing on the server, which corrected my claim that the Documents replica was already there.
|
||||||
|
|
||||||
|
## [55] Tutor — actions taken
|
||||||
|
|
||||||
|
- Wrote `~/course-message-board/hello.txt` on the laptop (one line, a timestamp) as the laptop half of Step 22's replication test. The folder holds Syncthing's `.stfolder` marker, so Syncthing owns it.
|
||||||
|
- Left the observation on the server side to the student, and asked for two container checks (`ls /src`, `ls -la /board`).
|
||||||
|
|
||||||
|
## [55] Tutor — reply
|
||||||
|
|
||||||
|
Asked for: `docker exec pc-java ls /src` and `ls -la /board`, then the Step 22 round trip — `hello.txt` is already written on the laptop, the student checks it appears on the server and deletes it there, and I confirm the deletion arrives here.
|
||||||
|
|
||||||
|
**Progress record**
|
||||||
|
- Current step: 22 (Part III)
|
||||||
|
- Last observed result: container `pc-java` running on the homeserver; `hello.txt` written on the laptop at 00:01
|
||||||
|
- Unresolved problem: replication not yet demonstrated in either direction; `/src` and `/board` contents inside the container unverified
|
||||||
|
- Next action: student reports `ls /src`, `ls -la /board`, whether `hello.txt` arrived, then deletes it on the server
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## [56] Student
|
||||||
|
|
||||||
|
Asked for the log to be redacted — anything sensitive marked with `#` — and pasted the diagnosis output from the server (redacted here):
|
||||||
|
|
||||||
|
```
|
||||||
|
#user@#homeserver:~$ ls -ld ~/course-message-board
|
||||||
|
drwxr-xr-x 2 root root 4096 Oct 5 23:46 ~/course-message-board
|
||||||
|
ls: cannot access '~/course-message-board/.stfolder': No such file or directory
|
||||||
|
user=#uid:#gid # docker inspect -f 'user={{.Config.User}}' pc-java
|
||||||
|
uid=#uid(#user) gid=#gid(#user) groups=#groups
|
||||||
|
```
|
||||||
|
|
||||||
|
## [56] Tutor — actions taken
|
||||||
|
|
||||||
|
- Redacted the whole log: account names, host names and `/home/<user>` paths in `conv/01-part-I.md` and `conv/03-part-III.md` are now `#user`, `#laptop`, `#homeserver`, `~`. Recorded the rule in memory so later turns are redacted as they are written.
|
||||||
|
- Read the diagnosis: on the server `~/course-message-board` is **root-owned and holds no `.stfolder`**, so Syncthing never created it — it is the empty directory Docker made on the first run with my broken placeholder. The container runs as the student's uid, hence the `AccessDeniedException`.
|
||||||
|
- Conclusion: the container is mounting the wrong directory, and the replica that actually received `hello.txt` lives at a path we have not identified yet.
|
||||||
|
|
||||||
|
## [56] Tutor — reply
|
||||||
|
|
||||||
|
Explained the decoy directory, and asked for `sudo find / -xdev -name '.stfolder' -printf '%h\n'` on the server to locate the real replica, plus `ls -ld` on it to decide which user the container should run as.
|
||||||
|
|
||||||
|
**Progress record**
|
||||||
|
- Current step: 24 (Part III), blocked on the mount path
|
||||||
|
- Last observed result: `~/course-message-board` on the server is root-owned with no `.stfolder`; container user is the student's uid
|
||||||
|
- Unresolved problem: the real path of the replicated folder on the server is unknown
|
||||||
|
- Next action: student locates the folder with the `.stfolder` search, reports it and its ownership
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
<!-- nav -->
|
<!-- nav -->
|
||||||
> [⬅ Previous: Part II](02-part-II.md) · [Index](../conv.md) · Next: *(not started yet)* ➡
|
> [⬅ Previous: Part II](02-part-II.md) · [Index](../conv.md) · [Next: Part IV ➡](04-part-IV.md)
|
||||||
>
|
>
|
||||||
> All parts: [Setup & Step 0](00-setup-and-step-0.md) · [Part I](01-part-I.md) · [Part II](02-part-II.md) · **Part III**
|
> All parts: [Setup & Step 0](00-setup-and-step-0.md) · [Part I](01-part-I.md) · [Part II](02-part-II.md) · **Part III** · [Part IV](04-part-IV.md) · [Part V](05-part-V.md) · [Part VI](06-part-VI.md)
|
||||||
<!-- /nav -->
|
<!-- /nav -->
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
# Conversation Log — Part IV — Rewind · Steps 28–34 (turns 62)
|
||||||
|
|
||||||
|
<!-- nav -->
|
||||||
|
> [⬅ Previous: Part III](03-part-III.md) · [Index](../conv.md) · [Next: Part V ➡](05-part-V.md)
|
||||||
|
>
|
||||||
|
> All parts: [Setup & Step 0](00-setup-and-step-0.md) · [Part I](01-part-I.md) · [Part II](02-part-II.md) · [Part III](03-part-III.md) · **Part IV** · [Part V](05-part-V.md) · [Part VI](06-part-VI.md)
|
||||||
|
<!-- /nav -->
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## [62] Student
|
||||||
|
|
||||||
|
> so after test, after a ctrl+d, the console in is still working, but nothing is output anymore, i'd say that the subscription to topic which is interupt, explaining why nothing is output because consoleout don't receive anything from rot13 and rot13 don't receive anything from consolein
|
||||||
|
|
||||||
|
## [62] Tutor — actions taken
|
||||||
|
|
||||||
|
- Read `04-dynamic-in-jvm/DynamicQueueRot13.java` lines 37–52 (`runConsoleIn`) and 120–140 (`main`) to check the mechanism behind the observation.
|
||||||
|
- Earlier in Part IV: corrected who publishes `TOPIC` (it is `main()`, lines 122–133, not ConsoleIn) and what the dynamic version changes (ROT13 takes straight from `consoleIn.outbox`; `rot13.inbox` now carries control messages only).
|
||||||
|
|
||||||
|
## [62] Tutor — reply
|
||||||
|
|
||||||
|
Corrected the mechanism: nothing is interrupted — `runConsoleIn` returns on EOF, so the producer is gone while both subscriber threads are still blocked in `take()` on sources that will never produce again. `main`'s `Thread.currentThread().join()` is what keeps the JVM alive. Also answered the second half: with no mediator, only the three capabilities are left in the data path, plus a startup-only dependency on the configurator publishing `TOPIC`. Then set Steps 31–34 as the next reading.
|
||||||
|
|
||||||
|
**Progress record**
|
||||||
|
- Current step: 30 done → 31–34 (Part IV)
|
||||||
|
- Last observed result: dynamic in-JVM version runs; after `Ctrl+D` the producer thread has returned and the two subscribers wait forever
|
||||||
|
- Unresolved problem: none
|
||||||
|
- Next action: student reads Steps 31–34 and answers the milestone question (who knows whom, where the topology lives, what drives the interaction)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!-- nav -->
|
||||||
|
> [⬅ Previous: Part III](03-part-III.md) · [Index](../conv.md) · [Next: Part V ➡](05-part-V.md)
|
||||||
|
>
|
||||||
|
> All parts: [Setup & Step 0](00-setup-and-step-0.md) · [Part I](01-part-I.md) · [Part II](02-part-II.md) · [Part III](03-part-III.md) · **Part IV** · [Part V](05-part-V.md) · [Part VI](06-part-VI.md)
|
||||||
|
<!-- /nav -->
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
# Conversation Log — Part V — Replay the Dynamic Idea Across Processes · Steps 35–38 (turns 63–67)
|
||||||
|
|
||||||
|
<!-- nav -->
|
||||||
|
> [⬅ Previous: Part IV](04-part-IV.md) · [Index](../conv.md) · [Next: Part VI ➡](06-part-VI.md)
|
||||||
|
>
|
||||||
|
> All parts: [Setup & Step 0](00-setup-and-step-0.md) · [Part I](01-part-I.md) · [Part II](02-part-II.md) · [Part III](03-part-III.md) · [Part IV](04-part-IV.md) · **Part V** · [Part VI](06-part-VI.md)
|
||||||
|
<!-- /nav -->
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## [63] Student
|
||||||
|
|
||||||
|
> for when its due part 5?
|
||||||
|
|
||||||
|
**Tutor:** By the inferred mapping, Parts II–VIII all sit in the 22 Sep week, due 29 Sep, and Part IX was due 06 Oct — so a week behind. Gave the real dates instead (06 Oct "Now You Do It", 13 Oct Graded Exercise I) and a table of what each remaining part contributes, noting that Parts VI and VII are the ones the graded exercise leans on.
|
||||||
|
|
||||||
|
## [64] Student
|
||||||
|
|
||||||
|
> finish reading 35
|
||||||
|
|
||||||
|
**Tutor:** Read Step 35 (lines 2180–2218): same dynamic idea across processes — one permanent control mailbox per service, `TOPIC` arrives, the service then watches that directory directly. Re-posed the question without answering it.
|
||||||
|
|
||||||
|
## [65] Student
|
||||||
|
|
||||||
|
> now each service must be able to watch into others outbox if configured
|
||||||
|
|
||||||
|
**Tutor:** Half right — the mediator already watched another service's outbox with the old helper. Corrected to the real constraint from Step 36: a service must watch its control inbox **and** a changing set of sources at once, which one blocking `watch(topic, receiver)` cannot do. That is why `ConfigurableMediator` accepted only one `ROUTE`.
|
||||||
|
|
||||||
|
## [66] Student
|
||||||
|
|
||||||
|
> 1. the idea is manage access via key, register add a new folder to watch and create the key to access it, while key.cancel breaks the connection to a folder when we want it unsubscribe
|
||||||
|
> 2. the queue has the advantage to keep the order of arrival
|
||||||
|
|
||||||
|
**Tutor:** (1) ✅ with the detail that `FileSubscriptions` keeps both maps, `name → key` and `key → name`, so an event can be traced back to its mailbox. (2) Order is real but secondary; the reasons are that `observe()` must stay responsive for every directory, and that `record IncomingMessage(String mailbox, Message message)` lets one loop decide control-vs-data and change its own subscriptions.
|
||||||
|
|
||||||
|
## [67] Student
|
||||||
|
|
||||||
|
> i have 5 ;-; (`find messageBoard-dynamic -name '*.msg' | wc -l` → 5)
|
||||||
|
|
||||||
|
## [67] Tutor — actions taken
|
||||||
|
|
||||||
|
- Listed the five files with their types: two `TEXT hello` in `consoleIn/outbox` (one stranded from before `Configure.java` ran), one `TEXT uryyb` in `rot13/outbox`, and two `TOPIC` Intents in `rot13/inbox` and `consoleOut/inbox`.
|
||||||
|
|
||||||
|
## [67] Tutor — reply
|
||||||
|
|
||||||
|
The count was right and the step's claim holds: **2 application publications** per flowing input (against 4 mediated), plus 2 one-time Intents and 1 line published before any subscription existed. Noted that `consoleOut/inbox` carries no payload at all now, and gave the ledger across Steps 18 / 27 / 38 (4 / 4 / 2 publications; 5 / 5 / 3 processes in the data path). Part V complete.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!-- nav -->
|
||||||
|
> [⬅ Previous: Part IV](04-part-IV.md) · [Index](../conv.md) · [Next: Part VI ➡](06-part-VI.md)
|
||||||
|
>
|
||||||
|
> All parts: [Setup & Step 0](00-setup-and-step-0.md) · [Part I](01-part-I.md) · [Part II](02-part-II.md) · [Part III](03-part-III.md) · [Part IV](04-part-IV.md) · **Part V** · [Part VI](06-part-VI.md)
|
||||||
|
<!-- /nav -->
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
# Conversation Log — Part VI — Replay It Over Syncthing · Steps 39–47 (turns 68–)
|
||||||
|
|
||||||
|
<!-- nav -->
|
||||||
|
> [⬅ Previous: Part V](05-part-V.md) · [Index](../conv.md) · Next: *(not started yet)* ➡
|
||||||
|
>
|
||||||
|
> All parts: [Setup & Step 0](00-setup-and-step-0.md) · [Part I](01-part-I.md) · [Part II](02-part-II.md) · [Part III](03-part-III.md) · [Part IV](04-part-IV.md) · [Part V](05-part-V.md) · **Part VI**
|
||||||
|
<!-- /nav -->
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## [68] Student
|
||||||
|
|
||||||
|
> no, i'll do each step
|
||||||
|
|
||||||
|
**Tutor:** Offer of shortcuts withdrawn and recorded as a standing preference. Opened Part VI and set up Step 39: copy `05-dynamic-filesystem` to the server, repoint the container at it, clear the board, run sensor on the laptop and the two dynamic services in the container, then `Configure.java`.
|
||||||
|
|
||||||
|
## [69] Student
|
||||||
|
|
||||||
|
> 2minutes and still nothing, don't know what went wrong
|
||||||
|
|
||||||
|
(`Configure.java` printed "Wired: consoleIn -> rot13 -> consoleOut" on the laptop; the two `docker exec` commands on the server appeared to return.)
|
||||||
|
|
||||||
|
## [69] Tutor — actions taken
|
||||||
|
|
||||||
|
- Read the laptop replica: `rot13/inbox` and `consoleOut/inbox` each held a `TOPIC` (02:29:15), `consoleIn/outbox` held the input (02:29:33), and **`rot13/outbox` was empty** — so ROT13 produced nothing.
|
||||||
|
- Gave three ordered checks: container running and whether the `TOPIC` reached `/srv/syncthing/course-message-board/rot13/inbox/`; a write probe inside the container (the `--user` change being the prime suspect, as in Part III); and watching one service start in the foreground to see whether it stays attached.
|
||||||
|
|
||||||
|
## [70] Student
|
||||||
|
|
||||||
|
> skip temp step 39, serv is busy with syncthing
|
||||||
|
|
||||||
|
**Tutor:** Step 39 parked with a bookmark — when the server is free, check first whether the server's `rot13/inbox` ever receives the `TOPIC`. Moved on to Step 40.
|
||||||
|
|
||||||
|
## [71] Student
|
||||||
|
|
||||||
|
> that means there is no information processing of our architecture performing on the data, but that doesn't mean that the data doesn't go through several process to travel from input -> rot13
|
||||||
|
|
||||||
|
**Tutor:** ✅ the step's point. Sharpened the distinction: a **transport hop** (Syncthing, even a relay) adds no participant that knows the topology and contradicts nothing; an **architectural hop** (a mediator of ours) adds a component that must know both names and sits in the availability chain. The honest claim is about knowledge and reaction, not about packets.
|
||||||
|
|
||||||
|
## [72] Student
|
||||||
|
|
||||||
|
> i'd say that the text part are Event, text has been entered, text has been rot13ed, but route are created betwwen process, topic messages are sent
|
||||||
|
|
||||||
|
**Tutor:** ✅ `TEXT` messages are Events, with the past-tense naming the step suggests (`ConsoleIn/E/text`, `ROT13/E/crypted`). `ROUTE` and `TOPIC` are **Intent**: they report nothing and describe nothing currently true, they request behaviour. Named the trap: publishing an Intent is itself something that happened, but classification follows the message's content, not its existence.
|
||||||
|
|
||||||
|
## [73] Student
|
||||||
|
|
||||||
|
> we can imagine a process that verify that everyhting is correctly wired, in this case this process would asked to rot13 "are you subsrcibed to consolein?" or "what are your subscriptions?" which display the current state of the subscription of rot13
|
||||||
|
|
||||||
|
**Tutor:** Right content, wrong shape: *asking* is a call, and a call needs the asker to know the component and to wait. Status is **published** — `ROT13/S/subscriptions` whenever the wiring changes — so the reader needs a topic, not a component, and ROT13 never learns who audits it. Forward link to Step 71, retained Status vs non-retained Events. Added the division of labour: Event = happened (useless if you were not listening), Status = true now (what a newcomer needs), Intent = please make it so.
|
||||||
|
|
||||||
|
## [74] Student
|
||||||
|
|
||||||
|
> consoleIn is the writer for its outbox, rot13 for rot13/outbox
|
||||||
|
|
||||||
|
**Tutor:** ✅ ownership correct. Re-asked the second half with Step 47's distinction in hand: UUIDs prevent filename collisions, writer authority decides who owns a logical resource, and the rule bites hardest for Status.
|
||||||
|
|
||||||
|
## [75] Student
|
||||||
|
|
||||||
|
> a subscriber can't know which component published the event
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!-- nav -->
|
||||||
|
> [⬅ Previous: Part V](05-part-V.md) · [Index](../conv.md) · Next: *(not started yet)* ➡
|
||||||
|
>
|
||||||
|
> All parts: [Setup & Step 0](00-setup-and-step-0.md) · [Part I](01-part-I.md) · [Part II](02-part-II.md) · [Part III](03-part-III.md) · [Part IV](04-part-IV.md) · [Part V](05-part-V.md) · **Part VI**
|
||||||
|
<!-- /nav -->
|
||||||
@@ -5,12 +5,19 @@
|
|||||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||||
* whole book.
|
* whole book.
|
||||||
*
|
*
|
||||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
* Colours are the extension's tokens (_extensions/notes/theme.css) with a
|
||||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
* literal fallback, which covers all three ways a figure is seen:
|
||||||
*
|
*
|
||||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
* - inlined into the page by figures/flow-player.html: the tokens resolve
|
||||||
* ignores media queries when it makes the pdf, so print always gets the light
|
* against the page, so the figure follows light, night and high contrast;
|
||||||
* theme -- which is what a printed page wants.
|
* - as a plain <img> (JavaScript off): the fallback applies, and night mode
|
||||||
|
* comes from the extension's invert filter on main img[src$=".svg"];
|
||||||
|
* - in the pdf: librsvg ignores var() and uses the fallback, so print gets
|
||||||
|
* the light palette -- which is what a printed page wants.
|
||||||
|
*
|
||||||
|
* The fallbacks are this book's own light values; the tokens carry the night
|
||||||
|
* and high-contrast ones. Nothing here keys off prefers-color-scheme: the
|
||||||
|
* page's toggle decides, never the reader's system setting.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
@@ -21,32 +28,32 @@ svg {
|
|||||||
|
|
||||||
/* ---- surfaces ------------------------------------------------------- */
|
/* ---- surfaces ------------------------------------------------------- */
|
||||||
|
|
||||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box-weak { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
.box-accent { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
.box-warn { fill: var(--calc-faint, #f8f1e0); stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.4; }
|
||||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
.box-plain { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-grid, #dae0e8); stroke-width: 1.2; }
|
||||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
.diamond { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
.ellipse { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; }
|
||||||
|
|
||||||
/* ---- lines ---------------------------------------------------------- */
|
/* ---- lines ---------------------------------------------------------- */
|
||||||
|
|
||||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
.edge { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.3; }
|
||||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
.edge-strong{ fill: none; stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
.edge-warn { fill: none; stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.6; }
|
||||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
.edge-dash { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
.rule { stroke: var(--calc-grid, #dae0e8); stroke-width: 1; }
|
||||||
|
|
||||||
/* ---- text ----------------------------------------------------------- */
|
/* ---- text ----------------------------------------------------------- */
|
||||||
|
|
||||||
.t { fill: #1b2430; font-size: 13px; }
|
.t { fill: var(--calc-ink, #1b2430); font-size: 13px; }
|
||||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
.t-sm { fill: var(--calc-ink, #1b2430); font-size: 11px; }
|
||||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
.t-lead { fill: var(--calc-ink, #1b2430); font-size: 14px; font-weight: 600; }
|
||||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
.t-mut { fill: var(--calc-muted, #5a6879); font-size: 11px; }
|
||||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
.t-key { fill: var(--calc-ink, #1b2430); font-size: 12px; text-decoration: underline; }
|
||||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
.t-accent { fill: var(--calc-notecolor, #20666f); font-size: 12px; font-weight: 600; }
|
||||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
.t-warn { fill: var(--calc-accent-b, #D1541F); font-size: 12px; font-weight: 600; }
|
||||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
.t-mono { fill: var(--calc-ink, #1b2430); font-size: 11.5px;
|
||||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||||
|
|
||||||
.mid { text-anchor: middle; }
|
.mid { text-anchor: middle; }
|
||||||
@@ -63,7 +70,7 @@ svg {
|
|||||||
.node:hover .box,
|
.node:hover .box,
|
||||||
.node:hover .box-accent,
|
.node:hover .box-accent,
|
||||||
.node:hover .diamond { stroke-width: 2.6; }
|
.node:hover .diamond { stroke-width: 2.6; }
|
||||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
.node:hover .t, .node:hover .t-lead { fill: var(--calc-notecolor, #20666f); }
|
||||||
|
|
||||||
svg:hover .node:not(:hover) { opacity: .55; }
|
svg:hover .node:not(:hover) { opacity: .55; }
|
||||||
|
|
||||||
@@ -74,40 +81,11 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
.node { transition: none; }
|
.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 ======================================================
|
/* ---- arrowheads ======================================================
|
||||||
* marker contents cannot inherit the referencing element's fill, so each
|
* marker contents cannot inherit the referencing element's fill, so each
|
||||||
* arrowhead is its own class and is themed alongside the line it ends.
|
* arrowhead is its own class and is themed alongside the line it ends.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.arrow { fill: #5a6879; }
|
.arrow { fill: var(--calc-muted, #5a6879); }
|
||||||
.arrow-strong { fill: #20666f; }
|
.arrow-strong { fill: var(--calc-notecolor, #20666f); }
|
||||||
.arrow-warn { fill: #8a5a08; }
|
.arrow-warn { fill: var(--calc-accent-b, #D1541F); }
|
||||||
@@ -9,12 +9,19 @@
|
|||||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||||
* whole book.
|
* whole book.
|
||||||
*
|
*
|
||||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
* Colours are the extension's tokens (_extensions/notes/theme.css) with a
|
||||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
* literal fallback, which covers all three ways a figure is seen:
|
||||||
*
|
*
|
||||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
* - inlined into the page by figures/flow-player.html: the tokens resolve
|
||||||
* ignores media queries when it makes the pdf, so print always gets the light
|
* against the page, so the figure follows light, night and high contrast;
|
||||||
* theme -- which is what a printed page wants.
|
* - as a plain <img> (JavaScript off): the fallback applies, and night mode
|
||||||
|
* comes from the extension's invert filter on main img[src$=".svg"];
|
||||||
|
* - in the pdf: librsvg ignores var() and uses the fallback, so print gets
|
||||||
|
* the light palette -- which is what a printed page wants.
|
||||||
|
*
|
||||||
|
* The fallbacks are this book's own light values; the tokens carry the night
|
||||||
|
* and high-contrast ones. Nothing here keys off prefers-color-scheme: the
|
||||||
|
* page's toggle decides, never the reader's system setting.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
@@ -25,32 +32,32 @@ svg {
|
|||||||
|
|
||||||
/* ---- surfaces ------------------------------------------------------- */
|
/* ---- surfaces ------------------------------------------------------- */
|
||||||
|
|
||||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box-weak { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
.box-accent { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
.box-warn { fill: var(--calc-faint, #f8f1e0); stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.4; }
|
||||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
.box-plain { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-grid, #dae0e8); stroke-width: 1.2; }
|
||||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
.diamond { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
.ellipse { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; }
|
||||||
|
|
||||||
/* ---- lines ---------------------------------------------------------- */
|
/* ---- lines ---------------------------------------------------------- */
|
||||||
|
|
||||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
.edge { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.3; }
|
||||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
.edge-strong{ fill: none; stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
.edge-warn { fill: none; stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.6; }
|
||||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
.edge-dash { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
.rule { stroke: var(--calc-grid, #dae0e8); stroke-width: 1; }
|
||||||
|
|
||||||
/* ---- text ----------------------------------------------------------- */
|
/* ---- text ----------------------------------------------------------- */
|
||||||
|
|
||||||
.t { fill: #1b2430; font-size: 13px; }
|
.t { fill: var(--calc-ink, #1b2430); font-size: 13px; }
|
||||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
.t-sm { fill: var(--calc-ink, #1b2430); font-size: 11px; }
|
||||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
.t-lead { fill: var(--calc-ink, #1b2430); font-size: 14px; font-weight: 600; }
|
||||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
.t-mut { fill: var(--calc-muted, #5a6879); font-size: 11px; }
|
||||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
.t-key { fill: var(--calc-ink, #1b2430); font-size: 12px; text-decoration: underline; }
|
||||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
.t-accent { fill: var(--calc-notecolor, #20666f); font-size: 12px; font-weight: 600; }
|
||||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
.t-warn { fill: var(--calc-accent-b, #D1541F); font-size: 12px; font-weight: 600; }
|
||||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
.t-mono { fill: var(--calc-ink, #1b2430); font-size: 11.5px;
|
||||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||||
|
|
||||||
.mid { text-anchor: middle; }
|
.mid { text-anchor: middle; }
|
||||||
@@ -67,7 +74,7 @@ svg {
|
|||||||
.node:hover .box,
|
.node:hover .box,
|
||||||
.node:hover .box-accent,
|
.node:hover .box-accent,
|
||||||
.node:hover .diamond { stroke-width: 2.6; }
|
.node:hover .diamond { stroke-width: 2.6; }
|
||||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
.node:hover .t, .node:hover .t-lead { fill: var(--calc-notecolor, #20666f); }
|
||||||
|
|
||||||
svg:hover .node:not(:hover) { opacity: .55; }
|
svg:hover .node:not(:hover) { opacity: .55; }
|
||||||
|
|
||||||
@@ -78,43 +85,14 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
.node { transition: none; }
|
.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 ======================================================
|
/* ---- arrowheads ======================================================
|
||||||
* marker contents cannot inherit the referencing element's fill, so each
|
* marker contents cannot inherit the referencing element's fill, so each
|
||||||
* arrowhead is its own class and is themed alongside the line it ends.
|
* arrowhead is its own class and is themed alongside the line it ends.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.arrow { fill: #5a6879; }
|
.arrow { fill: var(--calc-muted, #5a6879); }
|
||||||
.arrow-strong { fill: #20666f; }
|
.arrow-strong { fill: var(--calc-notecolor, #20666f); }
|
||||||
.arrow-warn { fill: #8a5a08; }
|
.arrow-warn { fill: var(--calc-accent-b, #D1541F); }
|
||||||
|
|
||||||
]]></style>
|
]]></style>
|
||||||
|
|
||||||
@@ -152,5 +130,5 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
|
|
||||||
<!-- who knows whom -->
|
<!-- 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-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>
|
<text class="t-mut" data-label="cost" x="14" y="202">Die Verdrahtung steht im Code selbst — Schritt 1.</text>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.6 KiB |
@@ -9,12 +9,19 @@
|
|||||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||||
* whole book.
|
* whole book.
|
||||||
*
|
*
|
||||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
* Colours are the extension's tokens (_extensions/notes/theme.css) with a
|
||||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
* literal fallback, which covers all three ways a figure is seen:
|
||||||
*
|
*
|
||||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
* - inlined into the page by figures/flow-player.html: the tokens resolve
|
||||||
* ignores media queries when it makes the pdf, so print always gets the light
|
* against the page, so the figure follows light, night and high contrast;
|
||||||
* theme -- which is what a printed page wants.
|
* - as a plain <img> (JavaScript off): the fallback applies, and night mode
|
||||||
|
* comes from the extension's invert filter on main img[src$=".svg"];
|
||||||
|
* - in the pdf: librsvg ignores var() and uses the fallback, so print gets
|
||||||
|
* the light palette -- which is what a printed page wants.
|
||||||
|
*
|
||||||
|
* The fallbacks are this book's own light values; the tokens carry the night
|
||||||
|
* and high-contrast ones. Nothing here keys off prefers-color-scheme: the
|
||||||
|
* page's toggle decides, never the reader's system setting.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
@@ -25,32 +32,32 @@ svg {
|
|||||||
|
|
||||||
/* ---- surfaces ------------------------------------------------------- */
|
/* ---- surfaces ------------------------------------------------------- */
|
||||||
|
|
||||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box-weak { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
.box-accent { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
.box-warn { fill: var(--calc-faint, #f8f1e0); stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.4; }
|
||||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
.box-plain { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-grid, #dae0e8); stroke-width: 1.2; }
|
||||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
.diamond { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
.ellipse { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; }
|
||||||
|
|
||||||
/* ---- lines ---------------------------------------------------------- */
|
/* ---- lines ---------------------------------------------------------- */
|
||||||
|
|
||||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
.edge { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.3; }
|
||||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
.edge-strong{ fill: none; stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
.edge-warn { fill: none; stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.6; }
|
||||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
.edge-dash { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
.rule { stroke: var(--calc-grid, #dae0e8); stroke-width: 1; }
|
||||||
|
|
||||||
/* ---- text ----------------------------------------------------------- */
|
/* ---- text ----------------------------------------------------------- */
|
||||||
|
|
||||||
.t { fill: #1b2430; font-size: 13px; }
|
.t { fill: var(--calc-ink, #1b2430); font-size: 13px; }
|
||||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
.t-sm { fill: var(--calc-ink, #1b2430); font-size: 11px; }
|
||||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
.t-lead { fill: var(--calc-ink, #1b2430); font-size: 14px; font-weight: 600; }
|
||||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
.t-mut { fill: var(--calc-muted, #5a6879); font-size: 11px; }
|
||||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
.t-key { fill: var(--calc-ink, #1b2430); font-size: 12px; text-decoration: underline; }
|
||||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
.t-accent { fill: var(--calc-notecolor, #20666f); font-size: 12px; font-weight: 600; }
|
||||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
.t-warn { fill: var(--calc-accent-b, #D1541F); font-size: 12px; font-weight: 600; }
|
||||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
.t-mono { fill: var(--calc-ink, #1b2430); font-size: 11.5px;
|
||||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||||
|
|
||||||
.mid { text-anchor: middle; }
|
.mid { text-anchor: middle; }
|
||||||
@@ -67,7 +74,7 @@ svg {
|
|||||||
.node:hover .box,
|
.node:hover .box,
|
||||||
.node:hover .box-accent,
|
.node:hover .box-accent,
|
||||||
.node:hover .diamond { stroke-width: 2.6; }
|
.node:hover .diamond { stroke-width: 2.6; }
|
||||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
.node:hover .t, .node:hover .t-lead { fill: var(--calc-notecolor, #20666f); }
|
||||||
|
|
||||||
svg:hover .node:not(:hover) { opacity: .55; }
|
svg:hover .node:not(:hover) { opacity: .55; }
|
||||||
|
|
||||||
@@ -78,43 +85,14 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
.node { transition: none; }
|
.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 ======================================================
|
/* ---- arrowheads ======================================================
|
||||||
* marker contents cannot inherit the referencing element's fill, so each
|
* marker contents cannot inherit the referencing element's fill, so each
|
||||||
* arrowhead is its own class and is themed alongside the line it ends.
|
* arrowhead is its own class and is themed alongside the line it ends.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.arrow { fill: #5a6879; }
|
.arrow { fill: var(--calc-muted, #5a6879); }
|
||||||
.arrow-strong { fill: #20666f; }
|
.arrow-strong { fill: var(--calc-notecolor, #20666f); }
|
||||||
.arrow-warn { fill: #8a5a08; }
|
.arrow-warn { fill: var(--calc-accent-b, #D1541F); }
|
||||||
|
|
||||||
]]></style>
|
]]></style>
|
||||||
|
|
||||||
@@ -152,5 +130,5 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
|
|
||||||
<!-- who knows whom -->
|
<!-- 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-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>
|
<text class="t-mut" data-label="cost" x="14" y="202">The wiring is written into the code itself — step 1.</text>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.6 KiB |
@@ -9,12 +9,19 @@
|
|||||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||||
* whole book.
|
* whole book.
|
||||||
*
|
*
|
||||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
* Colours are the extension's tokens (_extensions/notes/theme.css) with a
|
||||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
* literal fallback, which covers all three ways a figure is seen:
|
||||||
*
|
*
|
||||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
* - inlined into the page by figures/flow-player.html: the tokens resolve
|
||||||
* ignores media queries when it makes the pdf, so print always gets the light
|
* against the page, so the figure follows light, night and high contrast;
|
||||||
* theme -- which is what a printed page wants.
|
* - as a plain <img> (JavaScript off): the fallback applies, and night mode
|
||||||
|
* comes from the extension's invert filter on main img[src$=".svg"];
|
||||||
|
* - in the pdf: librsvg ignores var() and uses the fallback, so print gets
|
||||||
|
* the light palette -- which is what a printed page wants.
|
||||||
|
*
|
||||||
|
* The fallbacks are this book's own light values; the tokens carry the night
|
||||||
|
* and high-contrast ones. Nothing here keys off prefers-color-scheme: the
|
||||||
|
* page's toggle decides, never the reader's system setting.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
@@ -25,32 +32,32 @@ svg {
|
|||||||
|
|
||||||
/* ---- surfaces ------------------------------------------------------- */
|
/* ---- surfaces ------------------------------------------------------- */
|
||||||
|
|
||||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box-weak { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
.box-accent { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
.box-warn { fill: var(--calc-faint, #f8f1e0); stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.4; }
|
||||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
.box-plain { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-grid, #dae0e8); stroke-width: 1.2; }
|
||||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
.diamond { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
.ellipse { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; }
|
||||||
|
|
||||||
/* ---- lines ---------------------------------------------------------- */
|
/* ---- lines ---------------------------------------------------------- */
|
||||||
|
|
||||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
.edge { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.3; }
|
||||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
.edge-strong{ fill: none; stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
.edge-warn { fill: none; stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.6; }
|
||||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
.edge-dash { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
.rule { stroke: var(--calc-grid, #dae0e8); stroke-width: 1; }
|
||||||
|
|
||||||
/* ---- text ----------------------------------------------------------- */
|
/* ---- text ----------------------------------------------------------- */
|
||||||
|
|
||||||
.t { fill: #1b2430; font-size: 13px; }
|
.t { fill: var(--calc-ink, #1b2430); font-size: 13px; }
|
||||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
.t-sm { fill: var(--calc-ink, #1b2430); font-size: 11px; }
|
||||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
.t-lead { fill: var(--calc-ink, #1b2430); font-size: 14px; font-weight: 600; }
|
||||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
.t-mut { fill: var(--calc-muted, #5a6879); font-size: 11px; }
|
||||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
.t-key { fill: var(--calc-ink, #1b2430); font-size: 12px; text-decoration: underline; }
|
||||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
.t-accent { fill: var(--calc-notecolor, #20666f); font-size: 12px; font-weight: 600; }
|
||||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
.t-warn { fill: var(--calc-accent-b, #D1541F); font-size: 12px; font-weight: 600; }
|
||||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
.t-mono { fill: var(--calc-ink, #1b2430); font-size: 11.5px;
|
||||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||||
|
|
||||||
.mid { text-anchor: middle; }
|
.mid { text-anchor: middle; }
|
||||||
@@ -67,7 +74,7 @@ svg {
|
|||||||
.node:hover .box,
|
.node:hover .box,
|
||||||
.node:hover .box-accent,
|
.node:hover .box-accent,
|
||||||
.node:hover .diamond { stroke-width: 2.6; }
|
.node:hover .diamond { stroke-width: 2.6; }
|
||||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
.node:hover .t, .node:hover .t-lead { fill: var(--calc-notecolor, #20666f); }
|
||||||
|
|
||||||
svg:hover .node:not(:hover) { opacity: .55; }
|
svg:hover .node:not(:hover) { opacity: .55; }
|
||||||
|
|
||||||
@@ -78,43 +85,14 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
.node { transition: none; }
|
.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 ======================================================
|
/* ---- arrowheads ======================================================
|
||||||
* marker contents cannot inherit the referencing element's fill, so each
|
* marker contents cannot inherit the referencing element's fill, so each
|
||||||
* arrowhead is its own class and is themed alongside the line it ends.
|
* arrowhead is its own class and is themed alongside the line it ends.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.arrow { fill: #5a6879; }
|
.arrow { fill: var(--calc-muted, #5a6879); }
|
||||||
.arrow-strong { fill: #20666f; }
|
.arrow-strong { fill: var(--calc-notecolor, #20666f); }
|
||||||
.arrow-warn { fill: #8a5a08; }
|
.arrow-warn { fill: var(--calc-accent-b, #D1541F); }
|
||||||
|
|
||||||
]]></style>
|
]]></style>
|
||||||
|
|
||||||
@@ -152,5 +130,5 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
|
|
||||||
<!-- who knows whom -->
|
<!-- 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-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>
|
<text class="t-mut" data-label="cost" x="14" y="202">Le câblage est écrit dans le code lui-même — étape 1.</text>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.7 KiB |
@@ -1,4 +1,4 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 700" width="620" height="700"
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 750" width="620" height="750"
|
||||||
role="img" aria-labelledby="fp-title">
|
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>
|
<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[
|
<style><![CDATA[
|
||||||
@@ -9,12 +9,19 @@
|
|||||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||||
* whole book.
|
* whole book.
|
||||||
*
|
*
|
||||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
* Colours are the extension's tokens (_extensions/notes/theme.css) with a
|
||||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
* literal fallback, which covers all three ways a figure is seen:
|
||||||
*
|
*
|
||||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
* - inlined into the page by figures/flow-player.html: the tokens resolve
|
||||||
* ignores media queries when it makes the pdf, so print always gets the light
|
* against the page, so the figure follows light, night and high contrast;
|
||||||
* theme -- which is what a printed page wants.
|
* - as a plain <img> (JavaScript off): the fallback applies, and night mode
|
||||||
|
* comes from the extension's invert filter on main img[src$=".svg"];
|
||||||
|
* - in the pdf: librsvg ignores var() and uses the fallback, so print gets
|
||||||
|
* the light palette -- which is what a printed page wants.
|
||||||
|
*
|
||||||
|
* The fallbacks are this book's own light values; the tokens carry the night
|
||||||
|
* and high-contrast ones. Nothing here keys off prefers-color-scheme: the
|
||||||
|
* page's toggle decides, never the reader's system setting.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
@@ -25,32 +32,32 @@ svg {
|
|||||||
|
|
||||||
/* ---- surfaces ------------------------------------------------------- */
|
/* ---- surfaces ------------------------------------------------------- */
|
||||||
|
|
||||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box-weak { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
.box-accent { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
.box-warn { fill: var(--calc-faint, #f8f1e0); stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.4; }
|
||||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
.box-plain { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-grid, #dae0e8); stroke-width: 1.2; }
|
||||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
.diamond { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
.ellipse { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; }
|
||||||
|
|
||||||
/* ---- lines ---------------------------------------------------------- */
|
/* ---- lines ---------------------------------------------------------- */
|
||||||
|
|
||||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
.edge { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.3; }
|
||||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
.edge-strong{ fill: none; stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
.edge-warn { fill: none; stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.6; }
|
||||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
.edge-dash { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
.rule { stroke: var(--calc-grid, #dae0e8); stroke-width: 1; }
|
||||||
|
|
||||||
/* ---- text ----------------------------------------------------------- */
|
/* ---- text ----------------------------------------------------------- */
|
||||||
|
|
||||||
.t { fill: #1b2430; font-size: 13px; }
|
.t { fill: var(--calc-ink, #1b2430); font-size: 13px; }
|
||||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
.t-sm { fill: var(--calc-ink, #1b2430); font-size: 11px; }
|
||||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
.t-lead { fill: var(--calc-ink, #1b2430); font-size: 14px; font-weight: 600; }
|
||||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
.t-mut { fill: var(--calc-muted, #5a6879); font-size: 11px; }
|
||||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
.t-key { fill: var(--calc-ink, #1b2430); font-size: 12px; text-decoration: underline; }
|
||||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
.t-accent { fill: var(--calc-notecolor, #20666f); font-size: 12px; font-weight: 600; }
|
||||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
.t-warn { fill: var(--calc-accent-b, #D1541F); font-size: 12px; font-weight: 600; }
|
||||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
.t-mono { fill: var(--calc-ink, #1b2430); font-size: 11.5px;
|
||||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||||
|
|
||||||
.mid { text-anchor: middle; }
|
.mid { text-anchor: middle; }
|
||||||
@@ -67,7 +74,7 @@ svg {
|
|||||||
.node:hover .box,
|
.node:hover .box,
|
||||||
.node:hover .box-accent,
|
.node:hover .box-accent,
|
||||||
.node:hover .diamond { stroke-width: 2.6; }
|
.node:hover .diamond { stroke-width: 2.6; }
|
||||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
.node:hover .t, .node:hover .t-lead { fill: var(--calc-notecolor, #20666f); }
|
||||||
|
|
||||||
svg:hover .node:not(:hover) { opacity: .55; }
|
svg:hover .node:not(:hover) { opacity: .55; }
|
||||||
|
|
||||||
@@ -78,43 +85,14 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
.node { transition: none; }
|
.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 ======================================================
|
/* ---- arrowheads ======================================================
|
||||||
* marker contents cannot inherit the referencing element's fill, so each
|
* marker contents cannot inherit the referencing element's fill, so each
|
||||||
* arrowhead is its own class and is themed alongside the line it ends.
|
* arrowhead is its own class and is themed alongside the line it ends.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.arrow { fill: #5a6879; }
|
.arrow { fill: var(--calc-muted, #5a6879); }
|
||||||
.arrow-strong { fill: #20666f; }
|
.arrow-strong { fill: var(--calc-notecolor, #20666f); }
|
||||||
.arrow-warn { fill: #8a5a08; }
|
.arrow-warn { fill: var(--calc-accent-b, #D1541F); }
|
||||||
|
|
||||||
]]>
|
]]>
|
||||||
[data-label="mediator1"] { font-size: 11px; }
|
[data-label="mediator1"] { font-size: 11px; }
|
||||||
@@ -205,9 +183,17 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
<!-- the four directories belong to one message board on one filesystem -->
|
<!-- the four directories belong to one message board on one filesystem -->
|
||||||
<path class="edge-dash" d="M436,98 H452 V580 H436"/>
|
<path class="edge-dash" d="M436,98 H452 V580 H436"/>
|
||||||
<text class="t-mono" x="460" y="330">messageBoard/</text>
|
<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>
|
<!-- two lines: one line of this label ran past the 620-wide viewBox in
|
||||||
|
German and French, where an svg root clips rather than overflows =
|
||||||
|
a truncated label at phone width. -->
|
||||||
|
<text class="t-mut" data-label="board" x="460" y="348">Verzeichnis = Postfach</text>
|
||||||
|
<text class="t-mut" data-label="board2" x="460" y="363">Datei = Nachricht</text>
|
||||||
|
|
||||||
<!-- the five processes are started by hand, one terminal each -->
|
<!-- the five processes are started by hand, one terminal each -->
|
||||||
<path class="edge-dash" d="M104,24 H88 V654 H104"/>
|
<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>
|
<!-- three lines: one ran well past the viewBox in every language, and an
|
||||||
|
svg root clips rather than overflows. -->
|
||||||
|
<text class="t-warn" data-label="topology" x="14" y="700">Fünf von Hand gestartete Prozesse.</text>
|
||||||
|
<text class="t-warn" data-label="topology2" x="14" y="716">Die Topologie steckt nun in den zwei Mediator-Befehlszeilen —</text>
|
||||||
|
<text class="t-warn" data-label="topology3" x="14" y="732">bei dem, der sie getippt hat.</text>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
@@ -1,4 +1,4 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 700" width="620" height="700"
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 750" width="620" height="750"
|
||||||
role="img" aria-labelledby="fp-title">
|
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>
|
<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[
|
<style><![CDATA[
|
||||||
@@ -9,12 +9,19 @@
|
|||||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||||
* whole book.
|
* whole book.
|
||||||
*
|
*
|
||||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
* Colours are the extension's tokens (_extensions/notes/theme.css) with a
|
||||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
* literal fallback, which covers all three ways a figure is seen:
|
||||||
*
|
*
|
||||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
* - inlined into the page by figures/flow-player.html: the tokens resolve
|
||||||
* ignores media queries when it makes the pdf, so print always gets the light
|
* against the page, so the figure follows light, night and high contrast;
|
||||||
* theme -- which is what a printed page wants.
|
* - as a plain <img> (JavaScript off): the fallback applies, and night mode
|
||||||
|
* comes from the extension's invert filter on main img[src$=".svg"];
|
||||||
|
* - in the pdf: librsvg ignores var() and uses the fallback, so print gets
|
||||||
|
* the light palette -- which is what a printed page wants.
|
||||||
|
*
|
||||||
|
* The fallbacks are this book's own light values; the tokens carry the night
|
||||||
|
* and high-contrast ones. Nothing here keys off prefers-color-scheme: the
|
||||||
|
* page's toggle decides, never the reader's system setting.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
@@ -25,32 +32,32 @@ svg {
|
|||||||
|
|
||||||
/* ---- surfaces ------------------------------------------------------- */
|
/* ---- surfaces ------------------------------------------------------- */
|
||||||
|
|
||||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box-weak { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
.box-accent { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
.box-warn { fill: var(--calc-faint, #f8f1e0); stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.4; }
|
||||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
.box-plain { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-grid, #dae0e8); stroke-width: 1.2; }
|
||||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
.diamond { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
.ellipse { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; }
|
||||||
|
|
||||||
/* ---- lines ---------------------------------------------------------- */
|
/* ---- lines ---------------------------------------------------------- */
|
||||||
|
|
||||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
.edge { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.3; }
|
||||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
.edge-strong{ fill: none; stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
.edge-warn { fill: none; stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.6; }
|
||||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
.edge-dash { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
.rule { stroke: var(--calc-grid, #dae0e8); stroke-width: 1; }
|
||||||
|
|
||||||
/* ---- text ----------------------------------------------------------- */
|
/* ---- text ----------------------------------------------------------- */
|
||||||
|
|
||||||
.t { fill: #1b2430; font-size: 13px; }
|
.t { fill: var(--calc-ink, #1b2430); font-size: 13px; }
|
||||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
.t-sm { fill: var(--calc-ink, #1b2430); font-size: 11px; }
|
||||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
.t-lead { fill: var(--calc-ink, #1b2430); font-size: 14px; font-weight: 600; }
|
||||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
.t-mut { fill: var(--calc-muted, #5a6879); font-size: 11px; }
|
||||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
.t-key { fill: var(--calc-ink, #1b2430); font-size: 12px; text-decoration: underline; }
|
||||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
.t-accent { fill: var(--calc-notecolor, #20666f); font-size: 12px; font-weight: 600; }
|
||||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
.t-warn { fill: var(--calc-accent-b, #D1541F); font-size: 12px; font-weight: 600; }
|
||||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
.t-mono { fill: var(--calc-ink, #1b2430); font-size: 11.5px;
|
||||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||||
|
|
||||||
.mid { text-anchor: middle; }
|
.mid { text-anchor: middle; }
|
||||||
@@ -67,7 +74,7 @@ svg {
|
|||||||
.node:hover .box,
|
.node:hover .box,
|
||||||
.node:hover .box-accent,
|
.node:hover .box-accent,
|
||||||
.node:hover .diamond { stroke-width: 2.6; }
|
.node:hover .diamond { stroke-width: 2.6; }
|
||||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
.node:hover .t, .node:hover .t-lead { fill: var(--calc-notecolor, #20666f); }
|
||||||
|
|
||||||
svg:hover .node:not(:hover) { opacity: .55; }
|
svg:hover .node:not(:hover) { opacity: .55; }
|
||||||
|
|
||||||
@@ -78,43 +85,14 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
.node { transition: none; }
|
.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 ======================================================
|
/* ---- arrowheads ======================================================
|
||||||
* marker contents cannot inherit the referencing element's fill, so each
|
* marker contents cannot inherit the referencing element's fill, so each
|
||||||
* arrowhead is its own class and is themed alongside the line it ends.
|
* arrowhead is its own class and is themed alongside the line it ends.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.arrow { fill: #5a6879; }
|
.arrow { fill: var(--calc-muted, #5a6879); }
|
||||||
.arrow-strong { fill: #20666f; }
|
.arrow-strong { fill: var(--calc-notecolor, #20666f); }
|
||||||
.arrow-warn { fill: #8a5a08; }
|
.arrow-warn { fill: var(--calc-accent-b, #D1541F); }
|
||||||
|
|
||||||
]]></style>
|
]]></style>
|
||||||
|
|
||||||
@@ -203,9 +181,17 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
<!-- the four directories belong to one message board on one filesystem -->
|
<!-- the four directories belong to one message board on one filesystem -->
|
||||||
<path class="edge-dash" d="M436,98 H452 V580 H436"/>
|
<path class="edge-dash" d="M436,98 H452 V580 H436"/>
|
||||||
<text class="t-mono" x="460" y="330">messageBoard/</text>
|
<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>
|
<!-- two lines: one line of this label ran past the 620-wide viewBox in
|
||||||
|
German and French, where an svg root clips rather than overflows =
|
||||||
|
a truncated label at phone width. -->
|
||||||
|
<text class="t-mut" data-label="board" x="460" y="348">directory = mailbox</text>
|
||||||
|
<text class="t-mut" data-label="board2" x="460" y="363">file = message</text>
|
||||||
|
|
||||||
<!-- the five processes are started by hand, one terminal each -->
|
<!-- the five processes are started by hand, one terminal each -->
|
||||||
<path class="edge-dash" d="M104,24 H88 V654 H104"/>
|
<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>
|
<!-- three lines: one ran well past the viewBox in every language, and an
|
||||||
|
svg root clips rather than overflows. -->
|
||||||
|
<text class="t-warn" data-label="topology" x="14" y="700">Five processes started by hand.</text>
|
||||||
|
<text class="t-warn" data-label="topology2" x="14" y="716">The topology now lives in the two Mediator command lines —</text>
|
||||||
|
<text class="t-warn" data-label="topology3" x="14" y="732">in whoever typed them.</text>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
@@ -1,4 +1,4 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 700" width="620" height="700"
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 750" width="620" height="750"
|
||||||
role="img" aria-labelledby="fp-title">
|
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>
|
<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[
|
<style><![CDATA[
|
||||||
@@ -9,12 +9,19 @@
|
|||||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||||
* whole book.
|
* whole book.
|
||||||
*
|
*
|
||||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
* Colours are the extension's tokens (_extensions/notes/theme.css) with a
|
||||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
* literal fallback, which covers all three ways a figure is seen:
|
||||||
*
|
*
|
||||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
* - inlined into the page by figures/flow-player.html: the tokens resolve
|
||||||
* ignores media queries when it makes the pdf, so print always gets the light
|
* against the page, so the figure follows light, night and high contrast;
|
||||||
* theme -- which is what a printed page wants.
|
* - as a plain <img> (JavaScript off): the fallback applies, and night mode
|
||||||
|
* comes from the extension's invert filter on main img[src$=".svg"];
|
||||||
|
* - in the pdf: librsvg ignores var() and uses the fallback, so print gets
|
||||||
|
* the light palette -- which is what a printed page wants.
|
||||||
|
*
|
||||||
|
* The fallbacks are this book's own light values; the tokens carry the night
|
||||||
|
* and high-contrast ones. Nothing here keys off prefers-color-scheme: the
|
||||||
|
* page's toggle decides, never the reader's system setting.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
@@ -25,32 +32,32 @@ svg {
|
|||||||
|
|
||||||
/* ---- surfaces ------------------------------------------------------- */
|
/* ---- surfaces ------------------------------------------------------- */
|
||||||
|
|
||||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box-weak { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
.box-accent { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
.box-warn { fill: var(--calc-faint, #f8f1e0); stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.4; }
|
||||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
.box-plain { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-grid, #dae0e8); stroke-width: 1.2; }
|
||||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
.diamond { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
.ellipse { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; }
|
||||||
|
|
||||||
/* ---- lines ---------------------------------------------------------- */
|
/* ---- lines ---------------------------------------------------------- */
|
||||||
|
|
||||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
.edge { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.3; }
|
||||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
.edge-strong{ fill: none; stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
.edge-warn { fill: none; stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.6; }
|
||||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
.edge-dash { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
.rule { stroke: var(--calc-grid, #dae0e8); stroke-width: 1; }
|
||||||
|
|
||||||
/* ---- text ----------------------------------------------------------- */
|
/* ---- text ----------------------------------------------------------- */
|
||||||
|
|
||||||
.t { fill: #1b2430; font-size: 13px; }
|
.t { fill: var(--calc-ink, #1b2430); font-size: 13px; }
|
||||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
.t-sm { fill: var(--calc-ink, #1b2430); font-size: 11px; }
|
||||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
.t-lead { fill: var(--calc-ink, #1b2430); font-size: 14px; font-weight: 600; }
|
||||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
.t-mut { fill: var(--calc-muted, #5a6879); font-size: 11px; }
|
||||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
.t-key { fill: var(--calc-ink, #1b2430); font-size: 12px; text-decoration: underline; }
|
||||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
.t-accent { fill: var(--calc-notecolor, #20666f); font-size: 12px; font-weight: 600; }
|
||||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
.t-warn { fill: var(--calc-accent-b, #D1541F); font-size: 12px; font-weight: 600; }
|
||||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
.t-mono { fill: var(--calc-ink, #1b2430); font-size: 11.5px;
|
||||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||||
|
|
||||||
.mid { text-anchor: middle; }
|
.mid { text-anchor: middle; }
|
||||||
@@ -67,7 +74,7 @@ svg {
|
|||||||
.node:hover .box,
|
.node:hover .box,
|
||||||
.node:hover .box-accent,
|
.node:hover .box-accent,
|
||||||
.node:hover .diamond { stroke-width: 2.6; }
|
.node:hover .diamond { stroke-width: 2.6; }
|
||||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
.node:hover .t, .node:hover .t-lead { fill: var(--calc-notecolor, #20666f); }
|
||||||
|
|
||||||
svg:hover .node:not(:hover) { opacity: .55; }
|
svg:hover .node:not(:hover) { opacity: .55; }
|
||||||
|
|
||||||
@@ -78,43 +85,14 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
.node { transition: none; }
|
.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 ======================================================
|
/* ---- arrowheads ======================================================
|
||||||
* marker contents cannot inherit the referencing element's fill, so each
|
* marker contents cannot inherit the referencing element's fill, so each
|
||||||
* arrowhead is its own class and is themed alongside the line it ends.
|
* arrowhead is its own class and is themed alongside the line it ends.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.arrow { fill: #5a6879; }
|
.arrow { fill: var(--calc-muted, #5a6879); }
|
||||||
.arrow-strong { fill: #20666f; }
|
.arrow-strong { fill: var(--calc-notecolor, #20666f); }
|
||||||
.arrow-warn { fill: #8a5a08; }
|
.arrow-warn { fill: var(--calc-accent-b, #D1541F); }
|
||||||
|
|
||||||
]]></style>
|
]]></style>
|
||||||
|
|
||||||
@@ -203,9 +181,17 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
<!-- the four directories belong to one message board on one filesystem -->
|
<!-- the four directories belong to one message board on one filesystem -->
|
||||||
<path class="edge-dash" d="M436,98 H452 V580 H436"/>
|
<path class="edge-dash" d="M436,98 H452 V580 H436"/>
|
||||||
<text class="t-mono" x="460" y="330">messageBoard/</text>
|
<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>
|
<!-- two lines: one line of this label ran past the 620-wide viewBox in
|
||||||
|
German and French, where an svg root clips rather than overflows =
|
||||||
|
a truncated label at phone width. -->
|
||||||
|
<text class="t-mut" data-label="board" x="460" y="348">répertoire = boîte</text>
|
||||||
|
<text class="t-mut" data-label="board2" x="460" y="363">fichier = message</text>
|
||||||
|
|
||||||
<!-- the five processes are started by hand, one terminal each -->
|
<!-- the five processes are started by hand, one terminal each -->
|
||||||
<path class="edge-dash" d="M104,24 H88 V654 H104"/>
|
<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>
|
<!-- three lines: one ran well past the viewBox in every language, and an
|
||||||
|
svg root clips rather than overflows. -->
|
||||||
|
<text class="t-warn" data-label="topology" x="14" y="700">Cinq processus lancés à la main.</text>
|
||||||
|
<text class="t-warn" data-label="topology2" x="14" y="716">La topologie vit désormais dans les deux lignes de commande</text>
|
||||||
|
<text class="t-warn" data-label="topology3" x="14" y="732">Mediator — chez celui qui les a tapées.</text>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
@@ -11,17 +11,24 @@
|
|||||||
already the whole picture. Here the image is fetched, inlined, and given
|
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
|
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
|
[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. -->
|
ends at. Colours are the extension's --calc-… tokens, the same ones
|
||||||
|
diagram.css uses, so the figure, the token and the bar stay in step in
|
||||||
|
light mode, in night mode and in high contrast. Nothing here keys off
|
||||||
|
prefers-color-scheme: the page's own toggle decides. -->
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.flow-wrap { margin: 0; }
|
.flow-wrap { margin: 0; }
|
||||||
.flow-wrap svg { width: 100%; height: auto; display: block; }
|
.flow-wrap svg { width: 100%; height: auto; display: block; }
|
||||||
|
|
||||||
.flow-token { fill: #8a5a08; stroke: #fbfcfd; stroke-width: 1.2; }
|
.flow-token {
|
||||||
|
fill: var(--calc-accent-b, #D1541F);
|
||||||
|
stroke: var(--calc-surface, #fbfcfd);
|
||||||
|
stroke-width: 1.2;
|
||||||
|
}
|
||||||
.flow-wrap .flow-on .box,
|
.flow-wrap .flow-on .box,
|
||||||
.flow-wrap .flow-on .box-plain,
|
.flow-wrap .flow-on .box-plain,
|
||||||
.flow-wrap .flow-on .box-accent { stroke-width: 3; }
|
.flow-wrap .flow-on .box-accent { stroke-width: 3; }
|
||||||
.flow-wrap .flow-done { stroke: #8a5a08; }
|
.flow-wrap .flow-done { stroke: var(--calc-accent-b, #D1541F); }
|
||||||
|
|
||||||
.flow-bar {
|
.flow-bar {
|
||||||
display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
|
display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
|
||||||
@@ -29,21 +36,16 @@
|
|||||||
}
|
}
|
||||||
.flow-bar button {
|
.flow-bar button {
|
||||||
font: inherit; font-size: .82rem; padding: .18rem .7rem; cursor: pointer;
|
font: inherit; font-size: .82rem; padding: .18rem .7rem; cursor: pointer;
|
||||||
border: 1px solid #dae0e8; border-radius: 999px;
|
border: 1px solid var(--calc-grid, #dae0e8); border-radius: 999px;
|
||||||
background: #fbfcfd; color: #5a6879;
|
background: var(--calc-surface, #fbfcfd); color: var(--calc-muted, #5a6879);
|
||||||
|
}
|
||||||
|
.flow-bar button:hover {
|
||||||
|
border-color: var(--calc-notecolor, #20666f);
|
||||||
|
color: var(--calc-notecolor, #20666f);
|
||||||
}
|
}
|
||||||
.flow-bar button:hover { border-color: #20666f; color: #20666f; }
|
|
||||||
.flow-bar button[disabled] { opacity: .45; cursor: default; }
|
.flow-bar button[disabled] { opacity: .45; cursor: default; }
|
||||||
.flow-status { font-size: .8rem; color: #5a6879; }
|
.flow-status { font-size: .8rem; color: var(--calc-muted, #5a6879); }
|
||||||
.flow-status b { color: #20666f; font-weight: 600; }
|
.flow-status b { color: var(--calc-notecolor, #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>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -9,9 +9,9 @@
|
|||||||
# `alt` is the figure's accessible description (the svg <title>); it is read by
|
# `alt` is the figure's accessible description (the svg <title>); it is read by
|
||||||
# a screen reader, so it says what the picture shows, not that it is a picture.
|
# a screen reader, so it says what the picture shows, not that it is a picture.
|
||||||
#
|
#
|
||||||
# Identifiers from the tutorial (consoleIn.outbox, rot13/inbox, SensorService,
|
# Identifiers from the source material (consoleIn.outbox, rot13/inbox, SensorService,
|
||||||
# Mediator.java, .msg, WatchService, put, take) are never translated: they are
|
# Mediator.java, .msg, WatchService, put, take) are never translated: they are
|
||||||
# names in the code, and the tutorial's terminology is kept exactly.
|
# names in the code, and the source terminology is kept exactly.
|
||||||
#
|
#
|
||||||
# German runs long. Where a label would overflow its box, give it a size:
|
# German runs long. Where a label would overflow its box, give it a size:
|
||||||
# key: {en: "Primary key", de: {text: "Primärschlüssel", size: 10}}
|
# key: {en: "Primary key", de: {text: "Primärschlüssel", size: 10}}
|
||||||
@@ -35,9 +35,9 @@ direct-calls:
|
|||||||
fr: "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."
|
fr: "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."
|
||||||
de: "main() kennt alle drei: ihre Namen, Argument- und Ergebnistypen und dass sie sofort verfügbar sind."
|
de: "main() kennt alle drei: ihre Namen, Argument- und Ergebnistypen und dass sie sofort verfügbar sind."
|
||||||
cost:
|
cost:
|
||||||
en: "The wiring is written into the code itself — step 1 of the tutorial."
|
en: "The wiring is written into the code itself — step 1."
|
||||||
fr: "Le câblage est écrit dans le code lui-même — étape 1 du tutoriel."
|
fr: "Le câblage est écrit dans le code lui-même — étape 1."
|
||||||
de: "Die Verdrahtung steht im Code selbst — Schritt 1 des Tutorials."
|
de: "Die Verdrahtung steht im Code selbst — Schritt 1."
|
||||||
|
|
||||||
mailboxes-jvm:
|
mailboxes-jvm:
|
||||||
alt:
|
alt:
|
||||||
@@ -63,10 +63,16 @@ mailboxes-jvm:
|
|||||||
take2: {en: "take", fr: "take", de: "take"}
|
take2: {en: "take", fr: "take", de: "take"}
|
||||||
take3: {en: "take", fr: "take", de: "take"}
|
take3: {en: "take", fr: "take", de: "take"}
|
||||||
take4: {en: "take", fr: "take", de: "take"}
|
take4: {en: "take", fr: "take", de: "take"}
|
||||||
|
# two lines: one ran past the viewBox in German and French, and an svg root
|
||||||
|
# clips rather than overflows, so the label came out truncated
|
||||||
topology:
|
topology:
|
||||||
en: "No capability names another one. The topology lives only in the two mediators, started in main()."
|
en: "No capability names another one."
|
||||||
fr: "Aucune capacité ne nomme une autre. La topologie ne vit que dans les deux médiateurs, démarrés dans main()."
|
fr: "Aucune capacité ne nomme une autre."
|
||||||
de: "Keine Fähigkeit nennt eine andere. Die Topologie steckt nur in den zwei Vermittlern, gestartet in main()."
|
de: "Keine Fähigkeit nennt eine andere."
|
||||||
|
topology2:
|
||||||
|
en: "The topology lives only in the two mediators, started in main()."
|
||||||
|
fr: "La topologie ne vit que dans les deux médiateurs, démarrés dans main()."
|
||||||
|
de: "Die Topologie steckt nur in den zwei Vermittlern, gestartet in main()."
|
||||||
|
|
||||||
filesystem-processes:
|
filesystem-processes:
|
||||||
alt:
|
alt:
|
||||||
@@ -91,11 +97,25 @@ filesystem-processes:
|
|||||||
watch2: {en: "WatchService", fr: "WatchService", de: "WatchService"}
|
watch2: {en: "WatchService", fr: "WatchService", de: "WatchService"}
|
||||||
watch3: {en: "WatchService", fr: "WatchService", de: "WatchService"}
|
watch3: {en: "WatchService", fr: "WatchService", de: "WatchService"}
|
||||||
watch4: {en: "WatchService", fr: "WatchService", de: "WatchService"}
|
watch4: {en: "WatchService", fr: "WatchService", de: "WatchService"}
|
||||||
|
# two lines: one would run past the viewBox, and an svg root clips
|
||||||
board:
|
board:
|
||||||
en: "directory = mailbox, file = message"
|
en: "directory = mailbox"
|
||||||
fr: "répertoire = boîte, fichier = message"
|
fr: "répertoire = boîte"
|
||||||
de: "Verzeichnis = Postfach, Datei = Nachricht"
|
de: "Verzeichnis = Postfach"
|
||||||
|
board2:
|
||||||
|
en: "file = message"
|
||||||
|
fr: "fichier = message"
|
||||||
|
de: "Datei = Nachricht"
|
||||||
|
# three lines, for the same reason as the note of mailboxes-jvm
|
||||||
topology:
|
topology:
|
||||||
en: "Five processes started by hand. The topology now lives in the two Mediator command lines — in whoever typed them."
|
en: "Five processes started by hand."
|
||||||
fr: "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."
|
fr: "Cinq processus lancés à la main."
|
||||||
de: "Fünf von Hand gestartete Prozesse. Die Topologie steckt nun in den zwei Mediator-Befehlszeilen — bei dem, der sie getippt hat."
|
de: "Fünf von Hand gestartete Prozesse."
|
||||||
|
topology2:
|
||||||
|
en: "The topology now lives in the two Mediator command lines —"
|
||||||
|
fr: "La topologie vit désormais dans les deux lignes de commande"
|
||||||
|
de: "Die Topologie steckt nun in den zwei Mediator-Befehlszeilen —"
|
||||||
|
topology3:
|
||||||
|
en: "in whoever typed them."
|
||||||
|
fr: "Mediator — chez celui qui les a tapées."
|
||||||
|
de: "bei dem, der sie getippt hat."
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 700" width="560" height="700"
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 730" width="560" height="730"
|
||||||
role="img" aria-labelledby="mj-title">
|
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>
|
<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[
|
<style><![CDATA[
|
||||||
@@ -9,12 +9,19 @@
|
|||||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||||
* whole book.
|
* whole book.
|
||||||
*
|
*
|
||||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
* Colours are the extension's tokens (_extensions/notes/theme.css) with a
|
||||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
* literal fallback, which covers all three ways a figure is seen:
|
||||||
*
|
*
|
||||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
* - inlined into the page by figures/flow-player.html: the tokens resolve
|
||||||
* ignores media queries when it makes the pdf, so print always gets the light
|
* against the page, so the figure follows light, night and high contrast;
|
||||||
* theme -- which is what a printed page wants.
|
* - as a plain <img> (JavaScript off): the fallback applies, and night mode
|
||||||
|
* comes from the extension's invert filter on main img[src$=".svg"];
|
||||||
|
* - in the pdf: librsvg ignores var() and uses the fallback, so print gets
|
||||||
|
* the light palette -- which is what a printed page wants.
|
||||||
|
*
|
||||||
|
* The fallbacks are this book's own light values; the tokens carry the night
|
||||||
|
* and high-contrast ones. Nothing here keys off prefers-color-scheme: the
|
||||||
|
* page's toggle decides, never the reader's system setting.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
@@ -25,32 +32,32 @@ svg {
|
|||||||
|
|
||||||
/* ---- surfaces ------------------------------------------------------- */
|
/* ---- surfaces ------------------------------------------------------- */
|
||||||
|
|
||||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box-weak { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
.box-accent { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
.box-warn { fill: var(--calc-faint, #f8f1e0); stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.4; }
|
||||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
.box-plain { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-grid, #dae0e8); stroke-width: 1.2; }
|
||||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
.diamond { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
.ellipse { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; }
|
||||||
|
|
||||||
/* ---- lines ---------------------------------------------------------- */
|
/* ---- lines ---------------------------------------------------------- */
|
||||||
|
|
||||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
.edge { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.3; }
|
||||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
.edge-strong{ fill: none; stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
.edge-warn { fill: none; stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.6; }
|
||||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
.edge-dash { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
.rule { stroke: var(--calc-grid, #dae0e8); stroke-width: 1; }
|
||||||
|
|
||||||
/* ---- text ----------------------------------------------------------- */
|
/* ---- text ----------------------------------------------------------- */
|
||||||
|
|
||||||
.t { fill: #1b2430; font-size: 13px; }
|
.t { fill: var(--calc-ink, #1b2430); font-size: 13px; }
|
||||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
.t-sm { fill: var(--calc-ink, #1b2430); font-size: 11px; }
|
||||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
.t-lead { fill: var(--calc-ink, #1b2430); font-size: 14px; font-weight: 600; }
|
||||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
.t-mut { fill: var(--calc-muted, #5a6879); font-size: 11px; }
|
||||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
.t-key { fill: var(--calc-ink, #1b2430); font-size: 12px; text-decoration: underline; }
|
||||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
.t-accent { fill: var(--calc-notecolor, #20666f); font-size: 12px; font-weight: 600; }
|
||||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
.t-warn { fill: var(--calc-accent-b, #D1541F); font-size: 12px; font-weight: 600; }
|
||||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
.t-mono { fill: var(--calc-ink, #1b2430); font-size: 11.5px;
|
||||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||||
|
|
||||||
.mid { text-anchor: middle; }
|
.mid { text-anchor: middle; }
|
||||||
@@ -67,7 +74,7 @@ svg {
|
|||||||
.node:hover .box,
|
.node:hover .box,
|
||||||
.node:hover .box-accent,
|
.node:hover .box-accent,
|
||||||
.node:hover .diamond { stroke-width: 2.6; }
|
.node:hover .diamond { stroke-width: 2.6; }
|
||||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
.node:hover .t, .node:hover .t-lead { fill: var(--calc-notecolor, #20666f); }
|
||||||
|
|
||||||
svg:hover .node:not(:hover) { opacity: .55; }
|
svg:hover .node:not(:hover) { opacity: .55; }
|
||||||
|
|
||||||
@@ -78,43 +85,14 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
.node { transition: none; }
|
.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 ======================================================
|
/* ---- arrowheads ======================================================
|
||||||
* marker contents cannot inherit the referencing element's fill, so each
|
* marker contents cannot inherit the referencing element's fill, so each
|
||||||
* arrowhead is its own class and is themed alongside the line it ends.
|
* arrowhead is its own class and is themed alongside the line it ends.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.arrow { fill: #5a6879; }
|
.arrow { fill: var(--calc-muted, #5a6879); }
|
||||||
.arrow-strong { fill: #20666f; }
|
.arrow-strong { fill: var(--calc-notecolor, #20666f); }
|
||||||
.arrow-warn { fill: #8a5a08; }
|
.arrow-warn { fill: var(--calc-accent-b, #D1541F); }
|
||||||
|
|
||||||
]]></style>
|
]]></style>
|
||||||
|
|
||||||
@@ -201,6 +179,9 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
<text class="t-lead mid" data-label="consoleout" x="270" y="648">ConsoleOut — „ich gebe aus“</text>
|
<text class="t-lead mid" data-label="consoleout" x="270" y="648">ConsoleOut — „ich gebe aus“</text>
|
||||||
</g>
|
</g>
|
||||||
|
|
||||||
<!-- side note: who holds the topology -->
|
<!-- side note: who holds the topology. Two lines, and below the frame:
|
||||||
<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>
|
one line ran past the viewBox in German and French, and an svg root
|
||||||
|
clips instead of overflowing, which truncated the label. -->
|
||||||
|
<text class="t-warn" data-label="topology" x="14" y="702">Keine Fähigkeit nennt eine andere.</text>
|
||||||
|
<text class="t-warn" data-label="topology2" x="14" y="718">Die Topologie steckt nur in den zwei Vermittlern, gestartet in main().</text>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 10 KiB |
@@ -1,4 +1,4 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 700" width="560" height="700"
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 730" width="560" height="730"
|
||||||
role="img" aria-labelledby="mj-title">
|
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>
|
<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[
|
<style><![CDATA[
|
||||||
@@ -9,12 +9,19 @@
|
|||||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||||
* whole book.
|
* whole book.
|
||||||
*
|
*
|
||||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
* Colours are the extension's tokens (_extensions/notes/theme.css) with a
|
||||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
* literal fallback, which covers all three ways a figure is seen:
|
||||||
*
|
*
|
||||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
* - inlined into the page by figures/flow-player.html: the tokens resolve
|
||||||
* ignores media queries when it makes the pdf, so print always gets the light
|
* against the page, so the figure follows light, night and high contrast;
|
||||||
* theme -- which is what a printed page wants.
|
* - as a plain <img> (JavaScript off): the fallback applies, and night mode
|
||||||
|
* comes from the extension's invert filter on main img[src$=".svg"];
|
||||||
|
* - in the pdf: librsvg ignores var() and uses the fallback, so print gets
|
||||||
|
* the light palette -- which is what a printed page wants.
|
||||||
|
*
|
||||||
|
* The fallbacks are this book's own light values; the tokens carry the night
|
||||||
|
* and high-contrast ones. Nothing here keys off prefers-color-scheme: the
|
||||||
|
* page's toggle decides, never the reader's system setting.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
@@ -25,32 +32,32 @@ svg {
|
|||||||
|
|
||||||
/* ---- surfaces ------------------------------------------------------- */
|
/* ---- surfaces ------------------------------------------------------- */
|
||||||
|
|
||||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box-weak { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
.box-accent { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
.box-warn { fill: var(--calc-faint, #f8f1e0); stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.4; }
|
||||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
.box-plain { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-grid, #dae0e8); stroke-width: 1.2; }
|
||||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
.diamond { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
.ellipse { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; }
|
||||||
|
|
||||||
/* ---- lines ---------------------------------------------------------- */
|
/* ---- lines ---------------------------------------------------------- */
|
||||||
|
|
||||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
.edge { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.3; }
|
||||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
.edge-strong{ fill: none; stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
.edge-warn { fill: none; stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.6; }
|
||||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
.edge-dash { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
.rule { stroke: var(--calc-grid, #dae0e8); stroke-width: 1; }
|
||||||
|
|
||||||
/* ---- text ----------------------------------------------------------- */
|
/* ---- text ----------------------------------------------------------- */
|
||||||
|
|
||||||
.t { fill: #1b2430; font-size: 13px; }
|
.t { fill: var(--calc-ink, #1b2430); font-size: 13px; }
|
||||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
.t-sm { fill: var(--calc-ink, #1b2430); font-size: 11px; }
|
||||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
.t-lead { fill: var(--calc-ink, #1b2430); font-size: 14px; font-weight: 600; }
|
||||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
.t-mut { fill: var(--calc-muted, #5a6879); font-size: 11px; }
|
||||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
.t-key { fill: var(--calc-ink, #1b2430); font-size: 12px; text-decoration: underline; }
|
||||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
.t-accent { fill: var(--calc-notecolor, #20666f); font-size: 12px; font-weight: 600; }
|
||||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
.t-warn { fill: var(--calc-accent-b, #D1541F); font-size: 12px; font-weight: 600; }
|
||||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
.t-mono { fill: var(--calc-ink, #1b2430); font-size: 11.5px;
|
||||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||||
|
|
||||||
.mid { text-anchor: middle; }
|
.mid { text-anchor: middle; }
|
||||||
@@ -67,7 +74,7 @@ svg {
|
|||||||
.node:hover .box,
|
.node:hover .box,
|
||||||
.node:hover .box-accent,
|
.node:hover .box-accent,
|
||||||
.node:hover .diamond { stroke-width: 2.6; }
|
.node:hover .diamond { stroke-width: 2.6; }
|
||||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
.node:hover .t, .node:hover .t-lead { fill: var(--calc-notecolor, #20666f); }
|
||||||
|
|
||||||
svg:hover .node:not(:hover) { opacity: .55; }
|
svg:hover .node:not(:hover) { opacity: .55; }
|
||||||
|
|
||||||
@@ -78,43 +85,14 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
.node { transition: none; }
|
.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 ======================================================
|
/* ---- arrowheads ======================================================
|
||||||
* marker contents cannot inherit the referencing element's fill, so each
|
* marker contents cannot inherit the referencing element's fill, so each
|
||||||
* arrowhead is its own class and is themed alongside the line it ends.
|
* arrowhead is its own class and is themed alongside the line it ends.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.arrow { fill: #5a6879; }
|
.arrow { fill: var(--calc-muted, #5a6879); }
|
||||||
.arrow-strong { fill: #20666f; }
|
.arrow-strong { fill: var(--calc-notecolor, #20666f); }
|
||||||
.arrow-warn { fill: #8a5a08; }
|
.arrow-warn { fill: var(--calc-accent-b, #D1541F); }
|
||||||
|
|
||||||
]]></style>
|
]]></style>
|
||||||
|
|
||||||
@@ -201,6 +179,9 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
<text class="t-lead mid" data-label="consoleout" x="270" y="648">ConsoleOut — “I print”</text>
|
<text class="t-lead mid" data-label="consoleout" x="270" y="648">ConsoleOut — “I print”</text>
|
||||||
</g>
|
</g>
|
||||||
|
|
||||||
<!-- side note: who holds the topology -->
|
<!-- side note: who holds the topology. Two lines, and below the frame:
|
||||||
<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>
|
one line ran past the viewBox in German and French, and an svg root
|
||||||
|
clips instead of overflowing, which truncated the label. -->
|
||||||
|
<text class="t-warn" data-label="topology" x="14" y="702">No capability names another one.</text>
|
||||||
|
<text class="t-warn" data-label="topology2" x="14" y="718">The topology lives only in the two mediators, started in main().</text>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 10 KiB |
@@ -1,4 +1,4 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 700" width="560" height="700"
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 730" width="560" height="730"
|
||||||
role="img" aria-labelledby="mj-title">
|
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>
|
<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[
|
<style><![CDATA[
|
||||||
@@ -9,12 +9,19 @@
|
|||||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||||
* whole book.
|
* whole book.
|
||||||
*
|
*
|
||||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
* Colours are the extension's tokens (_extensions/notes/theme.css) with a
|
||||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
* literal fallback, which covers all three ways a figure is seen:
|
||||||
*
|
*
|
||||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
* - inlined into the page by figures/flow-player.html: the tokens resolve
|
||||||
* ignores media queries when it makes the pdf, so print always gets the light
|
* against the page, so the figure follows light, night and high contrast;
|
||||||
* theme -- which is what a printed page wants.
|
* - as a plain <img> (JavaScript off): the fallback applies, and night mode
|
||||||
|
* comes from the extension's invert filter on main img[src$=".svg"];
|
||||||
|
* - in the pdf: librsvg ignores var() and uses the fallback, so print gets
|
||||||
|
* the light palette -- which is what a printed page wants.
|
||||||
|
*
|
||||||
|
* The fallbacks are this book's own light values; the tokens carry the night
|
||||||
|
* and high-contrast ones. Nothing here keys off prefers-color-scheme: the
|
||||||
|
* page's toggle decides, never the reader's system setting.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
@@ -25,32 +32,32 @@ svg {
|
|||||||
|
|
||||||
/* ---- surfaces ------------------------------------------------------- */
|
/* ---- surfaces ------------------------------------------------------- */
|
||||||
|
|
||||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
.box-weak { fill: var(--calc-faint, #eef3f7); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
.box-accent { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
.box-warn { fill: var(--calc-faint, #f8f1e0); stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.4; }
|
||||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
.box-plain { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-grid, #dae0e8); stroke-width: 1.2; }
|
||||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
.diamond { fill: var(--calc-faint, #e5eff1); stroke: var(--calc-notecolor, #20666f); stroke-width: 1.4; }
|
||||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
.ellipse { fill: var(--calc-surface, #fbfcfd); stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; }
|
||||||
|
|
||||||
/* ---- lines ---------------------------------------------------------- */
|
/* ---- lines ---------------------------------------------------------- */
|
||||||
|
|
||||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
.edge { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.3; }
|
||||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
.edge-strong{ fill: none; stroke: var(--calc-notecolor, #20666f); stroke-width: 1.8; }
|
||||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
.edge-warn { fill: none; stroke: var(--calc-accent-b, #D1541F); stroke-width: 1.6; }
|
||||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
.edge-dash { fill: none; stroke: var(--calc-muted, #5a6879); stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
.rule { stroke: var(--calc-grid, #dae0e8); stroke-width: 1; }
|
||||||
|
|
||||||
/* ---- text ----------------------------------------------------------- */
|
/* ---- text ----------------------------------------------------------- */
|
||||||
|
|
||||||
.t { fill: #1b2430; font-size: 13px; }
|
.t { fill: var(--calc-ink, #1b2430); font-size: 13px; }
|
||||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
.t-sm { fill: var(--calc-ink, #1b2430); font-size: 11px; }
|
||||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
.t-lead { fill: var(--calc-ink, #1b2430); font-size: 14px; font-weight: 600; }
|
||||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
.t-mut { fill: var(--calc-muted, #5a6879); font-size: 11px; }
|
||||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
.t-key { fill: var(--calc-ink, #1b2430); font-size: 12px; text-decoration: underline; }
|
||||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
.t-accent { fill: var(--calc-notecolor, #20666f); font-size: 12px; font-weight: 600; }
|
||||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
.t-warn { fill: var(--calc-accent-b, #D1541F); font-size: 12px; font-weight: 600; }
|
||||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
.t-mono { fill: var(--calc-ink, #1b2430); font-size: 11.5px;
|
||||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||||
|
|
||||||
.mid { text-anchor: middle; }
|
.mid { text-anchor: middle; }
|
||||||
@@ -67,7 +74,7 @@ svg {
|
|||||||
.node:hover .box,
|
.node:hover .box,
|
||||||
.node:hover .box-accent,
|
.node:hover .box-accent,
|
||||||
.node:hover .diamond { stroke-width: 2.6; }
|
.node:hover .diamond { stroke-width: 2.6; }
|
||||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
.node:hover .t, .node:hover .t-lead { fill: var(--calc-notecolor, #20666f); }
|
||||||
|
|
||||||
svg:hover .node:not(:hover) { opacity: .55; }
|
svg:hover .node:not(:hover) { opacity: .55; }
|
||||||
|
|
||||||
@@ -78,43 +85,14 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
.node { transition: none; }
|
.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 ======================================================
|
/* ---- arrowheads ======================================================
|
||||||
* marker contents cannot inherit the referencing element's fill, so each
|
* marker contents cannot inherit the referencing element's fill, so each
|
||||||
* arrowhead is its own class and is themed alongside the line it ends.
|
* arrowhead is its own class and is themed alongside the line it ends.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.arrow { fill: #5a6879; }
|
.arrow { fill: var(--calc-muted, #5a6879); }
|
||||||
.arrow-strong { fill: #20666f; }
|
.arrow-strong { fill: var(--calc-notecolor, #20666f); }
|
||||||
.arrow-warn { fill: #8a5a08; }
|
.arrow-warn { fill: var(--calc-accent-b, #D1541F); }
|
||||||
|
|
||||||
]]></style>
|
]]></style>
|
||||||
|
|
||||||
@@ -201,6 +179,9 @@ svg:not(:has(.node)) .node { opacity: 1; }
|
|||||||
<text class="t-lead mid" data-label="consoleout" x="270" y="648">ConsoleOut — « j'affiche »</text>
|
<text class="t-lead mid" data-label="consoleout" x="270" y="648">ConsoleOut — « j'affiche »</text>
|
||||||
</g>
|
</g>
|
||||||
|
|
||||||
<!-- side note: who holds the topology -->
|
<!-- side note: who holds the topology. Two lines, and below the frame:
|
||||||
<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>
|
one line ran past the viewBox in German and French, and an svg root
|
||||||
|
clips instead of overflowing, which truncated the label. -->
|
||||||
|
<text class="t-warn" data-label="topology" x="14" y="702">Aucune capacité ne nomme une autre.</text>
|
||||||
|
<text class="t-warn" data-label="topology2" x="14" y="718">La topologie ne vit que dans les deux médiateurs, démarrés dans main().</text>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 10 KiB |
@@ -1,4 +1,4 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 700" width="620" height="700"
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 750" width="620" height="750"
|
||||||
role="img" aria-labelledby="fp-title">
|
role="img" aria-labelledby="fp-title">
|
||||||
<title id="fp-title">{{alt}}</title>
|
<title id="fp-title">{{alt}}</title>
|
||||||
<style><!--CSS--></style>
|
<style><!--CSS--></style>
|
||||||
@@ -88,9 +88,17 @@
|
|||||||
<!-- the four directories belong to one message board on one filesystem -->
|
<!-- the four directories belong to one message board on one filesystem -->
|
||||||
<path class="edge-dash" d="M436,98 H452 V580 H436"/>
|
<path class="edge-dash" d="M436,98 H452 V580 H436"/>
|
||||||
<text class="t-mono" x="460" y="330">messageBoard/</text>
|
<text class="t-mono" x="460" y="330">messageBoard/</text>
|
||||||
|
<!-- two lines: one line of this label ran past the 620-wide viewBox in
|
||||||
|
German and French, where an svg root clips rather than overflows =
|
||||||
|
a truncated label at phone width. -->
|
||||||
<text class="t-mut" data-label="board" x="460" y="348">{{board}}</text>
|
<text class="t-mut" data-label="board" x="460" y="348">{{board}}</text>
|
||||||
|
<text class="t-mut" data-label="board2" x="460" y="363">{{board2}}</text>
|
||||||
|
|
||||||
<!-- the five processes are started by hand, one terminal each -->
|
<!-- the five processes are started by hand, one terminal each -->
|
||||||
<path class="edge-dash" d="M104,24 H88 V654 H104"/>
|
<path class="edge-dash" d="M104,24 H88 V654 H104"/>
|
||||||
<text class="t-warn" data-label="topology" x="14" y="686">{{topology}}</text>
|
<!-- three lines: one ran well past the viewBox in every language, and an
|
||||||
|
svg root clips rather than overflows. -->
|
||||||
|
<text class="t-warn" data-label="topology" x="14" y="700">{{topology}}</text>
|
||||||
|
<text class="t-warn" data-label="topology2" x="14" y="716">{{topology2}}</text>
|
||||||
|
<text class="t-warn" data-label="topology3" x="14" y="732">{{topology3}}</text>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.7 KiB |
@@ -1,4 +1,4 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 700" width="560" height="700"
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 730" width="560" height="730"
|
||||||
role="img" aria-labelledby="mj-title">
|
role="img" aria-labelledby="mj-title">
|
||||||
<title id="mj-title">{{alt}}</title>
|
<title id="mj-title">{{alt}}</title>
|
||||||
<style><!--CSS--></style>
|
<style><!--CSS--></style>
|
||||||
@@ -86,6 +86,9 @@
|
|||||||
<text class="t-lead mid" data-label="consoleout" x="270" y="648">{{consoleout}}</text>
|
<text class="t-lead mid" data-label="consoleout" x="270" y="648">{{consoleout}}</text>
|
||||||
</g>
|
</g>
|
||||||
|
|
||||||
<!-- side note: who holds the topology -->
|
<!-- side note: who holds the topology. Two lines, and below the frame:
|
||||||
<text class="t-warn" data-label="topology" x="22" y="672">{{topology}}</text>
|
one line ran past the viewBox in German and French, and an svg root
|
||||||
|
clips instead of overflowing, which truncated the label. -->
|
||||||
|
<text class="t-warn" data-label="topology" x="14" y="702">{{topology}}</text>
|
||||||
|
<text class="t-warn" data-label="topology2" x="14" y="718">{{topology2}}</text>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 5.0 KiB |
@@ -4,7 +4,7 @@
|
|||||||
# ::: {.fr} / ::: {.de} divs, headings and captions in
|
# ::: {.fr} / ::: {.de} divs, headings and captions in
|
||||||
# [..]{.en}[..]{.fr}[..]{.de}.
|
# [..]{.en}[..]{.fr}[..]{.de}.
|
||||||
#
|
#
|
||||||
# English is the verified source: the tutorial being summarised
|
# English is the verified source: the material these notes are built from
|
||||||
# (SIN.04028-From-Calling-to-Eventing/README.md) is written in English.
|
# (SIN.04028-From-Calling-to-Eventing/README.md) is written in English.
|
||||||
i18n:
|
i18n:
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ MULTILINGUAL (see _extensions/notes/i18n.lua):
|
|||||||
picture, just still.
|
picture, just still.
|
||||||
- fixed section ids (#sec-...) so anchors are identical in all three books.
|
- fixed section ids (#sec-...) so anchors are identical in all three books.
|
||||||
|
|
||||||
English is the verified source: the tutorial being summarised is written in
|
English is the verified source: the material these notes are built from is
|
||||||
English. French and German are translations of it.
|
written in English. French and German are translations of it.
|
||||||
|
|
||||||
Code identifiers, mailbox and topic names, file names, commands and protocol
|
Code identifiers, mailbox and topic names, file names, commands and protocol
|
||||||
terms are never translated (consoleIn.outbox, rot13/inbox, WatchService,
|
terms are never translated (consoleIn.outbox, rot13/inbox, WatchService,
|
||||||
@@ -22,7 +22,7 @@ Mediator.java, .msg, put/take, Intent/Status/Event).
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
::: {.en}
|
::: {.en}
|
||||||
These 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).
|
These notes follow one small program through a long series of rebuilds, from direct method calls to an event-driven architecture over MQTT. Every rebuild leaves the program doing exactly what it did before, and changes who knows about whom.
|
||||||
|
|
||||||
The program under construction never changes: you type a line, it comes back rotated by 13 letters.
|
The program under construction never changes: you type a line, it comes back rotated by 13 letters.
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ The program under construction never changes: you type a line, it comes back rot
|
|||||||
keyboard → ROT13 → console
|
keyboard → ROT13 → console
|
||||||
```
|
```
|
||||||
|
|
||||||
What changes is everything around it. The tutorial rebuilds the same system again and again while asking three questions, in this order:
|
What changes is everything around it. The same system is rebuilt again and again, and each rebuild asks three questions, in this order:
|
||||||
|
|
||||||
> **Who knows whom?**
|
> **Who knows whom?**
|
||||||
>
|
>
|
||||||
@@ -39,10 +39,12 @@ What changes is everything around it. The tutorial rebuilds the same system agai
|
|||||||
> **Who decides how the system is wired together?**
|
> **Who decides how the system is wired together?**
|
||||||
|
|
||||||
One 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.
|
One 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.
|
||||||
|
|
||||||
|
*Based on material by Reto Konig, University of Fribourg.*
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.fr}
|
::: {.fr}
|
||||||
Ces 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).
|
Ces notes suivent un petit programme à travers une longue série de reconstructions, de l'appel de méthode direct à une architecture événementielle sur MQTT. Chaque reconstruction laisse le programme faire exactement ce qu'il faisait avant, et change qui connaît qui.
|
||||||
|
|
||||||
Le programme construit ne change jamais : vous tapez une ligne, elle revient décalée de 13 lettres.
|
Le programme construit ne change jamais : vous tapez une ligne, elle revient décalée de 13 lettres.
|
||||||
|
|
||||||
@@ -50,7 +52,7 @@ Le programme construit ne change jamais : vous tapez une ligne, elle revient dé
|
|||||||
keyboard → ROT13 → console
|
keyboard → ROT13 → console
|
||||||
```
|
```
|
||||||
|
|
||||||
Ce 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 :
|
Ce qui change, c'est tout ce qui l'entoure. Le même système est reconstruit encore et encore, et chaque reconstruction pose trois questions, dans cet ordre :
|
||||||
|
|
||||||
> **Qui connaît qui ?**
|
> **Qui connaît qui ?**
|
||||||
>
|
>
|
||||||
@@ -59,10 +61,12 @@ Ce qui change, c'est tout ce qui l'entoure. Le tutoriel reconstruit le même sys
|
|||||||
> **Qui décide comment le système est câblé ?**
|
> **Qui décide comment le système est câblé ?**
|
||||||
|
|
||||||
Un 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.
|
Un 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.
|
||||||
|
|
||||||
|
*D'après le matériel de Reto Konig, Université de Fribourg.*
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: {.de}
|
::: {.de}
|
||||||
Diese 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).
|
Diese Notizen verfolgen ein kleines Programm durch eine lange Reihe von Neubauten, vom direkten Methodenaufruf bis zu einer ereignisgetriebenen Architektur über MQTT. Jeder Neubau lässt das Programm genau das tun, was es vorher tat, und ändert, wer von wem weiss.
|
||||||
|
|
||||||
Das gebaute Programm ändert sich nie: Sie tippen eine Zeile, sie kommt um 13 Buchstaben verschoben zurück.
|
Das gebaute Programm ändert sich nie: Sie tippen eine Zeile, sie kommt um 13 Buchstaben verschoben zurück.
|
||||||
|
|
||||||
@@ -70,7 +74,7 @@ Das gebaute Programm ändert sich nie: Sie tippen eine Zeile, sie kommt um 13 Bu
|
|||||||
keyboard → ROT13 → console
|
keyboard → ROT13 → console
|
||||||
```
|
```
|
||||||
|
|
||||||
Was sich ändert, ist alles ringsherum. Das Tutorial baut dasselbe System immer wieder neu und stellt dabei drei Fragen, in dieser Reihenfolge:
|
Was sich ändert, ist alles ringsherum. Dasselbe System wird immer wieder neu gebaut, und jeder Neubau stellt drei Fragen, in dieser Reihenfolge:
|
||||||
|
|
||||||
> **Wer kennt wen?**
|
> **Wer kennt wen?**
|
||||||
>
|
>
|
||||||
@@ -79,6 +83,8 @@ Was sich ändert, ist alles ringsherum. Das Tutorial baut dasselbe System immer
|
|||||||
> **Wer entscheidet, wie das System verdrahtet ist?**
|
> **Wer entscheidet, wie das System verdrahtet ist?**
|
||||||
|
|
||||||
Jedes 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.
|
Jedes 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.
|
||||||
|
|
||||||
|
*Nach Material von Reto Konig, Universität Freiburg.*
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## [How to read the diagrams]{.en}[Comment lire les figures]{.fr}[Wie die Abbildungen zu lesen sind]{.de} {#sec-diagrams}
|
## [How to read the diagrams]{.en}[Comment lire les figures]{.fr}[Wie die Abbildungen zu lesen sind]{.de} {#sec-diagrams}
|
||||||
@@ -100,38 +106,3 @@ Jede Abbildung existiert einmal als Zeichnung und dreimal als Sprache. In der We
|
|||||||
|
|
||||||
Im PDF und in einem Browser ohne JavaScript ist dasselbe Bild da — nur unbewegt. Nichts in diesen Notizen hängt von der Animation ab.
|
Im PDF und in einem Browser ohne JavaScript ist dasselbe Bild da — nur unbewegt. Nichts in diesen Notizen hängt von der Animation ab.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## [Building this book]{.en}[Construire ce livre]{.fr}[Dieses Buch bauen]{.de} {#sec-build}
|
|
||||||
|
|
||||||
::: {.en}
|
|
||||||
The three books come from one source:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./render-all.sh # figures, then html + pdf for en, fr, de
|
|
||||||
./render-all.sh --serve # …and serve _book/ on http://localhost:8000
|
|
||||||
```
|
|
||||||
|
|
||||||
`_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.
|
|
||||||
:::
|
|
||||||
|
|
||||||
::: {.fr}
|
|
||||||
Les trois livres proviennent d'une source unique :
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./render-all.sh # figures, puis html + pdf pour en, fr, de
|
|
||||||
./render-all.sh --serve # …puis sert _book/ sur http://localhost:8000
|
|
||||||
```
|
|
||||||
|
|
||||||
`_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.
|
|
||||||
:::
|
|
||||||
|
|
||||||
::: {.de}
|
|
||||||
Die drei Bücher entstehen aus einer einzigen Quelle:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./render-all.sh # Abbildungen, dann html + pdf für en, fr, de
|
|
||||||
./render-all.sh --serve # …und _book/ auf http://localhost:8000 ausliefern
|
|
||||||
```
|
|
||||||
|
|
||||||
`_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.
|
|
||||||
:::
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
% =====================================================================
|
% =====================================================================
|
||||||
% preamble.tex — PDF-side setup for the "From Calling to Eventing" notes
|
% preamble.tex — PDF-side setup for the "Process Control" notes
|
||||||
% Engine: LuaLaTeX (set in _quarto.yml). Quarto loads fontspec and
|
% Engine: LuaLaTeX (set in _quarto.yml). Quarto loads fontspec and
|
||||||
% unicode-math for us; everything below layers on top of that.
|
% unicode-math for us; everything below layers on top of that.
|
||||||
% =====================================================================
|
% =====================================================================
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
# Individual Project description
|
||||||
|
|
||||||
|
## Idea
|
||||||
|
|
||||||
|
Get statistics on my shared web notes.
|
||||||
|
|
||||||
|
Each courses live under an URL and serves 3 languages. Accessing each courses trigger a request on my home server. So the idea is to track the access on each courses, usage of the different languages, use of the pdf version (track downloads).
|
||||||
|
|
||||||
|
```txt
|
||||||
|
+--------[Process]--------+-----------[Event]-----------+
|
||||||
|
+-------------------------+-----------------------------+
|
||||||
|
| URL access tracker | Get trigger each time |
|
||||||
|
| | the URL is accessed |
|
||||||
|
| | and create a new .msg |
|
||||||
|
| | with TIMESTAMP and lang |
|
||||||
|
+-------------------------+-----------------------------+
|
||||||
|
| Download tracking | Get trigger each time |
|
||||||
|
| | the file is sent to |
|
||||||
|
| | the user and create a |
|
||||||
|
| | new .msg |
|
||||||
|
+-------------------------+-----------------------------+
|
||||||
|
| Statistics | - Fetches the new files |
|
||||||
|
| | of URLtrack and DLtrack |
|
||||||
|
| | - Publish new .json for |
|
||||||
|
| | the badges |
|
||||||
|
| | - If more than X new |
|
||||||
|
| | files in S seconds, |
|
||||||
|
| | -> trigger Alert |
|
||||||
|
+-------------------------+-----------------------------+
|
||||||
|
| Badges | - Receive the new data |
|
||||||
|
| | - https://shields.io get |
|
||||||
|
| | them and regenerate |
|
||||||
|
| | the new badge |
|
||||||
|
+-------------------------+-----------------------------+
|
||||||
|
| Notification System | - Look if new Alert is |
|
||||||
|
| | created, if yes send |
|
||||||
|
| | email. |
|
||||||
|
+-------------------------+-----------------------------+
|
||||||
|
|
||||||
|
|
||||||
|
[shields.io]--->[.img]
|
||||||
|
§
|
||||||
|
[URL tracker]-~-+ §
|
||||||
|
| §
|
||||||
|
{logs/.msg}--->[Stats]--->{.msg}--->[Convertor]--->{bagdes/.json}---+
|
||||||
|
| |
|
||||||
|
[DL tracker]--~-+ +--------->{.msg}-------->[Alarms (send mail via TCP)]
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
@@ -11,25 +11,11 @@ $font-family-monospace: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospa
|
|||||||
$font-size-root: 17px;
|
$font-size-root: 17px;
|
||||||
$line-height-base: 1.66;
|
$line-height-base: 1.66;
|
||||||
|
|
||||||
// Palette — cool technical, teal structure with an ochre warning accent.
|
// No palette here. The canvas, body text and link colours come from cosmo in
|
||||||
$body-bg: #fbfcfd;
|
// light mode and darkly in night mode, and everything this sheet draws itself
|
||||||
$body-color: #1b2430;
|
// uses a --calc-… token from the extension's theme.css, which carries all
|
||||||
$link-color: #20666f;
|
// three modes (light, night, high contrast). The book's own accent is
|
||||||
|
// `notecolor:` in _quarto.yml, reachable as var(--calc-notecolor).
|
||||||
$primary: #20666f;
|
|
||||||
$secondary: #5a6879;
|
|
||||||
|
|
||||||
$code-bg: #eef3f7;
|
|
||||||
$code-color: #1b2430;
|
|
||||||
$code-block-bg: #eef3f7;
|
|
||||||
$border-color: #dae0e8;
|
|
||||||
|
|
||||||
$toc-color: #5a6879;
|
|
||||||
$toc-active-border:#20666f;
|
|
||||||
|
|
||||||
// Callout colours — Exam trap (amber) and Note (teal).
|
|
||||||
$callout-color-warning: #8a5a08;
|
|
||||||
$callout-color-note: #20666f;
|
|
||||||
|
|
||||||
/*-- scss:rules --*/
|
/*-- scss:rules --*/
|
||||||
|
|
||||||
@@ -49,11 +35,11 @@ h1, h2, h3 { letter-spacing: -0.015em; }
|
|||||||
h1 { font-weight: 600; }
|
h1 { font-weight: 600; }
|
||||||
h2 {
|
h2 {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
border-bottom: 1px solid $border-color;
|
border-bottom: 1px solid var(--calc-faint, #e7e9ec);
|
||||||
padding-bottom: .3rem;
|
padding-bottom: .3rem;
|
||||||
margin-top: 2.6rem;
|
margin-top: 2.6rem;
|
||||||
}
|
}
|
||||||
h3 { font-weight: 600; color: $primary; margin-top: 1.9rem; }
|
h3 { font-weight: 600; color: var(--calc-notecolor, #20666f); margin-top: 1.9rem; }
|
||||||
|
|
||||||
p, li { max-width: 78ch; }
|
p, li { max-width: 78ch; }
|
||||||
|
|
||||||
@@ -68,15 +54,15 @@ table {
|
|||||||
margin: 1.3rem 0;
|
margin: 1.3rem 0;
|
||||||
}
|
}
|
||||||
thead th {
|
thead th {
|
||||||
color: $primary;
|
color: var(--calc-notecolor, #20666f);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
border-bottom: 2px solid $border-color !important;
|
border-bottom: 2px solid var(--calc-line, #444444) !important;
|
||||||
padding: .55rem .8rem .55rem 0;
|
padding: .55rem .8rem .55rem 0;
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
tbody td {
|
tbody td {
|
||||||
border-bottom: 1px solid $border-color;
|
border-bottom: 1px solid var(--calc-faint, #e7e9ec);
|
||||||
padding: .5rem .8rem .5rem 0;
|
padding: .5rem .8rem .5rem 0;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
@@ -86,14 +72,20 @@ th:last-child, td:last-child { padding-right: 0; }
|
|||||||
// ---- code -----------------------------------------------------------
|
// ---- code -----------------------------------------------------------
|
||||||
pre, code { font-family: $font-family-monospace; }
|
pre, code { font-family: $font-family-monospace; }
|
||||||
code { font-size: .86em; }
|
code { font-size: .86em; }
|
||||||
|
|
||||||
|
// The inline-code pill (Bootstrap's gray-100, which darkly leaves alone, so
|
||||||
|
// night mode read 1.05:1) is tinted by the extension's theme.css since 2.8.9,
|
||||||
|
// which keeps each theme's own code colour. Nothing to do here.
|
||||||
div.sourceCode, pre {
|
div.sourceCode, pre {
|
||||||
border: 1px solid $border-color;
|
border: 1px solid var(--calc-faint, #e7e9ec);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
pre code { font-size: .83rem; line-height: 1.5; }
|
pre code { font-size: .83rem; line-height: 1.5; }
|
||||||
|
|
||||||
// ---- callouts -------------------------------------------------------
|
// ---- callouts -------------------------------------------------------
|
||||||
// Flat left-bar boxes rather than Quarto's default cards.
|
// Flat left-bar boxes rather than Quarto's default cards. The tint is the
|
||||||
|
// page's own surface, so night mode and high contrast keep working; the bar
|
||||||
|
// carries the colour.
|
||||||
.callout {
|
.callout {
|
||||||
border-radius: 0 3px 3px 0;
|
border-radius: 0 3px 3px 0;
|
||||||
border-left-width: 3px !important;
|
border-left-width: 3px !important;
|
||||||
@@ -109,24 +101,29 @@ pre code { font-size: .83rem; line-height: 1.5; }
|
|||||||
.callout-body p { max-width: 74ch; }
|
.callout-body p { max-width: 74ch; }
|
||||||
|
|
||||||
.callout-warning {
|
.callout-warning {
|
||||||
background-color: #f8f1e0;
|
background-color: transparent;
|
||||||
border-left-color: $callout-color-warning !important;
|
border-left-color: var(--calc-accent-b, #D1541F) !important;
|
||||||
.callout-title, .callout-icon::before { color: $callout-color-warning; }
|
.callout-title, .callout-icon::before { color: var(--calc-accent-b, #D1541F); }
|
||||||
}
|
}
|
||||||
.callout-note {
|
.callout-note {
|
||||||
background-color: #e5eff1;
|
background-color: transparent;
|
||||||
border-left-color: $callout-color-note !important;
|
border-left-color: var(--calc-notecolor, #20666f) !important;
|
||||||
.callout-title, .callout-icon::before { color: $callout-color-note; }
|
.callout-title, .callout-icon::before { color: var(--calc-notecolor, #20666f); }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---- blockquotes ----------------------------------------------------
|
// ---- blockquotes ----------------------------------------------------
|
||||||
|
// The colour of quoted text is the extension's since 2.8.9 (--calc-muted, the
|
||||||
|
// quieter reading); this book only draws the accent bar.
|
||||||
blockquote {
|
blockquote {
|
||||||
border-left: 3px solid $primary;
|
border-left: 3px solid var(--calc-notecolor, #20666f);
|
||||||
padding-left: 1.2rem;
|
padding-left: 1.2rem;
|
||||||
color: $body-color;
|
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Breadcrumbs: the grey current crumb and separators are handled by the
|
||||||
|
// extension's theme.css since 2.8.5 (it also covers the mobile secondary-nav
|
||||||
|
// separators), so this book carries no rule of its own for them.
|
||||||
|
|
||||||
// ---- sidebar --------------------------------------------------------
|
// ---- sidebar --------------------------------------------------------
|
||||||
.sidebar-item-text { font-size: .86rem; }
|
.sidebar-item-text { font-size: .86rem; }
|
||||||
.sidebar nav[role="doc-toc"] ul > li > a.active { font-weight: 600; }
|
.sidebar nav[role="doc-toc"] ul > li > a.active { font-weight: 600; }
|
||||||
|
|||||||