Skip to content

Instantly share code, notes, and snippets.

@Jermolene
Last active February 7, 2017 18:01
Show Gist options
  • Save Jermolene/8377452 to your computer and use it in GitHub Desktop.
Save Jermolene/8377452 to your computer and use it in GitHub Desktop.
Modified tabs macro for TiddlyWiki5 including link to the tab tiddler.Second version added to work with Firefox
\define tabs(tabsList,default,state:"$:/state/tab")
<div class="tc-tab-buttons"><$list filter="$tabsList$" variable="currentTab"><$button set=<<qualify "$state$">> setTo=<<currentTab>> default="$default$" selectedClass="tc-tab-selected"><$view tiddler=<<currentTab>> field="caption"><$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/></$view> <$link to=<<currentTab>>>&hellip;</$link> </$button>
</$list>
</div>
<div class="tc-tab-divider">
</div>
<div class="tc-tab-content">
<$list filter="$tabsList$" variable="currentTab">
<$reveal type="match" state=<<qualify "$state$">> text=<<currentTab>> default="$default$">
<$transclude tiddler=<<currentTab>>/>
</$reveal>
</$list>
</div>
\end
\define tabs(tabsList,default,state:"$:/state/tab")
<div class="tc-tab-buttons"><$list filter="$tabsList$" variable="currentTab"><$button set=<<qualify "$state$">> setTo=<<currentTab>> default="$default$" selectedClass="tc-tab-selected"><$view tiddler=<<currentTab>> field="caption"><$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/></$view> </$button> <$link to=<<currentTab>>>&hellip;</$link>
</$list>
</div>
<div class="tc-tab-divider">
</div>
<div class="tc-tab-content">
<$list filter="$tabsList$" variable="currentTab">
<$reveal type="match" state=<<qualify "$state$">> text=<<currentTab>> default="$default$">
<$transclude tiddler=<<currentTab>>/>
</$reveal>
</$list>
</div>
\end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment