2022-06-20 12:55:12 +00:00
|
|
|
code-body: yes
|
2015-01-18 18:39:00 +00:00
|
|
|
created: 20150117184156000
|
2024-03-15 18:08:37 +00:00
|
|
|
modified: 20240315144208842
|
2014-06-12 17:01:33 +00:00
|
|
|
tags: $:/tags/Macro
|
2022-01-23 09:44:01 +00:00
|
|
|
title: $:/editions/tw5.com/wikitext-macros
|
|
|
|
type: text/vnd.tiddlywiki
|
2014-06-12 17:01:33 +00:00
|
|
|
|
2024-03-13 22:02:56 +00:00
|
|
|
\whitespace trim
|
|
|
|
|
|
|
|
\procedure activatePluginTab()
|
2022-06-20 12:55:12 +00:00
|
|
|
<$action-setfield $tiddler="$:/state/tab-1749438307" text="$:/core/ui/ControlPanel/Plugins"/>
|
|
|
|
<$action-navigate $to="$:/ControlPanel"/>
|
|
|
|
\end
|
|
|
|
|
2024-03-13 22:02:56 +00:00
|
|
|
\procedure activateTiddlerWindow()
|
|
|
|
<$action-sendmessage $message="tm-open-window" $param=<<currentTiddler>> windowTitle="Side by Side View" width="800" height="600" />
|
2022-06-20 12:55:12 +00:00
|
|
|
\end
|
|
|
|
|
2024-03-13 22:02:56 +00:00
|
|
|
\procedure controlPanel-plugin-link()
|
2022-06-20 12:55:12 +00:00
|
|
|
<$button actions=<<activatePluginTab>> class="tc-btn-invisible tc-tiddlylink">
|
2024-03-13 22:02:56 +00:00
|
|
|
{{$:/core/images/options-button}} ~ControlPanel
|
2022-06-20 12:55:12 +00:00
|
|
|
</$button>
|
|
|
|
\end
|
|
|
|
|
2024-03-13 22:02:56 +00:00
|
|
|
\procedure open-tiddler-in-window()
|
|
|
|
\whitespace notrim
|
2022-06-20 12:55:12 +00:00
|
|
|
<$button actions=<<activateTiddlerWindow>> class="tc-btn-invisible tc-tiddlylink">
|
2024-03-13 22:02:56 +00:00
|
|
|
open ''this'' tiddler in a new window
|
2022-06-20 12:55:12 +00:00
|
|
|
</$button>
|
|
|
|
\end
|
|
|
|
|
2024-03-13 22:02:56 +00:00
|
|
|
\procedure activateEditionWindow(url)
|
|
|
|
<$action-sendmessage $message="tm-open-external-window" $param=<<url>> windowName="_edition" windowFeatures="width=800 height=600" />
|
2022-06-20 12:55:12 +00:00
|
|
|
\end
|
|
|
|
|
2024-03-13 22:02:56 +00:00
|
|
|
\procedure open-external-window(url)
|
|
|
|
\whitespace notrim
|
|
|
|
<$button actions=<<activateEditionWindow <<url>> class="tc-btn-invisible tc-tiddlylink">
|
|
|
|
open the ''example edition'' in a new window
|
2022-06-20 12:55:12 +00:00
|
|
|
</$button>
|
|
|
|
\end
|
|
|
|
|
|
|
|
|
2024-03-13 22:02:56 +00:00
|
|
|
\procedure wikitext-example(src)
|
2015-01-18 18:39:00 +00:00
|
|
|
<div class="doc-example">
|
2024-03-13 22:02:56 +00:00
|
|
|
<$macrocall $name="copy-to-clipboard-above-right" src=<<src>>/>
|
|
|
|
<$codeblock code=<<src>>/>
|
|
|
|
<p>
|
|
|
|
That renders as:
|
|
|
|
</p>
|
|
|
|
<$transclude $variable="src" $mode="block"/>
|
|
|
|
<p>
|
|
|
|
... and the underlying HTML is:
|
|
|
|
</p>
|
|
|
|
<$wikify name="html" text=<<src>> output="html">
|
|
|
|
<$codeblock code=<<html>>/>
|
|
|
|
</$wikify>
|
2015-01-18 18:39:00 +00:00
|
|
|
</div>
|
2014-06-12 17:01:33 +00:00
|
|
|
\end
|
|
|
|
|
2024-03-13 22:02:56 +00:00
|
|
|
\procedure wikitext-example-without-html(src)
|
2015-01-18 18:39:00 +00:00
|
|
|
<div class="doc-example">
|
2024-03-13 22:02:56 +00:00
|
|
|
<$macrocall $name="copy-to-clipboard-above-right" src=<<src>>/>
|
|
|
|
<$codeblock code=<<src>>/>
|
|
|
|
<p>
|
|
|
|
That renders as:
|
|
|
|
</p>
|
2024-03-15 18:08:37 +00:00
|
|
|
<$transclude $variable="src" $mode="block"/>
|
2015-01-18 18:39:00 +00:00
|
|
|
</div>
|
2014-06-12 17:01:33 +00:00
|
|
|
\end
|
2015-01-11 10:55:22 +00:00
|
|
|
|
2024-03-13 22:02:56 +00:00
|
|
|
\procedure wikitext-example-table-header() <thead><tr><th/><th>wiki text</th><th>renders as</th></tr></thead>
|
2022-01-23 09:44:01 +00:00
|
|
|
|
2024-03-13 22:02:56 +00:00
|
|
|
\procedure wikitext-example-table-row(id, code)
|
|
|
|
<tr>
|
|
|
|
<th><<id>></th>
|
|
|
|
<td><$codeblock code=<<code>>/></td>
|
|
|
|
<td><<code>></td>
|
2022-01-23 09:44:01 +00:00
|
|
|
</tr>
|
|
|
|
\end
|
|
|
|
|
2024-03-13 22:02:56 +00:00
|
|
|
\procedure tw-code(tiddler)
|
2015-01-11 17:15:27 +00:00
|
|
|
<$codeblock language={{$tiddler$!!type}} code={{$tiddler$}}/>
|
2015-01-11 10:55:22 +00:00
|
|
|
\end
|
|
|
|
|
2024-03-13 22:02:56 +00:00
|
|
|
\procedure tw-code-link(tiddler)
|
2015-01-11 10:55:22 +00:00
|
|
|
[[$tiddler$]]:
|
|
|
|
<<tw-code $tiddler$>>
|
2022-03-02 17:36:53 +00:00
|
|
|
\end
|
2022-12-04 17:58:16 +00:00
|
|
|
|
2024-03-13 22:02:56 +00:00
|
|
|
\procedure flex-card(class,bordercolor:"",backgroundcolor:"",textcolor:"",imageField:"image",captionField:"caption",subtitle:"",descriptionField:"description",linkField:"link")
|
|
|
|
<$link class={{{ [<class>addprefix[tc-card ]] }}} to={{{ [<currentTiddler>get<linkField>else<currentTiddler>] }}}>
|
|
|
|
<div class="tc-card-accent" style.borderTop={{{ [<bordercolor>!is[blank]addprefix[5px solid ]] }}} style.background={{!!background}} style.backgroundColor=<<backgroundcolor>> style.color=<<textcolor>> style.fill=<<textcolor>>>
|
2022-12-04 17:58:16 +00:00
|
|
|
<$list filter="[<currentTiddler>has[ribbon-text]]" variable="ignore">
|
|
|
|
<div class="tc-card-ribbon-wrapper">
|
|
|
|
<div class="tc-card-ribbon" style.backgroundColor={{{ [<currentTiddler>get[ribbon-color]else[red]] }}}>
|
|
|
|
<div class="tc-card-ribbon-inner">
|
|
|
|
<$text text={{!!ribbon-text}}/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</$list>
|
2024-03-13 22:02:56 +00:00
|
|
|
<$list filter="[<currentTiddler>has<imageField>]" variable="ignore">
|
2022-12-04 17:58:16 +00:00
|
|
|
<div class="tc-card-image">
|
2024-03-13 22:02:56 +00:00
|
|
|
<$image source={{{ [<currentTiddler>get<imageField>] }}}/>
|
2022-12-04 17:58:16 +00:00
|
|
|
</div>
|
|
|
|
</$list>
|
2024-03-13 22:02:56 +00:00
|
|
|
<div class="tc-card-title"><$transclude field=<<captionField>>><$view field="title"/></$transclude></div>
|
|
|
|
<$list filter="[<subtitle>!is[blank]]" variable="ignore">
|
2022-12-04 17:58:16 +00:00
|
|
|
<div class="tc-card-subtitle">
|
2024-03-13 22:02:56 +00:00
|
|
|
<$text text=<<subtitle>>/>
|
2022-12-04 17:58:16 +00:00
|
|
|
</div>
|
|
|
|
</$list>
|
2023-04-10 14:52:10 +00:00
|
|
|
<div class="tc-card-icon"><$transclude tiddler={{!!icon}}/></div>
|
2022-12-04 17:58:16 +00:00
|
|
|
<div class="tc-card-body-wrapper">
|
|
|
|
<div class="tc-card-body">
|
2024-03-13 22:02:56 +00:00
|
|
|
<$transclude field=<<descriptionField>> mode="block"/>
|
2022-12-04 17:58:16 +00:00
|
|
|
</div>
|
|
|
|
<div class="tc-card-body-clear">
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-04-10 14:52:10 +00:00
|
|
|
<$list filter="[all[current]has[button-text]]" variable="ignore">
|
|
|
|
<div class="tc-card-button" style.background-color={{!!button-color}} style.border-color={{!!button-color}}>
|
|
|
|
<$text text={{!!button-text}}/> {{$:/core/images/chevron-right}}
|
|
|
|
</div>
|
|
|
|
</$list>
|
2022-12-04 17:58:16 +00:00
|
|
|
</div>
|
|
|
|
</$link>
|
|
|
|
\end
|