docs: Beispiel-Plan als ladbare Textdatei + ?sourceUrl=-Abschnitt im README

Für ?sourceUrl= (D23) fehlte bislang eine ladbare Beispieldatei — im Repo lagen
nur Markdown-Dokumente (rendern als Chaos) und VERSION.

- docs/example-plan.txt: englischer Beispielplan, der die Notation vorführt —
  alle acht Status (inkl. [!] mit Warndreieck und einer verworfenen
  Alternative), beide Gates, Größen, Tags, URLs, Kommentare sowie zwei
  Geister-Knoten für die Untergliederungspflicht ab M.
- README.md / README.de.md: neuer Abschnitt „Loading a diagram from a URL" /
  „Diagramm aus einer URL laden" mit klickbarem Live-Beispiel, dem Hinweis auf
  URL-als-Dokumentname und der CORS-Einschränkung.

Verifiziert: Die Datei parst ohne Warnungen (18 Knoten, 7 sichtbare Status,
1 Warndreieck, 2 Geister-Knoten).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
mhoennig
2026-07-25 12:40:11 +02:00
co-authored by Claude Opus 4.8
parent 1557a7ab0d
commit ca98f0a055
3 changed files with 70 additions and 0 deletions
+25
View File
@@ -38,6 +38,31 @@ Den [gehosteten Editor](https://werkbaum.javagil.de) öffnen — links
Text bearbeiten, rechts entsteht das Diagramm live. Toggles: transponierte Text bearbeiten, rechts entsteht das Diagramm live. Toggles: transponierte
(schmale) Darstellung, verworfene Elemente einblenden. (schmale) Darstellung, verworfene Elemente einblenden.
### Diagramm aus einer URL laden
Der Editor kann seinen Notationstext über den Query-Parameter `sourceUrl` aus
einer externen Textdatei beziehen — praktisch zum Teilen eines Plans oder wenn
die Quelle in Git oder einem Wiki gepflegt wird:
**▶ [Live-Beispiel](https://werkbaum.javagil.de/?sourceUrl=https://raw.githubusercontent.com/mhoennig/werkbaum/main/docs/example-plan.txt)**
— lädt [`docs/example-plan.txt`](docs/example-plan.txt):
```
https://werkbaum.javagil.de/?sourceUrl=https://raw.githubusercontent.com/mhoennig/werkbaum/main/docs/example-plan.txt
```
Der geladene Text wird als **eigenes Dokument** geführt, dessen **Name die URL**
ist — eigene Dokumente bleiben unberührt, und derselbe Link aktualisiert dieses
eine Dokument, statt Kopien anzuhäufen. Die URL ist die Quelle der Wahrheit: Sie
wird bei jedem Laden neu geholt, lokale Änderungen daran überleben ein Neuladen
also nicht.
**Einschränkung — CORS:** Der Browser lädt fremde Hosts nur, wenn sie
`Access-Control-Allow-Origin` senden. `raw.githubusercontent.com` und
GitLab-Raw-Links tun das; ein beliebiger Webserver oft nicht. Scheitert das
Laden, bleibt der bisherige Stand stehen und eine Warnung nennt die Ursache.
Zugelassen sind nur `http`/`https`.
### Lokal ausführen ### Lokal ausführen
Die Editor-Quelle liegt jetzt als ES-Module unter `frontend/src/`, gebündelt mit Die Editor-Quelle liegt jetzt als ES-Module unter `frontend/src/`, gebündelt mit
+23
View File
@@ -37,6 +37,29 @@ Open the [hosted editor](https://werkbaum.javagil.de) — edit text on
the left, the diagram is built live on the right. Toggles: transposed (narrow) the left, the diagram is built live on the right. Toggles: transposed (narrow)
layout, show discarded elements. layout, show discarded elements.
### Loading a diagram from a URL
The editor can pull its notation text from an external text file via the
`sourceUrl` query parameter — handy for sharing a plan or keeping the source in
Git or a wiki:
**▶ [Live example](https://werkbaum.javagil.de/?sourceUrl=https://raw.githubusercontent.com/mhoennig/werkbaum/main/docs/example-plan.txt)**
— loads [`docs/example-plan.txt`](docs/example-plan.txt):
```
https://werkbaum.javagil.de/?sourceUrl=https://raw.githubusercontent.com/mhoennig/werkbaum/main/docs/example-plan.txt
```
The loaded text becomes its own document whose **name is the URL**, so your own
documents stay untouched; the same link updates that one document instead of
piling up copies. The URL is the source of truth — it is re-fetched on every
load, so local edits to it do not survive a reload.
**Caveat — CORS:** the browser only fetches a foreign host if it sends
`Access-Control-Allow-Origin`. `raw.githubusercontent.com` and GitLab raw links
do; an arbitrary web server often does not. If loading fails the previous
content stays and a warning explains why. Only `http`/`https` are allowed.
### Running it locally ### Running it locally
The editor source now lives as ES modules under `frontend/src/`, bundled by The editor source now lives as ES modules under `frontend/src/`, bundled by
+22
View File
@@ -0,0 +1,22 @@
%% Werkbaum example plan — meant to be loaded via ?sourceUrl=
%% Full notation reference: docs/SPEC.md
[~] Online shop relaunch (XL) https://example.com/shop
- [x] Discovery (M)
- [x] User interviews (S) @maria
- [x] Competitor scan (XS)
- [~] Checkout (XL)
- [/] Shopping cart (M) @tom
- [x] Add and remove items (S)
- [/] Discount codes (S)
- [!] Payment provider (L) @maria @tom %% effort still unclear
| [ ] Stripe (M)
- [ ] Sandbox account (XS)
- [ ] Webhook handling (S)
| [?] PayPal (M)
| [-] Build our own PSP (XXL) %% far too expensive
- [ ] Order confirmation mail (S)
- [?] Hosting (M)
| Managed cloud (S) https://hostsharing.net
| On-premise (L)
- [^] Landing page (S) @lena