created: 20150117152607000 modified: 20240229155550000 tags: $:/tags/Macro title: $:/editions/tw5.com/doc-macros code-body: yes type: text/vnd.tiddlywiki \whitespace trim \function .concat(1,2,3,4,5) [[$(1)$$(2)$$(3)$$(4)$$(5)$]substitute[]] \function .word(_) [["]] [<_>] =[["]] +[join[]] \procedure .def(_) <<_>> \procedure .em(_) <<_>> \procedure .strong(_) <<_>> \procedure .place(_) <<_>> \procedure .preamble(_)
<<_>>
\procedure .tid(_) <<_>> \procedure .tag(_) <<_>> \procedure .field(_) <<_>> \procedure .value(_) <<_>> \procedure .op(_) <<_>> \procedure .var(_) <<_>> \procedure .wid(_) <$macrocall $name=".concat" 1="$" 2=<<_>>/> \procedure .attr(_) <<_>> \procedure .param(_) <<_>> \procedure .tiddler-fields(tiddler) <$tiddler tiddler=<>>

<$link> {{||$:/core/ui/TiddlerIcon}}<$text text=<>/>

<$list filter="[all[current]fields[]sort[title]] -title" template="$:/core/ui/TiddlerFieldTemplate" variable="listItem"/>
\end \function .mtitle(_) [<_>] Macro +[join[ ]] \function .otitle(_) [<_>] Operator +[join[ ]] \function .vtitle(_) [<_>] Variable +[join[ ]] \procedure .link(_,to) <$link to=<> ><<_>> \procedure .clink(_,to) <$link to=<>><<_>> \procedure .dlink(_,to) <$link to=<>><$macrocall $name=".def" _=<<_>>/> \procedure .dlink-ex(_,to) > class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer"><$macrocall $name=".def" _=<<_>>/> \procedure .flink(to) <$macrocall $name=".link" _=`<<.field {{$(to)$!!caption}}>>` to=<>/> \procedure .mlink(_) <$link to={{{ [.mtitle<_>] }}}><$macrocall $name=".var" _=<<_>>/> \procedure .mlink2(_,to) <$link to=<>><$macrocall $name=".var" _=<<_>>/> \procedure .olink(_) <$link to={{{ [.otitle<_>] }}}><$macrocall $name=".op" _=<<_>>/> \procedure .olink2(_,to) <$link to={{{ [.otitle] }}}><$macrocall $name=".op" _=<<_>>/> \procedure .vlink(_) <$link to={{{ [.vtitle<_>] }}}><$macrocall $name=".var" _=<<_>>/> \procedure .vlink2(_,to) <$link to=<>><$macrocall $name=".var" _=<<_>>/> \procedure .wlink(to) <$link to=<> > <$macrocall $name=".wid" _={{{ [get[caption]] }}}> \procedure .wlink2(_,to) <$link to=<> ><<_>> \procedure .key(_) <<_>> \procedure .keys(_) <<_>> \procedure .tab(_) <$transclude $tiddler=<<_>> $field=caption ><<_>> \procedure .sidebar-tab(_) <$macrocall $name=".tab" _=`$:/core/ui/SideBar/$(_)$`/> \procedure .more-tab(_) <$macrocall $name=".tab" _=`$:/core/ui/MoreSideBar/$(_)$`/> \procedure .info-tab(_) <$macrocall $name=".tab" _=`$:/core/ui/TiddlerInfo/$(_)$`/> \procedure .controlpanel-tab(_) <$macrocall $name=".tab" _=`$:/core/ui/ControlPanel/$(_)$`/> \procedure .advancedsearch-tab(_) <$macrocall $name=".tab" _=`$:/core/ui/AdvancedSearch/$(_)$`/> \procedure .toc-tab() <$macrocall $name=".tab" _="TableOfContents"/> \procedure .example-tab(_) <<_>> \procedure .doc-tabs() <$macrocall $name="tabs" tabsList="[tagdescription[tab]]" default={{{ [tagfirst[]] }}} explicitState={{{ [addprefix[$:/state/tab/]] }}} class={{{ [[doc-tabs]] [encodeuricomponent[]escapecss[]addprefix[doc-tabs-]] +[join[ ]] }}} /> \end \procedure .doc-tab-link(text, target, tooltip:"", class:"") <$tiddler tiddler={{{ [search:text[.doc-tabs]] :else[tags[]search:text[.doc-tabs]first[]] :else[] }}} > <$button class={{{ [[tc-btn-invisible tc-tiddlylink]] [] +[join[ ]] }}} set={{{ [addprefix[$:/state/tab/]] }}} setTo=<> tooltip=<>> <> <$list filter="[[$:/StoryList]contains]" variable="ignore" emptyMessage="<$action-navigate />"> <$action-sendmessage $message="tm-scroll" selector={{{ [encodeuricomponent[]addprefix[.doc-tabs-]] }}} /> <$action-sendmessage $message="tm-scroll" selector={{{ [encodeuricomponent[]escapecss[]addprefix[.doc-tabs-]] }}} /> \end \procedure .widget-attr-link(text, target) <$macrocall $name=".doc-tab-link" text={{{ [[]] [] [[]] +[join[]] }}} class="doc-tab-link" target=<> tooltip={{{ [[Show more information about the ']] [] [[' attribute]] +[join[]] }}} /> \end \procedure .button(_) <$transclude $tiddler=`$:/core/ui/Buttons/$(_)$` $field="caption" ><<_>> \procedure .icon(_) <$transclude $tiddler=<<_>>/> \procedure .infoBox(text:"", title, icon:"$:/core/images/info-button", class, iconSize:"1.4rem") \function _f.tipClass() [[doc-icon-block]] [!is[blank]then] +[join[ ]]
>> <%if [!is[blank]] %><div>''<<title>>''</div><% endif %> <div class="doc-block-icon"><$transclude $tiddler=<<icon>> size=<<iconSize>>/></div> <<text>> </div> \end \procedure .note(_:"", title:"Note", icon:"$:/core/images/info-button", class:"doc-note", iconSize:"22pt") <$macrocall $name=".infoBox" text=<<_>> title=<<title>> icon=<<icon>> class=<<class>> iconSize=<<iconSize>>/> \end \procedure .tip(_:"", title:"Tip" , icon:"$:/core/images/tip", class:"doc-tip", iconSize:"22pt") <$macrocall $name=".infoBox" text=<<_>> title=<<title>> icon=<<icon>> class=<<class>> iconSize=<<iconSize>>/> \end \procedure .warning(_:"", title:"Warning", icon:"$:/core/images/warning", class:"doc-warning", iconSize:"22pt") <$macrocall $name=".infoBox" text=<<_>> title=<<title>> icon=<<icon>> class=<<class>> iconSize=<<iconSize>>/> \end \procedure .state-prefix() $:/state/editions/tw5.com/ \procedure .lorem() Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \end \procedure .toc-lorem() This is an example tiddler. See [[Table-of-Contents Macros (Examples)]]. <<.lorem>> \end \procedure .example(n,eg,egvar) <$let eg={{{ [<egvar>!is[blank]getvariable[]] :else[<eg>] }}}> <div class="doc-example"> <$macrocall $name="copy-to-clipboard-above-right" src=<<eg>>/> <$codeblock code=<<eg>>/> <$list filter=`[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix[$(n)$]]` variable=".state"> <$reveal state=<<.state>> type="nomatch" text="show"> <dl> <dd><$button set=<<.state>> setTo="show">Try it</$button></dd> </dl> </$reveal> <$reveal state=<<.state>> type="match" text="show"> <dl> <dd><$button set=<<.state>> setTo="">Hide</$button></dd> </dl> <blockquote class="doc-example-result"> <<eg>> </blockquote> </$reveal> </$list> </div> </$let> \end \procedure .bad-example(eg) <table class="doc-bad-example"> <tbody> <tr class="evenRow"> <td> <span class="tc-small-gap-right" style="font-size:1.5em;">⚠</span> Warning:<br> Don't do it this way! </td> <td> <$transclude $variable="eg" $mode="block"/> </td> </tr> </tbody> </table> \end \procedure .link-badge(text,link,colour) <a href=<<link>> class="doc-link-badge" style.background-color=<<colour>> target="_blank" rel="noopener noreferrer"> <$text text=<<text>>/> </a> \end <!-- TODO use $:/palette colour settings --> \procedure .link-badge-added(link,colour:#ffe246) <$macrocall $name=".link-badge" text="added" link=<<link>> colour=<<colour>>/> \procedure .link-badge-addendum(link,colour:#fcc84a) <$macrocall $name=".link-badge" text="addendum" link=<<link>> colour=<<colour>>/> \procedure .link-badge-extended(link,colour:#f9a344) <$macrocall $name=".link-badge" text="extended" link=<<link>> colour=<<colour>>/> \procedure .link-badge-fixed(link,colour:#ffa86d) <$macrocall $name=".link-badge" text="fixed" link=<<link>> colour=<<colour>>/> \procedure .link-badge-here(link,colour:#d88e63) <$macrocall $name=".link-badge" text="here" link=<<link>> colour=<<colour>>/> \procedure .link-badge-hide(link,colour:#9d959f) <$macrocall $name=".link-badge" text="hide" link=<<link>> colour=<<colour>>/> \procedure .link-badge-improved(link,colour:#7593c7) <$macrocall $name=".link-badge" text="improved" link=<<link>> colour=<<colour>>/> \procedure .link-badge-modified(link,colour:#7f99c9) <$macrocall $name=".link-badge" text="modified" link=<<link>> colour=<<colour>>/> \procedure .link-badge-removed(link,colour:#a9aabc) <$macrocall $name=".link-badge" text="removed" link=<<link>> colour=<<colour>>/> \procedure .link-badge-renamed(link,colour:#b4b995) <$macrocall $name=".link-badge" text="renamed" link=<<link>> colour=<<colour>>/> \procedure .link-badge-updated(link,colour:#91ba66) <$macrocall $name=".link-badge" text="updated" link=<<link>> colour=<<colour>>/> \procedure .banner-credits(credit,url) <img src=<<url>> width="140" style="float:left;margin-right:0.5em;"/> <<credit>> <div style="clear:both;"/> \end \procedure .contributors(usernames) <ol class="doc-github-contributors"> <$list filter="[enlist<usernames>sort[]]" variable="username"> <li> <a href={{{ [[https://github.com/]addsuffix<username>] }}} class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer"> <img src={{{ [[https://github.com/]addsuffix<username>addsuffix[.png?size=64]] }}} width="64" height="64"/> <span class="doc-github-contributor-username"> @<$text text=<<username>>/> </span> </a> </li> </$list> </ol> \end