mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-02 14:29:55 +00:00
add 2 testcase examples for toc-simple
This commit is contained in:
parent
7b6c940ca7
commit
a44fb50cf7
42
editions/tw5.com/tiddlers/Examples_TOC_SimpleToc
Normal file
42
editions/tw5.com/tiddlers/Examples_TOC_SimpleToc
Normal file
@ -0,0 +1,42 @@
|
||||
title: Narrative
|
||||
|
||||
* The following code defines a "Simple Table of Contents" using "root" as the base tag.
|
||||
* Click through all the tabs to get additional info
|
||||
|
||||
{{Narrative-extended}}
|
||||
|
||||
+
|
||||
title: root
|
||||
list: First Third Fourth
|
||||
|
||||
The list-field in the "root" tag-tiddler can be used to define the "sort order" of the TOC
|
||||
+
|
||||
title: First
|
||||
tags: root
|
||||
|
||||
1st 1st 1st 1st 1st
|
||||
+
|
||||
title: Second
|
||||
tags: First
|
||||
|
||||
2nd 2nd 2nd 2nd 2nd
|
||||
+
|
||||
title: Third
|
||||
tags: root
|
||||
|
||||
3rd 3rd 3rd 3rd 3rd
|
||||
+
|
||||
title: Fourth
|
||||
caption: fourth-caption
|
||||
tags: root
|
||||
|
||||
4th 4th 4th 4th 4th
|
||||
|
||||
This tiddler contains a caption, which will be shown in the TOC instead of the tiddler title
|
||||
+
|
||||
title: Output
|
||||
|
||||
<div class="tc-table-of-contents">
|
||||
<<toc tag:"root">>
|
||||
</div>
|
||||
|
7
editions/tw5.com/tiddlers/Examples_TOC_SimpleToc.meta
Normal file
7
editions/tw5.com/tiddlers/Examples_TOC_SimpleToc.meta
Normal file
@ -0,0 +1,7 @@
|
||||
created: 20240724070813184
|
||||
description: Simple TOC
|
||||
display-format: wikitext
|
||||
modified: 20240724100513345
|
||||
tags: $:/tags/wiki-test-spec
|
||||
title: Examples/TOC/SimpleToc
|
||||
type: text/vnd.tiddlywiki-multiple
|
@ -0,0 +1,20 @@
|
||||
created: 20240724082221230
|
||||
modified: 20240724100646572
|
||||
tags:
|
||||
title: Examples/TOC/SimpleToc/captionField
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<$testcase testOutput="Output">
|
||||
|
||||
<$data title="Description" text="Simple TOC - captionField parameter"/>
|
||||
|
||||
<$data title="Narrative-extended" text="""* The "Fifth" tiddler has an alternative "caption-field" """/>
|
||||
|
||||
<$data $compound-tiddler="Examples/TOC/SimpleToc"/>
|
||||
|
||||
<$data title="Fifth" tags="Fourth" text="5th" alt="alt-caption"/>
|
||||
|
||||
<$data title="Output" text="""<div class="tc-table-of-contents">
|
||||
<<toc tag:"root" captionField:"alt">>
|
||||
</div>
|
||||
"""/>
|
@ -1,8 +0,0 @@
|
||||
code-body: yes
|
||||
created: 20240618150559884
|
||||
modified: 20240618150722129
|
||||
tags: $:/tags/Global
|
||||
title: test-tags/Global-tv-toc-show-new-child
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define tv-toc-show-new-child() yes
|
Loading…
Reference in New Issue
Block a user