mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-17 23:34:50 +00:00
f0bd06b38d
* Added macros for displaying wikitext examples in a table * Added documentation for WikiText parsing * Changed recognize to British spelling * Add links to the new wikitext parser tiddlers
66 lines
1.0 KiB
Plaintext
66 lines
1.0 KiB
Plaintext
created: 20150117184156000
|
|
modified: 20220122143551571
|
|
tags: $:/tags/Macro
|
|
title: $:/editions/tw5.com/wikitext-macros
|
|
type: text/vnd.tiddlywiki
|
|
|
|
\define wikitext-example(src)
|
|
<div class="doc-example">
|
|
|
|
<$macrocall $name="copy-to-clipboard-above-right" src=<<__src__>>/>
|
|
|
|
```
|
|
$src$
|
|
```
|
|
|
|
That renders as:
|
|
|
|
$$$text/vnd.tiddlywiki
|
|
$src$
|
|
$$$
|
|
|
|
... and the underlying HTML is:
|
|
|
|
$$$text/vnd.tiddlywiki>text/html
|
|
$src$
|
|
$$$
|
|
</div>
|
|
\end
|
|
|
|
\define wikitext-example-without-html(src)
|
|
<div class="doc-example">
|
|
|
|
<$macrocall $name="copy-to-clipboard-above-right" src=<<__src__>>/>
|
|
|
|
```
|
|
$src$
|
|
```
|
|
|
|
That renders as:
|
|
|
|
$$$text/vnd.tiddlywiki
|
|
$src$
|
|
$$$
|
|
</div>
|
|
\end
|
|
|
|
\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
|
|
|
|
\define tw-code(tiddler)
|
|
<$codeblock language={{$tiddler$!!type}} code={{$tiddler$}}/>
|
|
\end
|
|
|
|
\define tw-code-link(tiddler)
|
|
[[$tiddler$]]:
|
|
|
|
<<tw-code $tiddler$>>
|
|
\end |