mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-18 07:44:51 +00:00
97fd1330d6
Thanks to @BramChen for the suggestion: https://github.com/Jermolene/TiddlyWiki5/issues/1697#issuecomment-990092 50
33 lines
931 B
Plaintext
33 lines
931 B
Plaintext
title: $:/core/macros/tabs
|
|
tags: $:/tags/Macro
|
|
|
|
\define tabs(tabsList,default,state:"$:/state/tab",class,template)
|
|
<div class="tc-tab-set $class$">
|
|
<div class="tc-tab-buttons $class$">
|
|
<$list filter="$tabsList$" variable="currentTab">
|
|
<$button set=<<qualify "$state$">> setTo=<<currentTab>> default="$default$" selectedClass="tc-tab-selected">
|
|
<$set name="tv-wikilinks" value="no">
|
|
<$transclude tiddler=<<currentTab>> field="caption">
|
|
<$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/>
|
|
</$transclude>
|
|
</$set>
|
|
</$button>
|
|
</$list>
|
|
</div><div class="tc-tab-divider $class$"/><div class="tc-tab-content $class$">
|
|
<$list filter="$tabsList$" variable="currentTab">
|
|
|
|
<$reveal type="match" state=<<qualify "$state$">> text=<<currentTab>> default="$default$">
|
|
|
|
<$transclude tiddler="$template$" mode="block">
|
|
|
|
<$transclude tiddler=<<currentTab>> mode="block"/>
|
|
|
|
</$transclude>
|
|
|
|
</$reveal>
|
|
|
|
</$list>
|
|
</div>
|
|
</div>
|
|
\end
|