mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-02 08:06:17 +00:00
070327cb57
This avoids breaking existing code that expects to be able to import the core macros with just $:/tags/Macro @pmario - I suggest that future updates use the same approach Thanks to @ericshulman for reporting the problem
38 lines
1.3 KiB
Plaintext
38 lines
1.3 KiB
Plaintext
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
|
|
|
|
\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
|