2022-06-20 12:55:12 +00:00
|
|
|
code-body: yes
|
2015-01-18 18:39:00 +00:00
|
|
|
created: 20150117184156000
|
2022-06-20 12:55:12 +00:00
|
|
|
modified: 20220617122915793
|
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
|
|
|
|
2022-06-20 12:55:12 +00:00
|
|
|
\define activatePluginTab()
|
|
|
|
<$action-setfield $tiddler="$:/state/tab-1749438307" text="$:/core/ui/ControlPanel/Plugins"/>
|
|
|
|
<$action-navigate $to="$:/ControlPanel"/>
|
|
|
|
\end
|
|
|
|
|
|
|
|
\define activateTiddlerWindow()
|
|
|
|
<$action-sendmessage $message="tm-open-window"
|
|
|
|
$param=<<currentTiddler>> windowTitle="Side by Side View"
|
|
|
|
width="800" height="600" />
|
|
|
|
\end
|
|
|
|
|
|
|
|
\define controlPanel-plugin-link()
|
|
|
|
<$button actions=<<activatePluginTab>> class="tc-btn-invisible tc-tiddlylink">
|
|
|
|
{{$:/core/images/options-button}} ~ControlPanel
|
|
|
|
</$button>
|
|
|
|
\end
|
|
|
|
|
|
|
|
\define open-tiddler-in-window()
|
|
|
|
<$button actions=<<activateTiddlerWindow>> class="tc-btn-invisible tc-tiddlylink">
|
|
|
|
open ''this'' tiddler in a new window
|
|
|
|
</$button>
|
|
|
|
\end
|
|
|
|
|
|
|
|
\define activateEditionWindow(url)
|
|
|
|
<$action-sendmessage $message="tm-open-external-window"
|
|
|
|
$param="""$url$""" windowName="_edition"
|
|
|
|
windowFeatures="width=800 height=600" />
|
|
|
|
\end
|
|
|
|
|
|
|
|
\define open-external-window(url)
|
|
|
|
<$button actions=<<activateEditionWindow """$url$""">> class="tc-btn-invisible tc-tiddlylink">
|
|
|
|
open the ''example edition'' in a new window
|
|
|
|
</$button>
|
|
|
|
\end
|
|
|
|
|
|
|
|
|
2014-06-12 17:01:33 +00:00
|
|
|
\define wikitext-example(src)
|
2015-01-18 18:39:00 +00:00
|
|
|
<div class="doc-example">
|
|
|
|
|
2017-12-16 10:58:33 +00:00
|
|
|
<$macrocall $name="copy-to-clipboard-above-right" src=<<__src__>>/>
|
|
|
|
|
2014-06-12 17:01:33 +00:00
|
|
|
```
|
|
|
|
$src$
|
|
|
|
```
|
|
|
|
|
2015-01-18 18:39:00 +00:00
|
|
|
That renders as:
|
2014-06-12 17:01:33 +00:00
|
|
|
|
2021-03-09 18:11:36 +00:00
|
|
|
$$$text/vnd.tiddlywiki
|
2014-06-12 17:01:33 +00:00
|
|
|
$src$
|
2021-03-09 18:11:36 +00:00
|
|
|
$$$
|
2014-06-12 17:01:33 +00:00
|
|
|
|
2015-01-18 18:39:00 +00:00
|
|
|
... and the underlying HTML is:
|
2014-06-12 17:01:33 +00:00
|
|
|
|
|
|
|
$$$text/vnd.tiddlywiki>text/html
|
|
|
|
$src$
|
|
|
|
$$$
|
2015-01-18 18:39:00 +00:00
|
|
|
</div>
|
2014-06-12 17:01:33 +00:00
|
|
|
\end
|
|
|
|
|
|
|
|
\define wikitext-example-without-html(src)
|
2015-01-18 18:39:00 +00:00
|
|
|
<div class="doc-example">
|
|
|
|
|
2017-12-16 10:58:33 +00:00
|
|
|
<$macrocall $name="copy-to-clipboard-above-right" src=<<__src__>>/>
|
|
|
|
|
2014-06-12 17:01:33 +00:00
|
|
|
```
|
|
|
|
$src$
|
|
|
|
```
|
|
|
|
|
2015-01-18 18:39:00 +00:00
|
|
|
That renders as:
|
2014-06-12 17:01:33 +00:00
|
|
|
|
2021-03-09 18:11:36 +00:00
|
|
|
$$$text/vnd.tiddlywiki
|
2014-06-12 17:01:33 +00:00
|
|
|
$src$
|
2021-03-09 18:11:36 +00:00
|
|
|
$$$
|
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
|
|
|
|
2022-01-23 09:44:01 +00:00
|
|
|
\define wikitext-example-table-header() <thead><tr><th/><th>wiki text</th><th>renders as</th></tr></thead>
|
|
|
|
|
|
|
|
\define wikitext-example-table-row(id, code)
|
|
|
|
<tr>
|
|
|
|
<th><<__id__>></th><td><$codeblock code=<<__code__>>/></td><td>
|
|
|
|
|
|
|
|
<<__code__>>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
\end
|
|
|
|
|
2015-01-11 10:55:22 +00:00
|
|
|
\define 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
|
|
|
|
|
|
|
|
\define tw-code-link(tiddler)
|
|
|
|
[[$tiddler$]]:
|
|
|
|
|
|
|
|
<<tw-code $tiddler$>>
|
2022-03-02 17:36:53 +00:00
|
|
|
\end
|