2018-03-16 20:38:35 +00:00
|
|
|
title: $:/core/macros/diff
|
2024-10-22 12:15:34 +00:00
|
|
|
tags: $:/tags/Macro
|
2018-03-16 20:38:35 +00:00
|
|
|
|
2022-04-01 11:09:59 +00:00
|
|
|
\whitespace trim
|
2024-02-14 18:45:11 +00:00
|
|
|
|
|
|
|
\procedure compareTiddlerText(sourceTiddlerTitle,sourceSubTiddlerTitle,destTiddlerTitle,destSubTiddlerTitle)
|
|
|
|
<$set name="source" tiddler=<<sourceTiddlerTitle>> subtiddler=<<sourceSubTiddlerTitle>>>
|
|
|
|
<$set name="dest" tiddler=<<destTiddlerTitle>> subtiddler=<<destSubTiddlerTitle>>>
|
|
|
|
<$diff-text source=<<source>> dest=<<dest>>/>
|
|
|
|
</$set>
|
2018-03-16 20:38:35 +00:00
|
|
|
</$set>
|
|
|
|
\end
|
2018-04-03 16:50:36 +00:00
|
|
|
|
2024-02-14 18:45:11 +00:00
|
|
|
\procedure compareTiddlers(sourceTiddlerTitle,sourceSubTiddlerTitle,destTiddlerTitle,destSubTiddlerTitle,exclude)
|
2018-04-03 16:50:36 +00:00
|
|
|
<table class="tc-diff-tiddlers">
|
2024-02-14 18:45:11 +00:00
|
|
|
<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>
|
2018-04-03 16:50:36 +00:00
|
|
|
</table>
|
|
|
|
\end
|