1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-02-19 20:40:02 +00:00

docs: update

This commit is contained in:
lin onetwo 2024-08-24 13:31:55 +08:00
parent 55d205dd38
commit 4a76079594
2 changed files with 5 additions and 8 deletions

View File

@ -9,13 +9,7 @@ This guide will tell you how to add new [[cascade|https://tiddlywiki.com/#Cascad
!!! The default template as a fallback
(omitted here, see the latest version on [ext[Github|https://github.com/TiddlyWiki/TiddlyWiki5/blob/master/core/ui/ViewTemplate/tags/default.tid]])
```tid
title: $:/core/ui/ViewTemplate/tags/default
<!-- Omitted -->
```
[[$:/core/ui/ViewTemplate/tags/default]]
!!! Transclusion of current active template

View File

@ -30,6 +30,9 @@ and a listener is registered at the store which executes the refresh function of
[[Techniques for including other tiddlers and Templates|Transclusion and TextReference]] are finally used in [[$:/core/ui/PageTemplate]] to build the TiddlyWiki UI only from tiddlers written in WikiText (with widgets implemented in javascript):
For example to implement the list of open wiki pages the [[$:/core/ui/PageTemplate]] contains a [[navigator widget|$:/core/modules/widgets/navigator.js]] which maintains a list of open tiddlers in a field of [[$:/StoryList]] and handles events like ``tm-navigate`` by adding a tiddler specified as parameter to the top of the list in [[$:/StoryList]].
The [[story tiddler|$:/core/ui/PageTemplate/story]] transcluded in [[$:/core/ui/PageTemplate]] then uses a ~ListWidget to transclude all tiddlers in [[$:/StoryList]] through a special template [[$:/core/ui/ViewTemplate]]. All view template can be further override using [[Cascade Mechanism]].
The [[story tiddler|$:/core/ui/PageTemplate/story]] transcluded in [[$:/core/ui/PageTemplate]] then uses a ~ListWidget to transclude all tiddlers in [[$:/StoryList]] through a special template [[$:/core/ui/ViewTemplate]].
The ViewTemplate here is a combination of different fragments, like title fragment and body fragment, each fragment can be override individually using [[Cascade Mechanism|How to Create a Custom Cascade Entry]].
A event of the type ``tm-close-tiddler`` would remove a specified tiddler from [[$:/StoryList]].
The [[Event Mechanism]] would trigger a changed event which triggers a call of the ~ListWidget's refresh function which would remove the tiddler from the list, closing the tiddler.