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:
co-authored by
Claude Opus 4.8
parent
1557a7ab0d
commit
ca98f0a055
@@ -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)
|
||||
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
|
||||
|
||||
The editor source now lives as ES modules under `frontend/src/`, bundled by
|
||||
|
||||
Reference in New Issue
Block a user