diff --git a/editions/tw5.com/tiddlers/system/doc-styles.tid b/editions/tw5.com/tiddlers/system/doc-styles.tid index 2e33a266c..35b955105 100644 --- a/editions/tw5.com/tiddlers/system/doc-styles.tid +++ b/editions/tw5.com/tiddlers/system/doc-styles.tid @@ -110,6 +110,9 @@ td svg { padding-bottom: 0; margin-top: 0.2em; } +.doc-example input { + width: 60%; +} .doc-example pre:first-child { margin-top: 0; } diff --git a/editions/tw5.com/tiddlers/system/operator-macros.tid b/editions/tw5.com/tiddlers/system/operator-macros.tid index df917402b..477968945 100644 --- a/editions/tw5.com/tiddlers/system/operator-macros.tid +++ b/editions/tw5.com/tiddlers/system/operator-macros.tid @@ -5,22 +5,29 @@ tags: $:/tags/Macro \define .operator-examples(op,text:"Examples") <$link to="$op$ Operator (Examples)">$text$ +\define .operator-example-tryit-actions() <$action-setfield $tiddler=<<.state>> text="show" filter=<<__eg__>>/> \define .operator-example(n,eg,ie)
-`$eg$` -<$macrocall $name=".if" cond="""$ie$""" then="""
→ $ie$
"""/> <$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix[$n$]]" variable=".state"> <$reveal state=<<.state>> type="nomatch" text="show"> + `$eg$` + <$macrocall $name=".if" cond="""$ie$""" then="""
→ $ie$
"""/>
-
<$button set=<<.state>> setTo="show">Try it
+
<$button actions=<<.operator-example-tryit-actions>>>Try it
<$reveal state=<<.state>> type="match" text="show"> + <$edit-text tiddler=<<.state>> field="filter" tag="input" type=search focus="true"/>
-
<$button set=<<.state>> setTo="">Hide
+
+ <$button set=<<.state>> setTo="">Hide + <$reveal stateTitle=<<.state>> stateField="filter" type="nomatch" text=<<__eg__>>> + <$button actions=<<.operator-example-tryit-actions>>>Reset + +
-