-
Notifications
You must be signed in to change notification settings - Fork 20
Neue Architektur #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
RamonDevPrivate
merged 54 commits into
development
from
feature/protocol_based_communication
Sep 22, 2025
Merged
Neue Architektur #87
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
4682e44
initial draft
RamonDevPrivate f21997f
parsing an processing
RamonDevPrivate f43957c
enforce utf8 encoding for console output in subprocess and clear temp…
RamonDevPrivate 49ad291
added demo
RamonDevPrivate 13f42ce
added codeblock command
RamonDevPrivate f0f1cd4
removed unused views and skills
RamonDevPrivate 07fc184
Removed Clerk Interface
RamonDevPrivate 99bb367
removed canvas turtle deps
RamonDevPrivate 2d2657d
fixed idgen in Interaction Skill
RamonDevPrivate 635299f
adjusted folder structur for new architecture; added dot target and m…
RamonDevPrivate c8771ef
added turtle
RamonDevPrivate a491c28
Merge branch 'development' into feature/protocol_based_communication
RamonDevPrivate 47c900b
remove unused import for IdGen in Turtle.java
RamonDevPrivate c784ccc
moved logging to skills
RamonDevPrivate b05bea9
added some pipe examples
RamonDevPrivate f10d033
Merge branch 'development' into feature/protocol_based_communication
RamonDevPrivate e048d1a
Interaction Elements
RamonDevPrivate 8badca5
blocking interactions
RamonDevPrivate bb657cb
register and test
RamonDevPrivate ecb2ec2
small fixes and adjustments
RamonDevPrivate eee81dc
updated syntax information
RamonDevPrivate 9e5bd94
trim -> strip
RamonDevPrivate 51314fe
allow register to skip id, to open calls to cli tools
RamonDevPrivate 4f99250
improved handeling of multiple sources, changed args
RamonDevPrivate 7f806ca
added demos for multi source support
RamonDevPrivate 4b5ab66
fixed regex
RamonDevPrivate 19ec728
use sourceId in targets
RamonDevPrivate 3001604
subview system and css events
RamonDevPrivate 7726e3a
fixed read
RamonDevPrivate 1508b5a
limit watch dirs to source dirs in sourceOnly mode
RamonDevPrivate 7c50fe7
refactor: rename Read to Scan in Processor, Server, and InstructionPa…
RamonDevPrivate 27409b6
fix: improve command parsing to handle contentless single-line commands
RamonDevPrivate e889f54
changed text command behavior
RamonDevPrivate 3043d02
fix: update instruction patterns to use square brackets for parameter…
RamonDevPrivate b30e43b
server input
RamonDevPrivate 9104abb
server input, error overlay and Text clear per source
RamonDevPrivate 62b89f1
reverted text pipe behavior
RamonDevPrivate a82623c
multiline tests
RamonDevPrivate a0f0887
documentation for test, codeblock and text
RamonDevPrivate 6418541
better cutout and added more doku examples
RamonDevPrivate ab7ebba
update README.md args section
RamonDevPrivate a1cd309
root dir as watch root and more examples
RamonDevPrivate 9c0bdef
Server as Sink
RamonDevPrivate 46f70ac
Scans
RamonDevPrivate 38d83ee
Merge branch 'development' into feature/protocol_based_communication
RamonDevPrivate 8c37453
Merge branch 'development' into feature/protocol_based_communication
RamonDevPrivate 8d33b79
errors to error channel
RamonDevPrivate 30ae007
fixed gitignore
RamonDevPrivate 57685b7
Removed Commands from Input Shell
RamonDevPrivate 5e10a4e
fixed register demo
RamonDevPrivate 51de72e
Simplified Processor
RamonDevPrivate 35142ac
adjusted naming
RamonDevPrivate 22f8978
Examples and Readme
RamonDevPrivate abeaa12
fixed gitignore
RamonDevPrivate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,4 +6,6 @@ target/ | |
| build | ||
| test.java | ||
| Test.java | ||
| .vscode | ||
| !**/services/Test.java | ||
| .vscode | ||
| sources.json | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,166 +1,57 @@ | ||
| import lvp.Clerk; | ||
| import lvp.skills.Text; | ||
| import lvp.skills.Interaction; | ||
| import lvp.views.Dot; | ||
| import lvp.views.Turtle; | ||
|
|
||
|
|
||
| List<String> obst = List.of("Apfel", "Birne", "Banane"); | ||
| void main() { | ||
| Clerk.clear(); | ||
| // Markdown 1 | ||
| Clerk.markdown(Text.fillOut(""" | ||
| # Interaktive LVP Demo | ||
|
|
||
| ## Markdown | ||
| Die Markdown-View erlaubt es, Markdown-Text direkt im Browser darzustellen. Der folgende Code zeigt ein einfaches Beispiel, wie Text im Markdown-Format | ||
| an den Browser gesendet und dort automatisch als HTML gerendert wird: | ||
| ```java | ||
| ${0} | ||
| ``` | ||
| Der Aufruf `Clerk.markdown(text)` elaubt den einfachen Zugriff auf die Markdown-View. | ||
| In diesem Beispiel werden zusätzlich zwei unterstützende Skills verwendet: | ||
| - `Text.fillOut(...)`: Zum Befüllen von String-Vorlagen mit dynamischen Inhalten, indem Platzhalter (z.B. ${2}) durch die Auswertung von übergebenen Ausdrücken ersetzt werden. | ||
| - `Text.codeBlock(...)`: Zum Einbinden von Codeabschnitten als interaktive Blöcke im Markdown-Text. | ||
|
|
||
| ## Turtle | ||
| Die Turtle-View ermöglicht das Zeichnen und Anzeigen von SVG-Grafiken im Browser. Diese können Schritt für Schritt aufgebaut werden: | ||
| ```java | ||
| ${1} | ||
| ``` | ||
| """, Text.codeBlock("./demo.java", "// Markdown 1"), Text.codeBlock("./demo.java", "// Turtle 1"), "${0}")); | ||
| // Markdown 1 | ||
|
|
||
| // Label Turtle 1 | ||
| // Turtle 1 | ||
| var turtle = new Turtle(0, 200, 0, 25, 50, 0, 0); | ||
| turtle.forward(25).right(60).backward(25).right(60).forward(25).write(); | ||
| // Turtle 1 | ||
| // Label Turtle 1 | ||
|
|
||
| Clerk.markdown(Text.fillOut(""" | ||
|
|
||
| ## Interaktionen | ||
| Die Live-View ist nicht nur ein Anzeigewerkzeug, sondern dient auch als interaktiver Editor. Änderungen an eingebetteten Code-Blöcken wirken sich direkt auf die zugrunde liegende | ||
| Datei aus. Dadurch kann der dokumentierte Code live ausprobiert und bearbeitet werden. | ||
| Ein interaktiver Code-Block wird mithilfe von `Text.codeBlock(...)` definiert. Der entsprechende Code im Quelltext muss durch Kommentar-Labels (z.B. `// Turtle 1`) markiert werden: | ||
| ```java | ||
| ${0} | ||
| ``` | ||
| Dieser markierte Block kann anschließend über `Text.codeBlock("./demo.java", "// Turtle 1")` eingebunden werden. Wird dieser Block in einen Markdown-Abschnitt eingefügt, erscheint | ||
| er in der Live-View als editierbarer Code-Bereich. | ||
|
|
||
| Zusätzlich können JavaScript-Funktionen eingebunden werden, die gezielt Teile des Quelltexts verändern. Dafür wird `Interaction.eventFunction(...)` verwendet. Dieser Skill liefert | ||
| eine Funktion, die anhand des Dateipfads, eines Labels und des neuen Codes eine markierte Zeile ersetzt. | ||
|
|
||
| Um solche Funktionen interaktiv nutzbar zu machen, kann `Interaction.button(...)` verwendet werden. Damit lässt sich ein Button erstellen, der bei Klick eine bestimmte Stelle im Code anpasst: | ||
| ```java | ||
| ${1} | ||
| ``` | ||
|
|
||
| ### Color Change | ||
| Im folgenden Beispiel wird eine Turtle-Grafik dargestellt: | ||
| ```java | ||
| ${2} | ||
| ``` | ||
|
|
||
| """, Text.codeBlock("./demo.java", "// Label Turtle 1"), Text.codeBlock("./demo.java", "// Buttons"), Text.codeBlock("./demo.java", "// Turtle triangle"))); | ||
|
|
||
| // Turtle 2 | ||
| var turtle2 = new Turtle(0, 200, 0, 50, 100, 12, 0); | ||
| drawing(turtle2, 24); | ||
| turtle2.write(); | ||
| // Turtle 2 | ||
|
|
||
| Clerk.markdown(""" | ||
| Darunter befinden sich drei Buttons, die jeweils die Farbe der Turtle ändern. Die zu ersetzende Stelle im Quellcode ist durch das Label `// turtle color` markiert. Beim Klick auf einen Button wird | ||
| dieser Teil des Codes automatisch angepasst. | ||
| println(""" | ||
| Clear | ||
| Markdown: ## Einkaufsliste | ||
| Markdown: | ||
| """); | ||
| println(buildObstListe()); | ||
| println("~~~"); | ||
| println(""" | ||
| Text[template]: | ||
| ## Beispiel | ||
| Irgendein ${0} anzeigen. | ||
| ~~~ | ||
| | Markdown | ||
|
|
||
| Text: Text | ||
| | Text[template] | Markdown | ||
|
|
||
| Text[t2]: | ||
| ## Syntax Überschrift | ||
| Das ist die Syntax | ||
| ${0} | ||
| Danach | ||
| ~~~ | ||
|
|
||
| // Buttons | ||
| Clerk.write(Interaction.button("Red", 200, 50, Interaction.eventFunction("./demo.java", "// turtle color", "turtle.color(255, i * 256 / 37, i * 256 / 37, 1);"))); | ||
| Clerk.write(Interaction.button("Green", 200, 50, Interaction.eventFunction("./demo.java", "// turtle color", "turtle.color(i * 256 / 37, 255, i * 256 / 37, 1);"))); | ||
| Clerk.write(Interaction.button("Blue", 200, 50, Interaction.eventFunction("./demo.java", "// turtle color", "turtle.color(i * 256 / 37, i * 256 / 37, 255, 1);"))); | ||
| // Buttons | ||
| Cutout: ./syntax.md | ||
| | Text[t2] | Markdown | ||
|
|
||
| Clerk.markdown(Text.fillOut(""" | ||
| ### Turtle mit Timeline | ||
| Die Turtle-View unterstützt außerdem eine Timeline, über die sich die Zeichenreihenfolge der Grafik Schritt für Schritt nachvollziehen lässt: | ||
| Text[t3]: | ||
| ```java | ||
| ${0} | ||
| ``` | ||
| """, Text.codeBlock("./demo.java", "// Turtle 3"))); | ||
| ~~~ | ||
|
|
||
| // Turtle 3 | ||
| var turtle3 = new Turtle(0, 200, 0, 50, 100, 12, 0); | ||
| drawing(turtle3, 24); | ||
| turtle3.write().timelineSlider(); | ||
| // Turtle 3 | ||
| Codeblock:./intro.java;// example | ||
| | Text[t3] | Markdown | ||
|
|
||
| Clerk.markdown(Text.fillOut(""" | ||
| ### Input | ||
| Initialisierung von Variablen über ein Eingabefeld: | ||
| ```java | ||
| ${0} | ||
| ``` | ||
| Der Skill `Interaction.input(...)` ermöglicht es, Eingabefelder zu erstellen, die genutzt werden können, um Werte in den Quelltext einzufügen. | ||
| Dazu wird Pfad und Label angegeben, um die Zeile zu makieren, in der der Wert eingefügt werden soll. Gleichzeitig wird das Label als Beschriftung des Eingabefelds verwendet. | ||
| Ein Template wird angegeben, das den Platzhalter `$` enthält, der durch den eingegebenen Wert ersetzt wird. Optional kann ein Platzhaltertext angegeben werden, | ||
| der im Eingabefeld angezeigt wird. Zusätzlich kann der Type des Eingabefelds angegeben werden (z.B. `text`, `number`, `email`). | ||
|
|
||
| """, Text.codeBlock("./demo.java", "// Input"))); | ||
|
|
||
| // Input | ||
| int exampleValue = 0; // Input Example | ||
| Clerk.write(Interaction.input("./demo.java", "// Input Example", "int exampleValue = $;", "Geben Sie eine Zahl ein")); | ||
|
|
||
| String exampleString; // Input String Example | ||
| Clerk.write(Interaction.input("./demo.java", "// Input String Example", "String exampleString = \"$\";", "Geben Sie einen String ein")); | ||
| // Input | ||
|
|
||
| Clerk.markdown(Text.fillOut(""" | ||
| #### Checkbox | ||
| Für Checkboxen kann `Interaction.checkbox(...)` verwendet werden. Diese triggern die Änderung des Quelltextes, wenn sie angeklickt werden. | ||
| ```java | ||
| ${0} | ||
| ``` | ||
| """, Text.codeBlock("./demo.java", "// Checkbox"))); | ||
|
|
||
| // Checkbox | ||
| boolean booleanValue = false; // Boolean Example | ||
| Clerk.write(Interaction.checkbox("./demo.java", "// Boolean Example", "boolean booleanValue = $;", booleanValue)); | ||
| // Checkbox | ||
|
|
||
| Clerk.markdown(Text.fillOut(""" | ||
| ## Dot View | ||
| Die Dot-View erlaubt das Anzeigen von Graphen, die im [DOT-Format](https://graphviz.org/doc/info/lang.html) beschrieben sind. | ||
| ```java | ||
| ${0} | ||
| ``` | ||
| """, Text.codeBlock("./demo.java", "// Dot"))); | ||
| Register[skipId]: Counter wc | ||
| Text: | ||
| Hello World | ||
| ~~~ | ||
| | Counter | Html | ||
|
|
||
| // Dot | ||
| Dot dot = new Dot(); | ||
| dot.draw(""" | ||
| digraph G { | ||
| A -> B; | ||
| B -> C; | ||
| } | ||
| """); | ||
| // Dot | ||
| } | ||
|
|
||
|
|
||
| // Turtle triangle | ||
| void triangle(Turtle turtle, double size) { | ||
| turtle.forward(size).right(60).backward(size).right(60).forward(size).right(60 + 180); | ||
| """); | ||
|
|
||
| } | ||
|
|
||
| void drawing(Turtle turtle, double size) { | ||
| for (int i = 1; i <= 18; i++) { | ||
| turtle.color(255, i * 256 / 37, i * 256 / 37, 1); // turtle color | ||
| turtle.width(1.0 - 1.0 / 36.0 * i); | ||
| triangle(turtle, size + 1 - 2 * i); | ||
| turtle.left(20).forward(5); | ||
| // example | ||
| String buildObstListe() { | ||
| String out = ""; | ||
| for (String o : obst) { | ||
| out += "**" + o + "**\n"; | ||
| } | ||
| return out; | ||
| } | ||
| // Turtle triangle | ||
| // example |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| [ | ||
| { "path": "demo/**/demo.java", "cmd": "java --enable-preview -Dsun.stdout.encoding=UTF-8" }, | ||
| { "path": "demo/sub1/demo.bat", "cmd": "" } | ||
| ] | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dokumentation: Wie funktioniert die Überwachung? Welche Dateien müssen wo liegen, um eine Ausführung zu triggern?