mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-14 11:15:41 +00:00
Core-macro-diff-new-syntax (#7986)
* $:/core/macros/diff use v5.3.x syntax and add indentation for better readability -- all tests pass * diff - set tags: $:/tags/Global
This commit is contained in:
parent
699d8b9416
commit
a09106f33b
@ -1,37 +1,37 @@
|
|||||||
title: $:/core/macros/diff
|
title: $:/core/macros/diff
|
||||||
tags: $:/tags/Macro
|
tags: $:/tags/Global
|
||||||
|
|
||||||
\define compareTiddlerText(sourceTiddlerTitle,sourceSubTiddlerTitle,destTiddlerTitle,destSubTiddlerTitle)
|
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$set name="source" tiddler=<<__sourceTiddlerTitle__>> subtiddler=<<__sourceSubTiddlerTitle__>>>
|
|
||||||
<$set name="dest" tiddler=<<__destTiddlerTitle__>> subtiddler=<<__destSubTiddlerTitle__>>>
|
\procedure compareTiddlerText(sourceTiddlerTitle,sourceSubTiddlerTitle,destTiddlerTitle,destSubTiddlerTitle)
|
||||||
<$diff-text source=<<source>> dest=<<dest>>/>
|
<$set name="source" tiddler=<<sourceTiddlerTitle>> subtiddler=<<sourceSubTiddlerTitle>>>
|
||||||
</$set>
|
<$set name="dest" tiddler=<<destTiddlerTitle>> subtiddler=<<destSubTiddlerTitle>>>
|
||||||
|
<$diff-text source=<<source>> dest=<<dest>>/>
|
||||||
|
</$set>
|
||||||
</$set>
|
</$set>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\define compareTiddlers(sourceTiddlerTitle,sourceSubTiddlerTitle,destTiddlerTitle,destSubTiddlerTitle,exclude)
|
\procedure compareTiddlers(sourceTiddlerTitle,sourceSubTiddlerTitle,destTiddlerTitle,destSubTiddlerTitle,exclude)
|
||||||
\whitespace trim
|
|
||||||
<table class="tc-diff-tiddlers">
|
<table class="tc-diff-tiddlers">
|
||||||
<tbody>
|
<tbody>
|
||||||
<$set name="sourceFields" filter="[<__sourceTiddlerTitle__>fields[]sort[]]">
|
<$set name="sourceFields" filter="[<sourceTiddlerTitle>fields[]sort[]]">
|
||||||
<$set name="destFields" filter="[<__destSubTiddlerTitle__>subtiddlerfields<__destTiddlerTitle__>sort[]]">
|
<$set name="destFields" filter="[<destSubTiddlerTitle>subtiddlerfields<destTiddlerTitle>sort[]]">
|
||||||
<$list filter="[enlist<sourceFields>] [enlist<destFields>] -[enlist<__exclude__>] +[sort[]]" variable="fieldName">
|
<$list filter="[enlist<sourceFields>] [enlist<destFields>] -[enlist<exclude>] +[sort[]]" variable="fieldName">
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
<$text text=<<fieldName>>/>
|
<$text text=<<fieldName>>/>
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<$set name="source" tiddler=<<__sourceTiddlerTitle__>> subtiddler=<<__sourceSubTiddlerTitle__>> field=<<fieldName>>>
|
<$set name="source" tiddler=<<sourceTiddlerTitle>> subtiddler=<<sourceSubTiddlerTitle>> field=<<fieldName>>>
|
||||||
<$set name="dest" tiddler=<<__destTiddlerTitle__>> subtiddler=<<__destSubTiddlerTitle__>> field=<<fieldName>>>
|
<$set name="dest" tiddler=<<destTiddlerTitle>> subtiddler=<<destSubTiddlerTitle>> field=<<fieldName>>>
|
||||||
<$diff-text source=<<source>> dest=<<dest>>> </$diff-text>
|
<$diff-text source=<<source>> dest=<<dest>>> </$diff-text>
|
||||||
</$set>
|
</$set>
|
||||||
</$set>
|
</$set>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</$list>
|
</$list>
|
||||||
</$set>
|
</$set>
|
||||||
</$set>
|
</$set>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
\end
|
\end
|
||||||
|
Loading…
Reference in New Issue
Block a user