2018-03-16 20:38:35 +00:00
|
|
|
title: $:/core/macros/diff
|
|
|
|
tags: $:/tags/Macro
|
|
|
|
|
|
|
|
\define compareTiddlerText(sourceTiddlerTitle,sourceSubTiddlerTitle,destTiddlerTitle,destSubTiddlerTitle)
|
2022-04-01 11:09:59 +00:00
|
|
|
\whitespace trim
|
2018-03-16 20:38:35 +00:00
|
|
|
<$set name="source" tiddler=<<__sourceTiddlerTitle__>> subtiddler=<<__sourceSubTiddlerTitle__>>>
|
|
|
|
<$set name="dest" tiddler=<<__destTiddlerTitle__>> subtiddler=<<__destSubTiddlerTitle__>>>
|
|
|
|
<$diff-text source=<<source>> dest=<<dest>>/>
|
|
|
|
</$set>
|
|
|
|
</$set>
|
|
|
|
\end
|
2018-04-03 16:50:36 +00:00
|
|
|
|
|
|
|
\define compareTiddlers(sourceTiddlerTitle,sourceSubTiddlerTitle,destTiddlerTitle,destSubTiddlerTitle,exclude)
|
2022-04-01 11:09:59 +00:00
|
|
|
\whitespace trim
|
2018-04-03 16:50:36 +00:00
|
|
|
<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>
|
2022-04-01 11:09:59 +00:00
|
|
|
<$text text=<<fieldName>>/>
|
2018-04-03 16:50:36 +00:00
|
|
|
</th>
|
|
|
|
<td>
|
|
|
|
<$set name="source" tiddler=<<__sourceTiddlerTitle__>> subtiddler=<<__sourceSubTiddlerTitle__>> field=<<fieldName>>>
|
|
|
|
<$set name="dest" tiddler=<<__destTiddlerTitle__>> subtiddler=<<__destSubTiddlerTitle__>> field=<<fieldName>>>
|
2022-04-01 11:09:59 +00:00
|
|
|
<$diff-text source=<<source>> dest=<<dest>>> </$diff-text>
|
2018-04-03 16:50:36 +00:00
|
|
|
</$set>
|
|
|
|
</$set>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</$list>
|
|
|
|
</$set>
|
|
|
|
</$set>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
\end
|