mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-24 18:47:20 +00:00
6701683ddf
* adding trim: large macros and languageswitcher * adding trim: KeyboardShortcuts.tid * Hidden space to force some macros to be inline This'll be our little secret. This single byte will actually allow the uglifier to trim over thirty bytes while condensing. I know I'm not supposed to optimize TW for some 3rd party plugin, but I'm the one doing the whitespace trim work, so I'll give myself this. * More consistent nested quoting
38 lines
1.3 KiB
Plaintext
38 lines
1.3 KiB
Plaintext
title: $:/core/macros/diff
|
|
tags: $:/tags/Macro
|
|
|
|
\define compareTiddlerText(sourceTiddlerTitle,sourceSubTiddlerTitle,destTiddlerTitle,destSubTiddlerTitle)
|
|
\whitespace trim
|
|
<$set name="source" tiddler=<<__sourceTiddlerTitle__>> subtiddler=<<__sourceSubTiddlerTitle__>>>
|
|
<$set name="dest" tiddler=<<__destTiddlerTitle__>> subtiddler=<<__destSubTiddlerTitle__>>>
|
|
<$diff-text source=<<source>> dest=<<dest>>/>
|
|
</$set>
|
|
</$set>
|
|
\end
|
|
|
|
\define compareTiddlers(sourceTiddlerTitle,sourceSubTiddlerTitle,destTiddlerTitle,destSubTiddlerTitle,exclude)
|
|
\whitespace trim
|
|
<table class="tc-diff-tiddlers">
|
|
<tbody>
|
|
<$set name="sourceFields" filter="[<__sourceTiddlerTitle__>fields[]sort[]]">
|
|
<$set name="destFields" filter="[<__destSubTiddlerTitle__>subtiddlerfields<__destTiddlerTitle__>sort[]]">
|
|
<$list filter="[enlist<sourceFields>] [enlist<destFields>] -[enlist<__exclude__>] +[sort[]]" variable="fieldName">
|
|
<tr>
|
|
<th>
|
|
<$text text=<<fieldName>>/>
|
|
</th>
|
|
<td>
|
|
<$set name="source" tiddler=<<__sourceTiddlerTitle__>> subtiddler=<<__sourceSubTiddlerTitle__>> field=<<fieldName>>>
|
|
<$set name="dest" tiddler=<<__destTiddlerTitle__>> subtiddler=<<__destSubTiddlerTitle__>> field=<<fieldName>>>
|
|
<$diff-text source=<<source>> dest=<<dest>>> </$diff-text>
|
|
</$set>
|
|
</$set>
|
|
</td>
|
|
</tr>
|
|
</$list>
|
|
</$set>
|
|
</$set>
|
|
</tbody>
|
|
</table>
|
|
\end
|