1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-10 11:59:58 +00:00

Clarify toc-tabbed macro

This commit is contained in:
Jermolene 2014-11-15 12:29:46 +00:00
parent 21cc5fc1d6
commit 48052130d2
3 changed files with 17 additions and 9 deletions

View File

@ -162,7 +162,7 @@ tags: $:/tags/Macro
[all[current]field:title{$selectedTiddler$}]
\end
\define toc-tabbed(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText)
\define toc-tabbed-external-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText)
<$tiddler tiddler={{$selectedTiddler$}}>
<div class="tc-tabbed-table-of-contents">
<$linkcatcher to="$selectedTiddler$">
@ -180,7 +180,7 @@ tags: $:/tags/Macro
\define toc-tabbed-internal-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText)
<$linkcatcher to="""$selectedTiddler$""">
<$macrocall $name="toc-tabbed" tag="""$tag$""" sort="""$sort$""" selectedTiddler="""$selectedTiddler$""" unselectedText="""$unselectedText$"""/>
<$macrocall $name="toc-tabbed-external-nav" tag="""$tag$""" sort="""$sort$""" selectedTiddler="""$selectedTiddler$""" unselectedText="""$unselectedText$"""/>
</$linkcatcher>
\end

View File

@ -0,0 +1,3 @@
title: TabbedExampleType
toc-tabbed-internal-nav

View File

@ -10,18 +10,23 @@ The tabbed table of contents macro renders a selective expandable table of conte
This example shows how to construct a tabbed table of contents with internal navigation, so that clicking links in the displayed tiddler will replace the displayed tiddler.
<$macrocall $name='wikitext-example-without-html'
src='<<toc-tabbed-internal-nav tag:"TableOfContents" selectedTiddler:"$:/temp/toc/selectedTiddler" unselectedText:"Select a topic in the table of contents. Click the arrow to expand a topic.">>
'/>
```
<<toc-tabbed-internal-nav tag:"TableOfContents" selectedTiddler:"$:/temp/toc/selectedTiddler" unselectedText:"Select a topic in the table of contents. Click the arrow to expand a topic.">>
```
!!! External navigation
This example shows how to construct a tabbed table of contents with external navigation, so that clicking links in the displayed tiddler will open those tiddlers in the story river in the usual way.
<$macrocall $name='wikitext-example-without-html'
src='<<toc-tabbed tag:"TableOfContents" selectedTiddler:"$:/temp/toc/selectedTiddler" unselectedText:"Select a topic in the table of contents. Click the arrow to expand a topic.">>
```
<<toc-tabbed-external-nav tag:"TableOfContents" selectedTiddler:"$:/temp/toc/selectedTiddler" unselectedText:"Select a topic in the table of contents. Click the arrow to expand a topic.">>
```
'/>
!! Example
Type: <$select tiddler="TabbedExampleType">
<option value="toc-tabbed-internal-nav">Open tiddler links internally (toc-tabbed-internal-nav)</option>
<option value="toc-tabbed-external-nav">Open tiddler links externally (toc-tabbed-external-nav)</option>
</$select>
<$macrocall $name={{TabbedExampleType}} tag="TableOfContents" selectedTiddler="$:/temp/toc/selectedTiddler" unselectedText="Select a topic in the table of contents. Click the arrow to expand a topic."/>