mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-04 23:39:57 +00:00
0a03ac8219
See #8683
38 lines
1.3 KiB
Plaintext
38 lines
1.3 KiB
Plaintext
title: $:/core/macros/diff
|
|
tags: $:/tags/Macro
|
|
|
|
\whitespace trim
|
|
|
|
\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>
|
|
</$set>
|
|
\end
|
|
|
|
\procedure compareTiddlers(sourceTiddlerTitle,sourceSubTiddlerTitle,destTiddlerTitle,destSubTiddlerTitle,exclude)
|
|
<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
|