docs: lit-divi-catalog shows both result shapes (trial)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
@@ -53,6 +53,10 @@ mit eigenen HTML-/Attribut-Feldern beim Speichern – nur wenn die Seite noch ni
|
|||||||
`linkUrl`) ist der Eintrag stattdessen eine Zuordnung Unterfeld → Feldart (`{"text": "text", "linkUrl":
|
`linkUrl`) ist der Eintrag stattdessen eine Zuordnung Unterfeld → Feldart (`{"text": "text", "linkUrl":
|
||||||
"url"}`), soweit für die einzelnen Unterfelder ableitbar; fehlende Pfade oder Unterfelder gelten als
|
"url"}`), soweit für die einzelnen Unterfelder ableitbar; fehlende Pfade oder Unterfelder gelten als
|
||||||
unbekannt, statt eine Feldart zu raten.
|
unbekannt, statt eine Feldart zu raten.
|
||||||
|
- Ergebnisform ohne `module`: `{"modules": [{"name": "divi/heading", "title": "Heading", "category": "module",
|
||||||
|
"children": [], "shortform": true}, …], "notes": […]}`; mit `module`: `{"module": {"name": "divi/heading",
|
||||||
|
"title": …, "children": […], "item_type": null, "shortform": {"text": {"path": "title.innerContent", …}},
|
||||||
|
"paths": […], "path_kinds": {…}}, "notes": […]}`.
|
||||||
- `lit-divi-node-get` zeigt die gesetzten Werte eines vorhandenen Knotens in genau dieser Form (`attrs`).
|
- `lit-divi-node-get` zeigt die gesetzten Werte eines vorhandenen Knotens in genau dieser Form (`attrs`).
|
||||||
- Schrift-Gruppen liegen eine Ebene tiefer: `…decoration.font.font`, `…decoration.bodyFont.body.font`,
|
- Schrift-Gruppen liegen eine Ebene tiefer: `…decoration.font.font`, `…decoration.bodyFont.body.font`,
|
||||||
`…decoration.headingFont.h2.font`, `module.advanced.text.text`.
|
`…decoration.headingFont.h2.font`, `module.advanced.text.text`.
|
||||||
|
|||||||
@@ -38,7 +38,11 @@ final class DiviCatalogAbility implements Ability
|
|||||||
return 'Listet die Divi-Module dieser Website (Name, Titel, Art, erlaubte Kind-Module) und welche eine '
|
return 'Listet die Divi-Module dieser Website (Name, Titel, Art, erlaubte Kind-Module) und welche eine '
|
||||||
. 'Kurzform haben; ohne module alle Module. Mit module: Kurzform-Felder und alle gültigen '
|
. 'Kurzform haben; ohne module alle Module. Mit module: Kurzform-Felder und alle gültigen '
|
||||||
. 'Attributpfade des Moduls für die Vollform, je Pfad nach Möglichkeit mit Feldart (path_kinds), bei '
|
. 'Attributpfade des Moduls für die Vollform, je Pfad nach Möglichkeit mit Feldart (path_kinds), bei '
|
||||||
. 'zusammengesetzten Pfaden als Zuordnung Unterfeld => Feldart.';
|
. 'zusammengesetzten Pfaden als Zuordnung Unterfeld => Feldart. Ergebnis ohne module: '
|
||||||
|
. '{"modules": [{"name": "divi/heading", "title": "Heading", "category": "module", "children": [], '
|
||||||
|
. '"shortform": true}, …], "notes": […]}; mit module: {"module": {"name": "divi/heading", "title", '
|
||||||
|
. '"category", "children", "item_type", "shortform": {Feld: {path, sub, kind, description}}, "paths": '
|
||||||
|
. '[…], "path_kinds": {Pfad: Feldart}}, "notes": […]}.';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function inputSchema(): array
|
public function inputSchema(): array
|
||||||
|
|||||||
@@ -21,6 +21,16 @@ final class DiviCatalogAbilityTest extends TestCase
|
|||||||
return new DiviCatalogAbility($modules);
|
return new DiviCatalogAbility($modules);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Trial feedback: both result shapes as one-line examples. */
|
||||||
|
public function testDescriptionShowsBothResultShapes(): void
|
||||||
|
{
|
||||||
|
$description = $this->ability()->description();
|
||||||
|
|
||||||
|
self::assertStringContainsString('{"modules": [{"name": "divi/heading"', $description);
|
||||||
|
self::assertStringContainsString('{"module": {"name": "divi/heading"', $description);
|
||||||
|
self::assertStringContainsString('"notes": [', $description);
|
||||||
|
}
|
||||||
|
|
||||||
public function testListsModulesWithShortformFlag(): void
|
public function testListsModulesWithShortformFlag(): void
|
||||||
{
|
{
|
||||||
$result = $this->ability()->execute([]);
|
$result = $this->ability()->execute([]);
|
||||||
|
|||||||
Reference in New Issue
Block a user