mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-15 06:47:25 +00:00
Dynannotate: Add example of view template usage
This commit is contained in:
29
plugins/tiddlywiki/dynannotate/examples/viewtemplate.tid
Normal file
29
plugins/tiddlywiki/dynannotate/examples/viewtemplate.tid
Normal file
@@ -0,0 +1,29 @@
|
||||
title: $:/plugins/tiddlywiki/dynannotate/examples/viewtemplate
|
||||
tags: $:/tags/dynannotateExamples
|
||||
caption: View Template
|
||||
|
||||
<div class="tc-dynannotation-example-info">
|
||||
|
||||
!! Using Dynannotate in the view template
|
||||
|
||||
This example shows how to override the core view template with a custom template that includes dynannotate. It is disabled by default but can be enabled by clicking the button below. (Clicking the button below copies the custom view template from $:/plugins/tiddlywiki/dynannotate/examples/viewtemplate/text to $:/core/ui/ViewTemplate/body).
|
||||
|
||||
Once enabled, this example demonstrates several features:
|
||||
|
||||
* Highlighting of search results within tiddler bodies
|
||||
* Creating annotations on any tiddler by selecting text and then clicking a colour in the resulting dropdown
|
||||
|
||||
</div>
|
||||
|
||||
<$button>
|
||||
<$action-setfield $tiddler="$:/core/ui/ViewTemplate/body" $field="text" $value={{$:/plugins/tiddlywiki/dynannotate/examples/viewtemplate/text}}/>
|
||||
<$action-setfield $tiddler="$:/core/ui/ViewTemplate/body" $field="tags" $value="$:/tags/ViewTemplate"/>
|
||||
Click here to use the custom view template
|
||||
</$button>
|
||||
|
||||
<$button>
|
||||
<$action-deletetiddler $tiddler="$:/core/ui/ViewTemplate/body"/>
|
||||
Click here to revert to the core view template
|
||||
</$button>
|
||||
|
||||
<$codeblock code={{$:/plugins/tiddlywiki/dynannotate/examples/viewtemplate/text}}/>
|
||||
Reference in New Issue
Block a user