1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 12:07:19 +00:00

Remove text subst from operator example macro (#7550)

* Removed textual substitution from .operator-example macro

* Convert .operator-example from macro to procedure
This commit is contained in:
btheado 2023-06-18 05:05:06 -05:00 committed by GitHub
parent b90c9ef9a0
commit 13a895bd2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,17 +1,17 @@
created: 20150117152607000 created: 20150117152607000
modified: 20220227210111054 modified: 20230617183916622
tags: $:/tags/Macro tags: $:/tags/Macro
title: $:/editions/tw5.com/operator-macros title: $:/editions/tw5.com/operator-macros
\define .operator-examples(op,text:"Examples") <$link to="$op$ Operator (Examples)">$text$</$link> \define .operator-examples(op,text:"Examples") <$link to="$op$ Operator (Examples)">$text$</$link>
\define .operator-example-tryit-actions() <$action-setfield $tiddler=<<.state>> text="show" filter=<<__eg__>>/> \procedure .operator-example-tryit-actions() <$action-setfield $tiddler=<<.state>> text="show" filter=<<eg>>/>
\define .operator-example(n,eg,ie) \procedure .operator-example(n,eg,ie)
<div class="doc-example"> <div class="doc-example">
<$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix[$n$]]" variable=".state"> <$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix<n>]" variable=".state">
<$reveal state=<<.state>> type="nomatch" text="show"> <$reveal state=<<.state>> type="nomatch" text="show">
`$eg$` <code><$text text=<<eg>>/></code>
<$macrocall $name=".if" cond="""$ie$""" then="""<dd>&rarr; $ie$</dd>"""/> <$macrocall $name=".if" cond=<<ie>> then={{{[[<dd>&rarr; ]addsuffix<ie>addsuffix[</dd>]]}}}/>
<dl> <dl>
<dd><$button actions=<<.operator-example-tryit-actions>>>Try it</$button></dd> <dd><$button actions=<<.operator-example-tryit-actions>>>Try it</$button></dd>
</dl> </dl>
@ -21,7 +21,7 @@ title: $:/editions/tw5.com/operator-macros
<dl> <dl>
<dd> <dd>
<$button set=<<.state>> setTo="">Hide</$button> <$button set=<<.state>> setTo="">Hide</$button>
<$reveal stateTitle=<<.state>> stateField="filter" type="nomatch" text=<<__eg__>>> <$reveal stateTitle=<<.state>> stateField="filter" type="nomatch" text=<<eg>>>
<$button actions=<<.operator-example-tryit-actions>>>Reset</$button> <$button actions=<<.operator-example-tryit-actions>>>Reset</$button>
</$reveal> </$reveal>
</dd> </dd>