mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-04-13 22:33:18 +00:00
Refine preliminary list macro
@pmario: I’ve taken your suggestion and made the HTML element type(s) be macro parameters.
This commit is contained in:
parent
813bd2fe1d
commit
1b0eec143e
@ -1,14 +1,14 @@
|
||||
title: $:/core/macros/list
|
||||
tags: $:/tags/Macro
|
||||
|
||||
\define list-unordered-links(filter)
|
||||
<ul>
|
||||
\define list-links(filter,type:"ul",subtype:"li")
|
||||
<$type$>
|
||||
<$list filter="$filter$">
|
||||
<li>
|
||||
<$subtype$>
|
||||
<$link to={{!!title}}>
|
||||
<$view field="title"/>
|
||||
</$link>
|
||||
</li>
|
||||
</$subtype$>
|
||||
</$list>
|
||||
</ul>
|
||||
</$type$>
|
||||
\end
|
||||
|
@ -11,4 +11,4 @@ type: text/vnd.tiddlywiki
|
||||
|
||||
Die folgenden Elemente sind im TW Kern enthalten:
|
||||
|
||||
<<list-unordered-links "[tag[WikiText]]">>
|
||||
<<list-links "[tag[WikiText]]">>
|
||||
|
@ -6,4 +6,4 @@ type: text/vnd.tiddlywiki
|
||||
|
||||
Information about the making of TiddlyWiki:
|
||||
|
||||
<<list-unordered-links "[tag[About]]">>
|
||||
<<list-links "[tag[About]]">>
|
||||
|
@ -3,4 +3,4 @@ tags: Reference
|
||||
|
||||
Commands are used with [[TiddlyWiki on Node.js|Using TiddlyWiki on Node.js]].
|
||||
|
||||
<list-unordered-links "[tag[Commands]]">>
|
||||
<list-links "[tag[Commands]]">>
|
||||
|
@ -6,4 +6,4 @@ tags: Reference
|
||||
|
||||
These are the concepts underlying TiddlyWiki. Understanding how these ideas fit together is the key to getting the most from TiddlyWiki.
|
||||
|
||||
<<list-unordered-links "[tag[Concepts]]">>
|
||||
<<list-links "[tag[Concepts]]">>
|
||||
|
@ -11,6 +11,6 @@ Filters are used in TiddlyWiki to choose tiddlers by specifying simple match cri
|
||||
|
||||
The most common filter operators are:
|
||||
|
||||
<<list-unordered-links "[tag[CommonFilters]]">>
|
||||
<<list-links "[tag[CommonFilters]]">>
|
||||
|
||||
See FilterOperators for a complete list of available filter operators
|
||||
|
@ -14,5 +14,5 @@ You can write your own [[Macros in WikiText]] or for more flexibility you can wr
|
||||
|
||||
The following macros are built-in to the TiddlyWiki core:
|
||||
|
||||
<<list-unordered-links "[tag[Macros]]">>
|
||||
<<list-links "[tag[Macros]]">>
|
||||
|
||||
|
@ -8,4 +8,4 @@ Widget messages are generated by widgets in response to user actions. They flow
|
||||
|
||||
The following widget messages are implemented by the core:
|
||||
|
||||
<<list-unordered-links "[tag[Messages]]">>
|
||||
<<list-links "[tag[Messages]]">>
|
||||
|
@ -8,4 +8,4 @@ type: text/vnd.tiddlywiki
|
||||
|
||||
The following elements of WikiText syntax are built into the core:
|
||||
|
||||
<<list-unordered-links "[tag[WikiText]]">>
|
||||
<<list-links "[tag[WikiText]]">>
|
||||
|
@ -6,4 +6,4 @@ tags: Reference
|
||||
|
||||
These are definitions of technical words and phrases used in this documentation. (As distinct from the [[Concepts]] that make up TiddlyWiki itself).
|
||||
|
||||
<<list-unordered-links "[tag[Definitions]]">>
|
||||
<<list-links "[tag[Definitions]]">>
|
||||
|
@ -4,8 +4,8 @@ tags: table-of-contents-example
|
||||
|
||||
!! Expandable Table of Contents
|
||||
|
||||
<$macrocall $name="wikitext-example-without-html"
|
||||
src="<div class='tc-table-of-contents'>
|
||||
<<toc-expandable 'Contents'>>
|
||||
<$macrocall $name='wikitext-example-without-html'
|
||||
src='<div class="tc-table-of-contents">
|
||||
<<toc-expandable "Contents">>
|
||||
</div>
|
||||
"/>
|
||||
'/>
|
||||
|
@ -4,8 +4,8 @@ tags: table-of-contents-example
|
||||
|
||||
!! Selective Expandable Table of Contents
|
||||
|
||||
<$macrocall $name="wikitext-example-without-html"
|
||||
src="<div class='tc-table-of-contents'>
|
||||
<<toc-selective-expandable 'Contents'>>
|
||||
<$macrocall $name='wikitext-example-without-html'
|
||||
src='<div class="tc-table-of-contents">
|
||||
<<toc-selective-expandable "Contents">>
|
||||
</div>
|
||||
"/>
|
||||
'/>
|
||||
|
@ -4,8 +4,8 @@ tags: table-of-contents-example
|
||||
|
||||
!! Simple Table of Contents
|
||||
|
||||
<$macrocall $name="wikitext-example-without-html"
|
||||
src="<div class='tc-table-of-contents'>
|
||||
<<toc 'Contents'>>
|
||||
<$macrocall $name='wikitext-example-without-html'
|
||||
src='<div class="tc-table-of-contents">
|
||||
<<toc "Contents">>
|
||||
</div>
|
||||
"/>
|
||||
'/>
|
||||
|
@ -4,8 +4,8 @@ tags: table-of-contents-example
|
||||
|
||||
!! Sorted Expandable Table of Contents
|
||||
|
||||
<$macrocall $name="wikitext-example-without-html"
|
||||
src="<div class='tc-table-of-contents'>
|
||||
<<toc-expandable 'Contents' 'sort[title]'>>
|
||||
<$macrocall $name='wikitext-example-without-html'
|
||||
src='<div class="tc-table-of-contents">
|
||||
<<toc-expandable "Contents" "sort[title]">>
|
||||
</div>
|
||||
"/>
|
||||
'/>
|
||||
|
@ -9,4 +9,4 @@ TiddlyWiki is distributed in several different editions that are tuned for speci
|
||||
|
||||
You can mix and match the components of these editions, to make a unique solution to your particular application.
|
||||
|
||||
<<list-unordered-links "[tag[Editions]]">>
|
||||
<<list-links "[tag[Editions]]">>
|
||||
|
@ -10,7 +10,7 @@ type: text/vnd.tiddlywiki
|
||||
|
||||
Further information about specific TiddlyWiki features:
|
||||
|
||||
<<list-unordered-links "[tag[Features]]">>
|
||||
<<list-links "[tag[Features]]">>
|
||||
|
||||
----
|
||||
|
||||
|
@ -7,4 +7,4 @@ type: text/vnd.tiddlywiki
|
||||
|
||||
Learn more about using TiddlyWiki:
|
||||
|
||||
<<list-unordered-links "[tag[Learning]]">>
|
||||
<<list-links "[tag[Learning]]">>
|
||||
|
27
editions/tw5.com/tiddlers/macros/ListMacro.tid
Normal file
27
editions/tw5.com/tiddlers/macros/ListMacro.tid
Normal file
@ -0,0 +1,27 @@
|
||||
title: ListMacro
|
||||
tags: Macros
|
||||
modified: 20140917083515996
|
||||
caption: list
|
||||
|
||||
The list macro is a family of macros that produce a list of tiddlers.
|
||||
|
||||
There are several variants of the macro:
|
||||
|
||||
* `<<list-links>>` produces a list of links to tiddlers that match a filter expression
|
||||
|
||||
! Parameters
|
||||
|
||||
|!Position |!Name |!Description |!Default |
|
||||
|1st |filter |Filter expression | |
|
||||
|2nd |type |HTML tag to be used for the list wrapper |"ul" |
|
||||
|3rd |subtype |HTML tag to be used for list entries |"li" |
|
||||
|
||||
! Examples
|
||||
|
||||
<$macrocall $name='wikitext-example-without-html'
|
||||
src='<<list-links filter:"[tag[HelloThere]]">>
|
||||
'/>
|
||||
|
||||
<$macrocall $name='wikitext-example-without-html'
|
||||
src='<<list-links filter:"[tag[HelloThere]]" type:"ol">>
|
||||
'/>
|
@ -26,10 +26,6 @@ To restrict the timeline to a particular tag, the subfilter can be set to someth
|
||||
|
||||
! Examples
|
||||
|
||||
```
|
||||
<<timeline limit:30 format:"DD/MM/YYYY">>
|
||||
```
|
||||
|
||||
Renders as:
|
||||
|
||||
<<timeline limit:30 format:"DD/MM/YYYY">>
|
||||
<$macrocall $name="wikitext-example-without-html"
|
||||
src="<<timeline limit:30 format:'DD/MM/YYYY'>>
|
||||
"/>
|
||||
|
@ -7,4 +7,4 @@ type: text/vnd.tiddlywiki
|
||||
|
||||
These are the internal mechanisms that fit together to make up TiddlyWiki.
|
||||
|
||||
<<list-unordered-links "[tag[Mechanisms]]">>
|
||||
<<list-links "[tag[Mechanisms]]">>
|
||||
|
@ -7,4 +7,4 @@ list: Concepts Definitions WikiText Macros Widgets Filters Messages Commands Mec
|
||||
|
||||
The following topics provide the canonical reference documentation for TiddlyWiki:
|
||||
|
||||
<<list-unordered-links "[tag[Reference]]">>
|
||||
<<list-links "[tag[Reference]]">>
|
||||
|
@ -6,4 +6,4 @@ type: text/vnd.tiddlywiki
|
||||
|
||||
Available methods for saving changes with TiddlyWiki:
|
||||
|
||||
<<list-unordered-links "[tag[Saving]]">>
|
||||
<<list-links "[tag[Saving]]">>
|
||||
|
@ -7,4 +7,4 @@ type: text/vnd.tiddlywiki
|
||||
|
||||
Information to help you get started using TiddlyWiki:
|
||||
|
||||
<<list-unordered-links "[tag[Working with TiddlyWiki]]">>
|
||||
<<list-links "[tag[Working with TiddlyWiki]]">>
|
||||
|
@ -6,4 +6,4 @@ type: text/vnd.tiddlywiki
|
||||
|
||||
The following TiddlyWiki videos are available
|
||||
|
||||
<<list-unordered-links "[tag[Videos]]">>
|
||||
<<list-links "[tag[Videos]]">>
|
||||
|
@ -8,4 +8,4 @@ Widgets add dynamic functionality to WikiText.
|
||||
|
||||
The following widgets are built into the core:
|
||||
|
||||
<<list-unordered-links "[tag[Widgets]]">>
|
||||
<<list-links "[tag[Widgets]]">>
|
||||
|
@ -26,4 +26,4 @@ See [[HTML in WikiText]] for more details.
|
||||
|
||||
The available widgets include:
|
||||
|
||||
<<list-unordered-links "[tag[Widgets]]">>
|
||||
<<list-links "[tag[Widgets]]">>
|
||||
|
Loading…
x
Reference in New Issue
Block a user