From dac9727385c524e4137001734b3c8fbe5c057a57 Mon Sep 17 00:00:00 2001 From: linonetwo Date: Sun, 19 Feb 2023 16:47:49 +0800 Subject: [PATCH] docs: about trait tag --- demo/tiddlers/$__TraitTag.tid | 16 ++++++++++++++++ demo/tiddlers/Examples.tid | 12 +++++++++--- demo/tiddlers/Index.tid | 6 ++++-- 3 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 demo/tiddlers/$__TraitTag.tid diff --git a/demo/tiddlers/$__TraitTag.tid b/demo/tiddlers/$__TraitTag.tid new file mode 100644 index 0000000..0ed70b2 --- /dev/null +++ b/demo/tiddlers/$__TraitTag.tid @@ -0,0 +1,16 @@ +created: 20230218103715583 +creator: 林一二 +modified: 20230218103716732 +modifier: 林一二 +title: $:/SuperTag/TraitTag +type: text/vnd.tiddlywiki + +See `schema` field of following tiddlers for JSON Schema examples. + +<$list filter="[tag]"> + +!!! <$link><> + + {{!!text}} + + \ No newline at end of file diff --git a/demo/tiddlers/Examples.tid b/demo/tiddlers/Examples.tid index c3129de..222b7e3 100644 --- a/demo/tiddlers/Examples.tid +++ b/demo/tiddlers/Examples.tid @@ -6,12 +6,18 @@ tags: Index title: Examples type: text/vnd.tiddlywiki -!! Task +!! SuperTag + +!!! Task [[Task]] is a SuperTag, [[MyExampleTask]] is a normal tiddler adds this SuperTag. [[$:/TraitTag/ActionState]] and [[$:/TraitTag/Priority]] are example TraitTags adding to it. -!! Counter +!!! Counter + +[[ColorAndCounter]] is a SuperTag, with TraitTag [[$:/TraitTag/Count]] and [[$:/TraitTag/Color]] + +!! TraitTag -[[ColorAndCounter]] is a SuperTag, with TraitTag [[$:/TraitTag/Count]] and [[$:/TraitTag/Color]] \ No newline at end of file +See [[$:/SuperTag/TraitTag]] for details. \ No newline at end of file diff --git a/demo/tiddlers/Index.tid b/demo/tiddlers/Index.tid index 58c15fc..2fb7b34 100644 --- a/demo/tiddlers/Index.tid +++ b/demo/tiddlers/Index.tid @@ -38,9 +38,11 @@ A TraitTag has two important fields, `"schema"` and `"uiSchema"`. <$whiteboard tiddler="HowToCreateTraitTagDiagram" readonly="yes" height="850px" /> * schema: a [[JSON Schema|https://json-schema.org/]] that describe what data a form will receive. -* uiSchema: a [[jsonforms' option|https://jsonforms.io/docs/uischema/]] to describe the form's UI element and layout. +** You may refer to [[JSON Editor Doc#JSON Schema Support|https://github.com/json-editor/json-editor#json-schema-support]] for advanced features in the form +** A basic assumption is that the JSON Schema are `type: "object"` and has only 1 level of properties. +** All properties provided by all trait tags are merged into a single JSON Schema, and then is used to display the SuperTag Form -See links above to learn how to write them. You can also learn from some existed TraitTag. +See links above to learn how to write them. You can also learn from some existed [[TraitTag Examples|$:/SuperTag/TraitTag]]. !!! Plugin developer