mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-04 04:43:52 +00:00
Start adding tests for palette operations
This commit is contained in:
parent
0fd5b04b9a
commit
8957424e55
@ -34,6 +34,7 @@ tags: $:/tags/Macro
|
||||
\end actions-compile-palette-wikified
|
||||
|
||||
\procedure actions-compile-palette(inputTitle,outputTitle,defaultImport="$:/palettes/Vanilla")
|
||||
\procedure tv-action-refresh-policy() always
|
||||
<$let
|
||||
tempPalette="$:/temp/palette-source"
|
||||
>
|
||||
@ -63,6 +64,7 @@ tags: $:/tags/Macro
|
||||
\end actions-compile-palette
|
||||
|
||||
\procedure actions-recompile-current-palette()
|
||||
\procedure tv-action-refresh-policy() always
|
||||
<$transclude $variable="actions-compile-palette" inputTitle={{$:/palette}} outputTitle="$:/temp/palette-colours"/>
|
||||
\end actions-recompile-current-palette
|
||||
|
||||
@ -70,7 +72,7 @@ tags: $:/tags/Macro
|
||||
\procedure tv-action-refresh-policy() always
|
||||
<$action-deletetiddler $tiddler="$:/temp/palette-colours"/>
|
||||
<$action-setfield $tiddler="$:/palette" $field="text" $value=<<paletteTitle>>/>
|
||||
<$transclude $variable="actions-compile-palette" inputTitle=<<paletteTitle>> outputTitle="$:/temp/palette-colours"/>
|
||||
<<actions-recompile-current-palette>>
|
||||
\end actions-switch-colour-palette
|
||||
|
||||
\procedure tv-palette-name() $:/temp/palette-colours
|
||||
|
45
editions/test/tiddlers/tests/data/palettes/BasicLookup.tid
Normal file
45
editions/test/tiddlers/tests/data/palettes/BasicLookup.tid
Normal file
@ -0,0 +1,45 @@
|
||||
|
||||
title: Operators/Palettes/BasicLookup
|
||||
description: Compute the
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||
<<colour page-background>>
|
||||
<<colour background>>
|
||||
+
|
||||
title: Actions
|
||||
|
||||
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||
<<actions-recompile-current-palette>>
|
||||
+
|
||||
title: $:/palette
|
||||
|
||||
MyPalette
|
||||
+
|
||||
title: MyPalette
|
||||
name: My Palette
|
||||
description: My custom palette
|
||||
tags: $:/tags/Palette
|
||||
type: application/x-tiddler-dictionary
|
||||
palette-import: MyOtherPalette
|
||||
color-scheme: light
|
||||
|
||||
page-background: <<colour custom>>
|
||||
custom: #f4e4d4
|
||||
+
|
||||
title: MyOtherPalette
|
||||
name: My Other Palette
|
||||
description: My other custom palette
|
||||
tags: $:/tags/Palette
|
||||
type: application/x-tiddler-dictionary
|
||||
color-scheme: light
|
||||
|
||||
page-background: #d4e4f4
|
||||
background: red
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>#f4e4d4</p><p>red</p>
|
Loading…
x
Reference in New Issue
Block a user