1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-08 02:49:56 +00:00

Simplify tour step format

This commit is contained in:
Jeremy Ruston 2023-09-22 10:55:39 +01:00
parent ef5b3a8840
commit d460f9f066
12 changed files with 23 additions and 83 deletions

View File

@ -45,8 +45,22 @@ next
<$let
currentTour={{$:/config/CurrentTour}}
currentTourStep={{$:/state/tour/step}}
condition-var={{{ [<currentTourStep>get[condition-var]] :map[subfilter<currentTiddler>] }}}
>
<$transclude tiddler=<<currentTourStep>> mode="block"/>
<!-- Handle steps without a condition -->
<$list filter="[<currentTourStep>!has[condition]]" variable="ignore">
<$transclude tiddler=<<currentTourStep>> mode="block"/>
<<tour-buttons>>
</$list>
<!-- Handle steps that have a condition -->
<$list filter="[<currentTourStep>has[condition]]" variable="ignore">
<$transclude tiddler=<<currentTourStep>> mode="block"/>
<$list filter={{{ [<currentTourStep>get[condition]] }}} limit="1" variable="ignore">
<$confetti/>
Congratulations, you may proceed
<<tour-buttons>>
</$list>
</$list>
</$let>
<$list filter="[{$:/state/tour/step}has[selector]]" variable="ignore">
<$button class="tc-btn-big-green" style="background-color: green;">

View File

@ -1,17 +1,8 @@
title: $:/plugins/tiddlywiki/tour/introduction-to-tiddlywiki/close-control-panel
tags: $:/tags/Tour/IntroductionToTiddlyWiki
selector: .tc-story-river div[data-tiddler-title='$:/ControlPanel'] .tc-btn-\%24\%3A\%2Fcore\%2Fui\%2FButtons\%2Fclose
condition: [[$:/StoryList]!contains[$:/ControlPanel]]
! Close the control panel
Your task now is to close the control panel.
<$list filter="[[$:/StoryList]!contains[$:/ControlPanel]limit[1]]" variable="ignore">
<$confetti/>
Congratulations, you may proceed
<<tour-buttons>>
</$list>

View File

@ -2,6 +2,7 @@ title: $:/plugins/tiddlywiki/tour/introduction-to-tiddlywiki/closing-tiddlers
tags: $:/tags/Tour/IntroductionToTiddlyWiki
display-mode: fullscreen
enter-actions: <$action-setfield $tiddler="$:/temp/Tour/DemoStoryList" list="$:/plugins/tiddlywiki/tour/introduction-to-tiddlywiki/tiddlers/Jupiter $:/plugins/tiddlywiki/tour/introduction-to-tiddlywiki/tiddlers/Saturn"/>
condition: [list[$:/temp/Tour/DemoStoryList]count[]match[0]]
\define tour-simplified-tiddler-close-button() yes
@ -21,13 +22,3 @@ Try closing both these tiddlers.
/>
</$navigator>
<$list filter="[list[$:/temp/Tour/DemoStoryList]count[]match[0]]" variable="ignore">
<$confetti/>
Congratulations, you may proceed
<<tour-buttons>>
</$list>

View File

@ -3,17 +3,8 @@ tags: $:/tags/Tour/IntroductionToTiddlyWiki
selector: .tc-story-river div[data-tiddler-title="Draft of 'New Tiddler'"] input[value]:not([value="Congratulations"])
selector-fallback-1: .tc-story-river div[data-tiddler-title='Draft of \'New Tiddler\''] .tc-btn-\%24\%3A\%2Fcore\%2Fui\%2FButtons\%2Fsave
selector-fallback-2: .tc-btn-\%24\%3A\%2Fcore\%2Fui\%2FButtons\%2Fnew-tiddler
condition: [list[$:/StoryList]match[Congratulations]]
! Creating Tiddlers
Your task is to create and open a tiddler titled "Congratulations"
<$list filter="[list[$:/StoryList]match[Congratulations]]" variable="ignore">
<$confetti/>
Congratulations, you may proceed
<<tour-buttons>>
</$list>

View File

@ -9,5 +9,3 @@ Congratulations!
You have completed the first part of this tour.
Now we are going guide you through using ~TiddlyWiki.
<<tour-buttons>>

View File

@ -2,6 +2,7 @@ title: $:/plugins/tiddlywiki/tour/introduction-to-tiddlywiki/links
tags: $:/tags/Tour/IntroductionToTiddlyWiki
display-mode: fullscreen
enter-actions: <$action-setfield $tiddler="$:/temp/Tour/DemoStoryList" list="$:/plugins/tiddlywiki/tour/introduction-to-tiddlywiki/tiddlers/Jupiter"/>
condition: [[$:/temp/Tour/DemoStoryList]contains[$:/plugins/tiddlywiki/tour/introduction-to-tiddlywiki/tiddlers/Saturn]]
! How do links work in ~TiddlyWiki?
@ -19,13 +20,3 @@ Try clicking the link to "Saturn".
/>
</$navigator>
<$list filter="[[$:/temp/Tour/DemoStoryList]contains[$:/plugins/tiddlywiki/tour/introduction-to-tiddlywiki/tiddlers/Saturn]limit[1]]" variable="ignore">
<$confetti/>
Congratulations, you may proceed
<<tour-buttons>>
</$list>

View File

@ -1,17 +1,8 @@
title: $:/plugins/tiddlywiki/tour/introduction-to-tiddlywiki/open-control-panel
tags: $:/tags/Tour/IntroductionToTiddlyWiki
selector: .tc-btn-\%24\%3A\%2Fcore\%2Fui\%2FButtons\%2Fcontrol-panel
condition: [[$:/StoryList]contains[$:/ControlPanel]]
! Welcome to ~TiddlyWiki
Your task is to open the control panel.
<$list filter="[[$:/StoryList]contains[$:/ControlPanel]limit[1]]" variable="ignore">
<$confetti/>
Congratulations, you may proceed
<<tour-buttons>>
</$list>

View File

@ -2,21 +2,9 @@ title: $:/plugins/tiddlywiki/tour/introduction-to-tiddlywiki/recent
tags: $:/tags/Tour/IntroductionToTiddlyWiki
selector: .tc-sidebar-tabs-main .tc-timeline > .tc-menu-list-item:nth-child(1) .tc-menu-list-subitem:nth-child(1) .tc-tiddlylink
selector-fallback-1: .tc-sidebar-tabs-main button:nth-child(3)
condition: [list[$:/StoryList]match<condition-var>]
condition-var: [all[tiddlers]!is[system]!sort[modified]]
! Searching
Your task is to use the "Recent" tab of the sidebar to open the most recently editted tiddler.
<$let recentTiddler={{{ [all[tiddlers]!is[system]!sort[modified]] }}}>
<$list filter="[list[$:/StoryList]match<recentTiddler>]" variable="ignore">
<$confetti/>
Congratulations! You may now proceed
<<tour-buttons>>
</$list>
</$let>

View File

@ -1,17 +1,8 @@
title: $:/plugins/tiddlywiki/tour/introduction-to-tiddlywiki/search
tags: $:/tags/Tour/IntroductionToTiddlyWiki
selector: .tc-sidebar-search .tc-popup-handle
condition: [{$:/temp/search}match[help]]
! Searching
Your task is to search for the phrase "help".
<$list filter="[{$:/temp/search}match[help]]" variable="ignore">
<$confetti/>
Congratulations! You may now proceed
<<tour-buttons>>
</$list>

View File

@ -15,5 +15,3 @@ A tiddler is like an index card.
</$let>
Each tiddler must have a unique title that is used to distinguish it.
<<tour-buttons>>

View File

@ -9,5 +9,3 @@ display-mode: fullscreen
Welcome to our tour of ~TiddlyWiki.
We hope you'll find ~TiddlyWiki a helpful and supportive tool. Let's get started!
<<tour-buttons>>

View File

@ -4,5 +4,3 @@ tags: $:/tags/Tour/UsingTags
! Hello!
!! An introduction to using tags in ~TiddlyWiki
<<tour-buttons>>