1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-02 16:16:18 +00:00
TiddlyWiki5/core/wiki/macros/diff.tid

38 lines
1.3 KiB
Plaintext
Raw Normal View History

title: $:/core/macros/diff
tags: $:/tags/Macro $:/tags/Global
\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
2018-04-03 16:50:36 +00:00
\procedure compareTiddlers(sourceTiddlerTitle,sourceSubTiddlerTitle,destTiddlerTitle,destSubTiddlerTitle,exclude)
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>
<$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>>>&#32;</$diff-text>
</$set>
</$set>
</td>
</tr>
</$list>
</$set>
</$set>
</tbody>
2018-04-03 16:50:36 +00:00
</table>
\end