Overhaul the macro and variable documentation #1519

This commit is contained in:
Jermolene 2015-02-24 17:41:16 +01:00
parent fdc635007b
commit b13d87fdf2
138 changed files with 1320 additions and 754 deletions

View File

@ -1,5 +1,5 @@
created: 20140216102454178
modified: 20140216102722184
modified: 20150221154036000
tags: Concepts
title: ColourPalettes
type: text/vnd.tiddlywiki
@ -14,7 +14,7 @@ table-border: #ccc
Several palettes form part of the core. The system tiddler [[$:/palette]] always contains the title of the currently selected palette tiddler.
To retrieve the value of a named colour from the current palette, e.g. for use in a stylesheet tiddler, use the [[colour macro|$:/core/macros/CSS]]:
To retrieve the value of a named colour from the current palette, e.g. for use in a stylesheet tiddler, use the <<.mlink colour>> macro:
```
<<colour page-background>>

View File

@ -1,13 +1,18 @@
created: 20130825144900000
modified: 20141012154500719
modified: 20150221215022000
tags: Concepts
title: CurrentTiddler
title: Current Tiddler
type: text/vnd.tiddlywiki
The current tiddler provides an ever-changing context or background against which several features of WikiText are interpreted.
The <<.def "current tiddler">> provides the context in which several aspects of WikiText are interpreted.
For example, `{{!!title}}` denotes the value of the ''title'' field of whatever the current tiddler happens to be. This technique can be used in a [[TemplateTiddler|TemplateTiddlers]] to keep the template generic.
For example, `{{!!title}}` denotes the value of the <<.field title>> field of whatever the current tiddler happens to be. This technique can be used to create general-purpose [[template tiddlers|TemplateTiddlers]].
The title of the current tiddler can always be found in the [[currentTiddler variable|WidgetVariable: currentTiddler]].
The title of the current tiddler can always be found in the <<.vlink currentTiddler>> variable.
The current tiddler is set in several ways, including by the ListWidget and the TiddlerWidget.
The two most common ways in which the current tiddler is changed are:
* the <<.wlink TiddlerWidget>> widget
* the <<.wlink ListWidget>> widget (when its <<.attr variable>> attribute is not overridden)
The current tiddler is therefore often <<.em not>> the same as the [[tiddler that is being viewed or edited|storyTiddler Variable]].

View File

@ -1,5 +1,5 @@
created: 20130827080000000
modified: 20150124183938000
modified: 20150221225414000
tags: Reference Concepts
title: Filters
type: text/vnd.tiddlywiki
@ -9,11 +9,9 @@ You can think of TiddlyWiki as a database in which the records are tiddlers. A d
A <<.def filter>> is a concise notation for selecting a particular [[set of tiddlers|Title Selection]], known as its <<.def "output">>. Whenever ~TiddlyWiki encounters a filter, it calculates the output. Further work can then be done with just those tiddlers, such as [[counting|CountWidget]] or [[listing|ListWidget]] them.
The following example passes a filter to the [[list-links macro|ListMacro]] to display a list of all tiddlers whose titles start with the letter H:
The following example passes a filter to the <<.mlink list-links>> macro to display a list of all tiddlers whose titles start with the letter H:
```
<<list-links "[prefix[H]]">>
```
> `<<list-links "[prefix[H]]">>`
A filter's output can change as tiddlers are added and deleted in the wiki. ~TiddlyWiki recalculates on the fly, automatically updating any filter-based counts or lists as well.

View File

@ -1,9 +1,9 @@
created: 20141228094500000
modified: 20141228094500000
modified: 20150221152956000
tags: Concepts
title: JSONTiddlers
A JSON tiddler is a [[data tiddler|DataTiddlers]] containing a [[JSON]] structure in its `text` field.
A JSON tiddler is a [[data tiddler|DataTiddlers]] containing a [[JSON|JavaScript Object Notation]] structure in its `text` field.
Its [[ContentType]] is `application/json`.

View File

@ -1,17 +1,29 @@
created: 20140211171341271
modified: 20150107121000000
modified: 20150221220245000
tags: Concepts Reference
title: Macros
type: text/vnd.tiddlywiki
Macros are snippets of text, inserted with the following shortcut syntax:
A <<.def macro>> is a named snippet of text. WikiText can use the name as a shorthand way of [[transcluding|Transclusion]] the snippet. Such transclusions are known as <<.def "macro calls">>, and each call can supply a different set of parameters that get substituted for special placeholders within the snippet.
```
<<myMacro>>
```
For the syntax, see [[Macros in WikiText]].
You can define and use [[Macros in WikiText]] or write [[JavaScript Macros|http://tiddlywiki.com/dev/index.html#JavaScript%20Macros]] for more flexibility.
Most macros are in fact just parameterised [[variables|Variables]].
The following macros are provided by the TiddlyWiki core:
They are created using the `\define` [[pragma|Pragma]]. (Behind the scenes, this is transformed into a <<.wlink SetWidget>>, i.e. macros and variables are two sides of the same coin.)
<<list-links "[tag[Macros]]">>
The snippet and its incoming parameter values are treated as simple strings of characters with no WikiText meaning, at least until the placeholders have been filled in and the macro call has returned. This means that a macro can assemble and return the complete syntax of a ~WikiText component, such as a [[link|Linking in WikiText]]. (See [[Transclusion and Substitution]] for further discussion of this.)
The string returned by a macro call is parsed separately from any surrounding ~WikiText components. So a safe way to insert a special character sequence (such as `[[` or `<`) without triggering its normal ~WikiText meaning is to wrap it in a macro.
Within a snippet itself, the only markup detected is `$name$` (a placeholder for a macro parameter) and `$(name)$` (a placeholder for a [[variable|Variables]]).
The <<.mlink dumpvariables>> macro lists all variables (including macros) that are available at that position in the widget tree.
An <<.wlink ImportVariablesWidget>> widget can be used to copy macro definitions to another branch of the [[widget tree|Widgets]]. ~TiddlyWiki uses this technique internally to implement global macros -- namely any macros defined in tiddlers with the <<.tag $:/tags/Macro>> tag.
For maximum flexibility, macros can also be [[written as JavaScript modules|http://tiddlywiki.com/dev/index.html#JavaScript%20Macros]].
A similar effect to a parameterised macro call can be produced by setting [[variables|Variables]] around a [[transclusion|Transclusion]].
~TiddlyWiki's core has [[several macros|Core Macros]] built in.

View File

@ -0,0 +1,16 @@
created: 20150219175930000
modified: 20150221215112000
tags: Concepts
title: Pragma
type: text/vnd.tiddlywiki
A <<.def pragma>> is a special component of WikiText that provides control over the way the remaining text is parsed.
Pragmas occupy lines that start with `\`. They can only appear at the start of the text, but blank lines are allowed between them. If a pragma line appears in the main body of the text, it is treated as if it was ordinary text.
The following pragmas are available:
;`\define`
: for defining a [[macro|Macros]]
;`\rules`
: for adjusting the set of rules used to parse the text

View File

@ -1,5 +1,5 @@
created: 20140107114355828
modified: 20140317213147507
modified: 20150220160920000
tags: Concepts
title: TemplateTiddlers
type: text/vnd.tiddlywiki
@ -10,8 +10,8 @@ Templates are a way to re-use chunks of WikiText.
Transcluding through a template extends the basic functionality of [[Transclusion]] by combining two tiddlers:
* A template tiddler that contains the WikiText to be displayed. It can contain transclusions that reference fields in the CurrentTiddler
* A target tiddler that identifies the CurrentTiddler to be used when resolving references to fields
* A template tiddler that contains the WikiText to be displayed. It can contain transclusions that reference fields in the [[current tiddler|Current Tiddler]]
* A target tiddler that identifies which tiddler is to be treated as current when resolving references to fields
The best example of templating is the main story river in TiddlyWiki. Each tiddler in the story river is rendered through a ViewTemplate that specifies how each field is to be rendered.

View File

@ -0,0 +1,7 @@
created: 20150221180826000
modified: 20150221181700000
tags: Definitions
title: Base64
type: text/vnd.tiddlywiki
<<.dlink-ex Base64 "http://en.wikipedia.org/wiki/Base64">> is a way of representing binary data, such an image, as a string of text.

View File

@ -0,0 +1,7 @@
created: 20150221120651000
modified: 20150221181705000
tags: Definitions
title: Cascading Style Sheets
type: text/vnd.tiddlywiki
<<.dlink-ex CSS "http://en.wikipedia.org/wiki/Cascading_Style_Sheets">> is a standard plain-text format used for defining the presentational style of the various elements on a web page.

View File

@ -0,0 +1,13 @@
created: 20150221120117000
modified: 20150221181310000
tags: Definitions
title: Comma-Separated Values
type: text/vnd.tiddlywiki
<<.dlink-ex CSV "http://en.wikipedia.org/wiki/Comma-separated_values">> is a standard plain-text format for storing a table of data.
Each row of the table is called a <<.def record>> and occupies one line.
The columns are called <<.def fields>>. Each field of a row is separated from the next by a comma, and is often delimited by quotation marks.
The <<.mlink csvtiddlers>> macro returns tiddler content in this format.

View File

@ -1,5 +1,5 @@
created: 20130828185900000
modified: 20140912145359306
modified: 20150221120839000
tags: Definitions
title: ContentType
type: text/vnd.tiddlywiki
@ -22,10 +22,8 @@ In TiddlyWiki, the `type` field gives the content type to apply to the main `tex
|~|PNG image |image/png|
|~|Structured Vector Graphics image |image/svg+xml|
|^''Text''|HTML markup |text/html|
|~|Cascading Stylesheet text |text/css|
|~|Comma-separated values |text/csv|
|~|[[CSS|Cascading Style Sheets]] stylesheet |text/css|
|~|[[Comma-separated values|Comma-Separated Values]] |text/csv|
|~|Plain text |text/plain|
|~|~TiddlyWiki 5 |text/vnd.tiddlywiki|
|~|~TiddlyWiki Classic |text/x-tiddlywiki|

View File

@ -0,0 +1,9 @@
created: 20150221161803000
modified: 20150221181711000
tags: Definitions
title: Data URI
type: text/vnd.tiddlywiki
A <<.dlink-ex "data URI" "http://en.wikipedia.org/wiki/Data_URI_scheme">> is a way of storing data (such as an image) in a way that is compatible with the addresses used by web pages and [[stylesheets|Cascading Style Sheets]] to access external resources.
The <<.mlink datauri>> macro can be used to generate data URIs within ~TiddlyWiki.

View File

@ -0,0 +1,11 @@
created: 20150221152904000
modified: 20150221181720000
tags: Definitions
title: JavaScript Object Notation
type: text/vnd.tiddlywiki
<<.dlink-ex JSON "http://en.wikipedia.org/wiki/JSON">> is a standard plain-text format used for modelling hierarchical structures of objects that contain named fields.
DataTiddlers can have JSON content.
The <<.mlink jsontiddlers>> macro returns tiddler content in JSON format.

View File

@ -1,7 +1,7 @@
title: GroupedLists
tags: ListWidget
created: 20150106180000000
modified: 20150106180000000
modified: 20150221230117000
The following sidebar tabs give examples of grouped lists created by nesting.
@ -13,6 +13,6 @@ For the [[Types|$:/core/ui/MoreSideBar/Types]] tab, the outer list filter as sho
!! Recent Tab
The list in the [[Recent|$:/core/ui/SideBar/Recent]] tab is generated using the TimelineMacro. Here, the outer list filter selects each discrete day found in the `modified` field, while the inner list filter selects all the tiddlers dated the same day in the `modified` field.
The list in the [[Recent|$:/core/ui/SideBar/Recent]] tab is generated using the <<.mlink timeline>> macro. Here, the outer list filter selects each discrete day found in the `modified` field, while the inner list filter selects all the tiddlers dated the same day in the `modified` field.
<<tw-code-link "$:/core/macros/timeline">>
<<tw-code-link "$:/core/macros/timeline">>

View File

@ -1,5 +1,8 @@
created: 20150221211420000
modified: 20150221211613000
title: SampleTabFour
tags: sampletab
caption: Four
order: 4
This is the fourth of our sample tabs.

View File

@ -1,5 +1,6 @@
created: 20150221211544000
title: SampleTabOne
tags: sampletab
order: 1
This is the first of our sample tabs.

View File

@ -1,5 +1,6 @@
created: 20150221211557000
title: SampleTabThree
tags: sampletab
order: 3
This is the third of our sample tabs.

View File

@ -1,5 +1,6 @@
created: 20150221211552000
title: SampleTabTwo
tags: sampletab
order: 2
This is the second of our sample tabs.

View File

@ -1,6 +1,6 @@
created: 20150221194324000
modified: 20150221194606000
title: Contents
list: First Second Third Fourth
Sample data for TableOfContentsMacro.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<<.toc-lorem>>

View File

@ -1,5 +1,7 @@
created: 20150221194349000
modified: 20150221194610000
title: First
tags: Contents
list: FirstOne FirstTwo FirstThree
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<<.toc-lorem>>

View File

@ -1,4 +1,6 @@
created: 20150221194354000
modified: 20150221194613000
title: FirstOne
tags: First
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<<.toc-lorem>>

View File

@ -1,4 +1,6 @@
created: 20150221194357000
modified: 20150221194616000
title: FirstThree
tags: First
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<<.toc-lorem>>

View File

@ -1,4 +1,6 @@
created: 20150221194401000
modified: 20150221194619000
title: FirstTwo
tags: First
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<<.toc-lorem>>

View File

@ -1,4 +1,6 @@
created: 20150221194405000
modified: 20150221194622000
title: Fourth
tags: Contents
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<<.toc-lorem>>

View File

@ -1,4 +1,6 @@
created: 20150221194408000
modified: 20150221194624000
title: Second
tags: Contents
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<<.toc-lorem>>

View File

@ -1,4 +1,6 @@
created: 20150221194412000
modified: 20150221194627000
title: SecondOne
tags: Second
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<<.toc-lorem>>

View File

@ -1,6 +1,8 @@
created: 20150221194416000
modified: 20150221194630000
title: SecondThree
tags: Second
list: SecondThreeOne SecondThreeTwo SecondThreeThree
toc-link: no
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<<.toc-lorem>>

View File

@ -1,4 +1,6 @@
created: 20150221194420000
modified: 20150221194633000
title: SecondThreeOne
tags: SecondThree
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<<.toc-lorem>>

View File

@ -1,4 +1,6 @@
created: 20150221194423000
modified: 20150221194635000
title: SecondThreeThree
tags: SecondThree
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<<.toc-lorem>>

View File

@ -1,4 +1,6 @@
created: 20150221194429000
modified: 20150221194638000
title: SecondThreeTwo
tags: SecondThree
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<<.toc-lorem>>

View File

@ -1,4 +1,6 @@
created: 20150221194433000
modified: 20150221194643000
title: SecondTwo
tags: Second
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<<.toc-lorem>>

View File

@ -1,5 +1,7 @@
created: 20150221194436000
modified: 20150221194646000
title: Third
tags: Contents
list: ThirdOne ThirdTwo ThirdThree
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<<.toc-lorem>>

View File

@ -1,4 +1,6 @@
created: 20150221194440000
modified: 20150221194649000
title: ThirdOne
tags: Third
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<<.toc-lorem>>

View File

@ -1,4 +1,6 @@
created: 20150221194446000
modified: 20150221194652000
title: ThirdThree
tags: Third
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<<.toc-lorem>>

View File

@ -1,4 +1,6 @@
created: 20150221194453000
modified: 20150221194655000
title: ThirdTwo
tags: Third
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<<.toc-lorem>>

View File

@ -1,11 +1,11 @@
title: TableOfContentsMacro Expandable Example
created: 20150221201816000
modified: 20150221203715000
title: Example Table of Contents: Expandable
caption: Expandable
tags: table-of-contents-example
order: 2
!! Expandable Table of Contents
<$macrocall $name='wikitext-example-without-html'
src='<div class="tc-table-of-contents">
<$macrocall $name=".example" n="1"
eg="""<div class="tc-table-of-contents">
<<toc-expandable "Contents">>
</div>
'/>
</div>"""/>

View File

@ -1,11 +1,11 @@
title: TableOfContentsMacro Selective Expandable Example
caption: Selective Expandable
created: 20150221201907000
modified: 20150221203950000
title: Example Table of Contents: Selectively Expandable
caption: Selective
tags: table-of-contents-example
order: 4
!! Selective Expandable Table of Contents
<$macrocall $name='wikitext-example-without-html'
src='<div class="tc-table-of-contents">
<$macrocall $name=".example" n="1"
eg="""<div class="tc-table-of-contents">
<<toc-selective-expandable "Contents">>
</div>
'/>
</div>"""/>

View File

@ -1,11 +1,11 @@
title: TableOfContentsMacro Simple Example
created: 20150221201838000
modified: 20150221203742000
title: Example Table of Contents: Simple
caption: Simple
tags: table-of-contents-example
order: 1
!! Simple Table of Contents
<$macrocall $name='wikitext-example-without-html'
src='<div class="tc-table-of-contents">
<$macrocall $name=".example" n="1"
eg="""<div class="tc-table-of-contents">
<<toc "Contents">>
</div>
'/>
</div>"""/>

View File

@ -1,11 +1,11 @@
title: TableOfContentsMacro Sorted Expandable Example
caption: Sorted Expandable
created: 20150221201942000
modified: 20150221203958000
title: Example Table of Contents: Sorted Expandable
caption: Sorted
tags: table-of-contents-example
order: 3
!! Sorted Expandable Table of Contents
<$macrocall $name='wikitext-example-without-html'
src='<div class="tc-table-of-contents">
<$macrocall $name=".example" n="1"
eg="""<div class="tc-table-of-contents">
<<toc-expandable "Contents" "sort[title]">>
</div>
'/>
</div>"""/>

View File

@ -1,42 +1,24 @@
title: TableOfContentsMacro Tabbed Example
caption: Tabbed
created: 20150221203607000
modified: 20150221210000000
title: Example Table of Contents: Tabbed Internal
caption: Tabbed Internal
tags: table-of-contents-example
order: 5
!! Tabbed Table of Contents
The tabbed table of contents macro renders a selective expandable table of contents with an attached panel that displays the currently selected tiddler.
!!! Parameters
|!Position |!Name |!Description |!Default |
|1st |tag |Tag to be used for constructing the table of contents | |
|2nd |sort |Optional sorting subfilter (eg `sort[title]`) | |
|3rd |selectedTiddler |Title of the tiddler containing the title of the currently displayed tiddler |"$:/temp/toc/selectedTiddler" |
|4th |unselectedText |Text to be displayed when no tiddler is selected | |
|5th |missingText |Text to be displayed when the selected tiddler is missing | |
|6th |template |Optional title of a tiddler to be used as a template for rendering the selected tiddler | |
!!! Internal navigation
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="toc-tabbed-internal-nav"
tag="TableOfContents"
selectedTiddler="$:/temp/toc/selectedTiddler"
unselectedText="<p>Select a topic in the table of contents. Click the arrow to expand a topic.</p>"
missingText="<p>Missing tiddler.</p>"
/>
```
<<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.">>
<$macrocall
$name="toc-tabbed-internal-nav"
tag="TableOfContents"
selectedTiddler="$:/temp/toc/selectedTiddler"
unselectedText="<p>Select a topic in the table of contents. Click the arrow to expand a topic.</p>"
missingText="<p>Missing tiddler.</p>"
/>
```
!!! 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.
```
<<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="<p>Select a topic in the table of contents. Click the arrow to expand a topic.</p>" missingText="<p>Missing tiddler.</p>"/>

View File

@ -0,0 +1,24 @@
created: 20150221205834000
modified: 20150221210006000
title: Example Table of Contents: Tabbed External
caption: Tabbed External
tags: table-of-contents-example
order: 6
<$macrocall
$name="toc-tabbed-external-nav"
tag="TableOfContents"
selectedTiddler="$:/temp/toc/selectedTiddler"
unselectedText="<p>Select a topic in the table of contents. Click the arrow to expand a topic.</p>"
missingText="<p>Missing tiddler.</p>"
/>
```
<$macrocall
$name="toc-tabbed-external-nav"
tag="TableOfContents"
selectedTiddler="$:/temp/toc/selectedTiddler"
unselectedText="<p>Select a topic in the table of contents. Click the arrow to expand a topic.</p>"
missingText="<p>Missing tiddler.</p>"
/>
```

View File

@ -1,4 +1,5 @@
title: Tagged with TagMacro
tags: TagMacro
created: 20150221230034000
title: Example for tag Macro
tags: [[tag Macro (Examples)]]
This tiddler is to demonstrate the TagMacro.
This tiddler exists to demonstrate the <<.mlink tag>> macro.

View File

@ -1,5 +1,5 @@
created: 20140410101941871
modified: 20150124183957000
modified: 20150221152006000
tags: Learning Filters
title: Introduction to filter notation
type: text/vnd.tiddlywiki
@ -109,7 +109,7 @@ The parameter of each step we've seen so far has been in square brackets, meanin
as an alternative to `[tag[Vegetarian]]`. This allows the preference to change over time.
<<.def "Angle brackets">> `<>` mean that the parameter is the name of a [[variable|Variables]] whose value is to be used instead. Here we use the built-in <<.clink currentTiddler "WidgetVariable: currentTiddler">> variable in a filter that selects any tiddlers whose text contains the title of the current one:
<<.def "Angle brackets">> `<>` mean that the parameter is the name of a [[variable|Variables]] whose value is to be used instead. Here we use the built-in <<.vlink currentTiddler>> variable in a filter that selects any tiddlers whose text contains the title of the current one:
```
[search<currentTiddler>]

View File

@ -1,5 +1,5 @@
created: 20140410103123179
modified: 20150203183224000
modified: 20150220160957000
tags: [[Filter Operators]] [[Common Operators]] [[Selection Constructors]]
title: all Operator
type: text/vnd.tiddlywiki
@ -16,7 +16,7 @@ The parameter specifies zero or more fundamental categories using the following
"""/>
|!Category |!Members |!Sorted |
|^`current` |just the [[current tiddler|CurrentTiddler]] |^-- |
|^`current` |just the [[current tiddler|Current Tiddler]] |^-- |
|^`missing` |all non-existent tiddlers to which there is at least one [[hard link|Hard and Soft Links]] |^no |
|^`orphans` |all tiddlers to which there are <<.em no>> hard links |^by title |
|^`shadows` |all the [[shadow tiddlers|ShadowTiddlers]] that exist, including any that have been overridden with non-shadow tiddlers |^no |

View File

@ -1,5 +1,5 @@
created: 20140410103123179
modified: 20150210090410000
modified: 20150220161001000
tags: [[Filter Operators]] [[Common Operators]] [[Negatable Operators]]
title: is Operator
type: text/vnd.tiddlywiki
@ -14,7 +14,7 @@ op-neg-output: those input tiddlers that do <<.em not>> belong to category <<.pl
The parameter <<.place C>> is one of the following fundamental categories:
|!Category |!Matches any tiddler that... |
|^`current` |is the [[current tiddler|CurrentTiddler]] |
|^`current` |is the [[current tiddler|Current Tiddler]] |
|^`image` |has an image ContentType |
|^`missing` |does not exist (other than possibly as a shadow tiddler), regardless of whether there are any links it |
|^`orphan` |has no [[hard links|Hard and Soft Links]] to it |

View File

@ -1,5 +1,5 @@
created: 20140410103123179
modified: 20150203192721000
modified: 20150220161020000
tags: [[Filter Operators]] [[Field Operators]] [[Selection Constructors]] [[Negatable Operators]]
title: list Operator
type: text/vnd.tiddlywiki
@ -15,6 +15,6 @@ op-neg-output: those input titles that are <<.em not>> mentioned at <<.place R>>
<<.place R>> can reference either a field or a property. See [[TextReference]] for the syntax.
* If neither is specified, the <<.field list>> field is used by default. So `[list[T]]` outputs the titles listed in the <<.field list>> of tiddler T.
* If <<.place R>> consists of <<.em only>> a field or a property, the tiddler part of the reference defaults to the CurrentTiddler. So `[list[!!tags]]` outputs the titles listed in the <<.field tags>> field of the current tiddler.
* If <<.place R>> consists of <<.em only>> a field or a property, the tiddler part of the reference defaults to the [[current tiddler|Current Tiddler]]. So `[list[!!tags]]` outputs the titles listed in the <<.field tags>> field of the current tiddler.
<<.operator-examples "list">>

View File

@ -1,5 +1,5 @@
created: 20150126142522000
modified: 20150203192107000
modified: 20150221193759000
tags: [[Filter Operators]] [[String Operators]]
title: splitbefore Operator
type: text/vnd.tiddlywiki
@ -17,6 +17,6 @@ Each input title is processed in turn.
Contributions are [[dominantly appended|Dominant Append]] to the output.
The <<.clink "`toc`" TableOfContentsMacro>> macros use this operator with `/` as the parameter.
The [[table-of-contents macros|Table-of-Contents Macros]] use this operator with `/` as the parameter.
<<.operator-examples "splitbefore">>

View File

@ -1,5 +1,5 @@
created: 20151714300000000
modified: 20150124191518000
modified: 20150220152540000
tags: [[Filter Syntax]]
title: Filter Parameter
type: text/vnd.tiddlywiki
@ -24,4 +24,4 @@ The parameter to a [[filter operator|Filter Operators]] can be:
:: The parameter is the text indicated by the [[text reference|TextReference]] whose name appears between the curly brackets, i.e. a [[field|TiddlerFields]] of a specified tiddler, or the value of a property of a specified [[data tiddler|DataTiddlers]].
: <<.def variable>>
:: `<like this>`
:: The parameter is the current value of the [[variable|Variables]] whose name appears between the angle brackets.
:: The parameter is the current value of the [[variable|Variables]] whose name appears between the angle brackets. Macro parameters are <<.em not>> supported.

View File

@ -1,5 +1,5 @@
created: 20141117000000000
modified: 20141117000000000
modified: 20150221193924000
tags: Learning [[Customise TiddlyWiki]]
title: How to add a new tab to the sidebar
type: text/vnd.tiddlywiki
@ -7,7 +7,7 @@ type: text/vnd.tiddlywiki
To create a new tab in the sidebar menu:
# Create a tiddler and tag it with the [[SystemTag|SystemTags]] tag [[$:/tags/SideBar]]
#* To create a table of contents you can populate the new tab tiddler using the [[TableOfContentsMacro]]. For example, see the [[TableOfContents]] used here
#* To create a table of contents you can populate the new tab tiddler using the [[table-of-contents macros|Table-of-Contents Macros]]. For example, see the [[TableOfContents]] used here
# By default, the tiddler title is used as the tab title but you can override it using the `caption` field
# To define the tab ordering, use the `list-after` or `list-before` fields as discussed in [[Tagging]]
#* For example: set `list-after` to [[$:/core/ui/SideBar/Open]] to place a sidebar tab immediately after the "Open" tab

View File

@ -1,5 +1,5 @@
created: 20140305091244145
modified: 20140912141203664
modified: 20150221175658000
tags: [[Customise TiddlyWiki]]
title: Using Stylesheets
type: text/vnd.tiddlywiki
@ -47,12 +47,4 @@ A stylesheet tiddler is processed such that it is first wikified and then the te
!! Stylesheet Macros
Several globally available macros are provided that are helpful in constructing stylesheets. See [[$:/core/macros/CSS]] for the definitions of these macros.
* `<<colour name>>` and `<<color name>>` retrieve named colours from the current [[colour palette|ColourPalettes]]
* `<<box-shadow shadow>>` specify a box-shadow
* `<<filter filter>>` specify a CSS filter
* `<<transition transition>>` specify a CSS transition
* `<<transform-origin origin>>` specify the CSS transform origin
* `<<background-linear-gradient gradient>>` specify a linear gradient
* `<<datauri title>>` retrieves the base64 content of a tiddler for use via the CSS `url()` operator
The ~TiddlyWiki core provides several [[global macros that are helpful in constructing stylesheets|Stylesheet Macros]].

View File

@ -1,21 +1,16 @@
created: 20131228162825226
modified: 20131228163922307
tags: Macros
title: ChangeCountMacro
modified: 20150221151223000
tags: Macros [[Core Macros]]
title: changecount Macro
type: text/vnd.tiddlywiki
caption: changecount
The changecount macro returns a counter maintained by the TiddlyWiki core that tracks the number of modifications made to each tiddler. The changecount macro always applies to the tiddler named in the CurrentTiddler variable.
The <<.def changecount>> [[macro|Macros]] returns the number of times the [[current tiddler|Current Tiddler]] has been created, stored or deleted during the current ~TiddlyWiki session.
For example:
If a tiddler is deleted and subsequently recreated, its <<.var changecount>> will go up by two.
```
<<changecount>>
```
!! Parameters
Displays as:
<<changecount>>
Note how the changecount increases every time this tiddler is modified.
(none)
<<.macro-examples "changecount">>

View File

@ -0,0 +1,17 @@
created: 20150221154058000
modified: 20150221154522000
tags: Macros [[Core Macros]]
title: colour Macro
type: text/vnd.tiddlywiki
caption: colour
The <<.def colour>> (or <<.def color>>) [[macro|Macros]] returns the [[CSS|Cascading Style Sheets]] value of one the colours in the current [[palette|ColourPalettes]].
If no such entry exists in the current palette, the [[vanilla palette|$:/palettes/Vanilla]] is used instead.
!! Parameters
;name
: The name of the palette entry, e.g. `page-background`
<<.macro-examples "colour">>

View File

@ -0,0 +1,21 @@
created: 20150221113728000
modified: 20150221151338000
tags: Macros [[Core Macros]]
title: contrastcolour Macro
type: text/vnd.tiddlywiki
caption: contrastcolour
The <<.def contrastcolour>> [[macro|Macros]] returns whichever of two given [[CSS|Cascading Style Sheets]] colours is deemed to contrast best with another.
An example can be seen in the [[template tiddler for tag pills|$:/core/ui/TagTemplate]].
!! Parameters
;target
: The colour to contrast against (typically a background colour)
;fallbackTarget
: An alternative colour to contrast against. This is used when <<.param target>> is undefined or not a valid colour
;colourA
: The first of the two colours to choose between
;colourB
: The second of the two colours to choose between

View File

@ -0,0 +1,8 @@
created: 20150220180315000
modified: 20150221222052000
title: Core Macros
type: text/vnd.tiddlywiki
The following [[macros|Macros]] are built into ~TiddlyWiki's core:
<<list-links "[tag[Core Macros]]">>

View File

@ -0,0 +1,17 @@
created: 20150221115509000
modified: 20150221151344000
tags: Macros [[Core Macros]]
title: csvtiddlers Macro
type: text/vnd.tiddlywiki
caption: csvtiddlers
The <<.def csvtiddlers>> [[macro|Macros]] returns the fields of a [[selection of tiddlers|Title Selection]] in [[CSV|Comma-Separated Values]] form, with one record (row) per tiddler.
An example can be seen in the [[template tiddler for CSV exports|$:/core/templates/exporters/CsvFile]].
!! Parameters
;filter
: A [[filter|Filters]] selecting which tiddlers to include
;format
: Reserved for future extension. Should be set to `quoted-comma-sep`

View File

@ -0,0 +1,21 @@
created: 20150221162212000
modified: 20150221222838000
tags: Macros [[Core Macros]]
title: datauri Macro
type: text/vnd.tiddlywiki
caption: datauri
The <<.def datauri>> [[macro|Macros]] returns a [[data URI|Data URI]] for the content of a tiddler.
It is often used in [[stylesheet|Cascading Style Sheets]] tiddlers to reference things like inline images and fonts:
> `background: url(<<datauri "Motovun Jack.jpg">>);`
The data URI is automatically [[base64|Base64]]-encoded in the case of a non-text tiddler.
!! Parameters
;title
: The title of a tiddler, such as an image
<<.macro-examples "datauri">>

View File

@ -1,20 +1,18 @@
created: 20140908104107181
modified: 20150107121000000
tags: Macros
title: DumpVariablesMacro
modified: 20150221151454000
tags: Macros [[Core Macros]]
title: dumpvariables Macro
type: text/vnd.tiddlywiki
caption: dumpvariables
The ''dumpvariables'' [[macro|Macros]] displays a table with values of all [[variables|Variables]] that are defined in the current scope. It is useful for debugging and exploring TiddlyWiki internals.
The <<.def dumpvariables>> [[macro|Macros]] returns a table showing the values of all [[variables|Variables]] and [[macros|Macros]] that exist at that position in the [[widget tree|Widgets]].
''Note:'' Parameters and variable subsitutions for macros are displayed as empty strings. A macro defined as `\define myMacro(text) ''$text$''` thus displays as `''''`.
It is useful for debugging and exploring ~TiddlyWiki's internals.
!! Example
Placeholders are replaced with values in the normal way, but using the default values for all macro parameters.
```
<<dumpvariables>>
```
!! Parameters
Renders as:
(none)
<<dumpvariables>>
<<.macro-examples "dumpvariables">>

View File

@ -0,0 +1,15 @@
created: 20150221152226000
modified: 20150221154213000
tags: Macros [[Core Macros]]
title: jsontiddlers Macro
type: text/vnd.tiddlywiki
caption: jsontiddlers
The <<.def jsontiddlers>> [[macro|Macros]] returns the fields of a [[selection of tiddlers|Title Selection]] in [[JSON|JavaScript Object Notation]] form.
An example can be seen in the [[template tiddler for JSON exports|$:/core/templates/exporters/JsonFile]].
!! Parameters
;filter
: A [[filter|Filters]] selecting which tiddlers to include

View File

@ -0,0 +1,16 @@
created: 20150221154907000
modified: 20150221155706000
title: lingo Macro
tags: Macros [[Core Macros]]
caption: lingo
The <<.def lingo>> [[macro|Macros]] relates to the translation of ~TiddlyWiki's user interface into other languages. It returns a piece of text in the user's currently selected language.
Translatable text is supplied by language plugins containing tiddlers with specific titles that start with `$:/language/`.
!! Parameters
;title
: The title of the shadow tiddler that contains the text. The prefix `$:/language/` is added automatically
<<.macro-examples "lingo">>

View File

@ -1,28 +1,22 @@
title: ListMacro
tags: Macros
modified: 20140917083515996
caption: list
created: 20140917083515996
modified: 20150221223214000
title: list-links Macro
tags: Macros [[Core Macros]]
caption: list-links
The list macro is a family of macros that produce a list of tiddlers.
The <<.def list-links>> [[macro|Macros]] returns a formatted list of links to a [[selection of tiddlers|Title Selection]].
There are several variants of the macro:
If a tiddler has a <<.field caption>> field, this is shown instead of the tiddler's title.
* `<<list-links>>` produces a list of links to tiddlers that match a filter expression. If the tiddler has a //caption// field, it is displayed in lieu of the //title// field.
!! Parameters
! Parameters
;filter
: A [[filter|Filters]] selecting which tiddlers to include
;type
: An HTML element to use for the overall list element, defaulting to `ul`
;subtype
: An HTML element to use for each item in the list, defaulting to `li`
;class
: A [[CSS|Cascading Style Sheets]] class for the overall list element
|!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" |
|4th |class |An optional CSS class to be applied to the list wrapper element (eg `<ul class="three-columns">`) | |
! 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">>
'/>
<<.macro-examples "list-links">>

View File

@ -1,38 +1,19 @@
created: 20131228163141555
modified: 20131228163843163
tags: Macros
title: MakeDataUriMacro
modified: 20150221223416000
tags: Macros [[Core Macros]]
title: makedatauri Macro
type: text/vnd.tiddlywiki
caption: makedatauri
The makedatauri macro constructs a data URI from a block of text and an associated ContentType. It is commonly used within stylesheets to generate an inline image or font.
The <<.def makedatauri>> [[macro|Macros]] takes a piece of text and an associated ContentType, and returns a corresponding [[data URI|Data URI]].
! Parameters
<<.var makedatauri>> is used to implement the <<.mlink datauri>> macro.
|!Position |!Name |!Description |!Default |
|1st |text |Text to be converted to a data URI | |
|2nd |type |ContentType of text | |
!! Parameters
! Examples
;text
: The text to be converted to a data URI
;type
: The ContentType of the text
A trivial example to show how the macro works:
```
<<makedatauri "HelloThere" "text/plain">>
```
<<makedatauri "HelloThere" "text/plain">>
A user-defined macro such as this would typically be used within a stylesheet:
```
\define datauri(title)
<$macrocall $name="makedatauri" type={{$title$!!type}} text={{$title$}}/>
\end
```
Then one can write CSS rules like this:
```
background: url(<<datauri "$:/themes/tiddlywiki/starlight/ltbg.jpg">>);
```
<<.macro-examples "makedatauri">>

View File

@ -1,28 +1,17 @@
caption: now
created: 20141008141616791
modified: 20141013180540337
tags: Macros
title: NowMacro
modified: 20150221170300000
tags: Macros [[Core Macros]]
title: now Macro
type: text/vnd.tiddlywiki
The 'now' macro returns the current date and time, formatted with an optional format string.
The <<.def now>> [[macro|Macros]] returns the current date and time in a specified [[format|DateFormat]].
! Parameters
The value doesn't update automatically, like a ticking clock. It updates whenever the macro call is rendered, such as when the containing tiddler's display needs to be refreshed for some other reason.
|!Position |!Name |!Description |!Default |
|1st |format |DateFormat string specifying the format for the date/time |`0hh:0mm, DDth MMM YYYY` |
!! Parameters
! Examples
For example:
```
* <<now>>
* <<now "DDth MMM YYYY">>
```
Returns:
* <<now>>
* <<now "DDth MMM YYYY">>
;format
: A string specifying the desired [[format|DateFormat]], defaulting to `0hh:0mm, DDth MMM YYYY`
<<.macro-examples "now">>

View File

@ -1,26 +1,19 @@
created: 20131228164411884
modified: 20131228164955084
tags: Macros
title: QualifyMacro
modified: 20150221223816000
tags: Macros [[Core Macros]]
title: qualify Macro
type: text/vnd.tiddlywiki
caption: qualify
The qualify macro is part of the StateMechanism. Given a base tiddler title it generates a unique string that includes a hashed encoding of a position within the widget render tree, identified by the stack of transcluded tiddlers that leads to that position.
The <<.def qualify>> [[macro|Macros]] is an important part of the StateMechanism.
! Parameters
It returns a unique string that encodes its position within the [[widget tree|Widgets]], as identified by the stack of transcluded tiddlers that lead to that position.
|!Position |!Name |!Description |!Default |
|1st |title |Base tiddler title | |
It is implemented using the <<.vlink transclusion>> variable.
! Examples
!! Parameters
The results returned by the qualify macro will depend upon where it is used. For example:
```
<<qualify "base">>
```
Returns:
<<qualify "base">>
;title
: The prefix for the returned string, normally a tiddler title
<<.macro-examples "qualify">>

View File

@ -1,23 +1,27 @@
created: 20150203152000000
modified: 20150203152000000
title: ResolvePath
modified: 20150221223858000
tags: Macros [[Core Macros]]
title: resolvepath Macro
type: text/vnd.tiddlywiki
caption: resolvepath
The ''resolvepath'' macro constructs a url for a relative source path with respect to an absolute root path, trailing filenames being cut-off.
The <<.def resolvepath>> [[macro|Macros]] takes a relative path and an absolute path. It interprets the former relative to the latter, and returns the absolute equivalent of the former.
! Parameters
Folders in the paths are delimited by `/`.
|!Position |!Name |!Description |!Default |
|1st |source |the relative path to be appended| |
|2nd |root |the absolute path to be appended to | |
The special folder name `.` denotes the current folder, and `..` denotes the parent folder.
! Examples
If the absolute path indicates a folder, it needs to end with `/`. Anything after the final `/` is treated as an arbitrary filename within the intended path, and is discarded.
A trivial example to show how the macro works:
If no absolute path is supplied, the relative path is returned unchanged, except that anything after the final `/` is discarded.
```
<<resolvepath "./backup" "http://example.com/store.php">>
```
The return value is a path, but does <<.em not>> end with `/`.
<<resolvepath "./backup" "http://example.com/store.php">>
!! Parameters
;source
: the relative path
;root
: the absolute path
<<.macro-examples "resolvepath">>

View File

@ -0,0 +1,25 @@
created: 20150221181835000
modified: 20150221223956000
tags: Macros [[Core Macros]]
title: Stylesheet Macros
type: text/vnd.tiddlywiki
The following core [[macros|Macros]] make it easy to specify alternative browser-specific properties when constructing a [[stylesheet|Cascading Style Sheets]] tiddler:
;`<<box-shadow shadow>>`
: for the `x-box-shadow` properties
;`<<filter filter>>`
: for the `x-filter` properties
;`<<transition transition>>`
: for the `x-transition` properties
;`<<transform-origin origin>>`
: for the `x-transition-origin` properties
;`<<background-linear-gradient gradient>>`
: for the `x-linear-gradient` values of the `background-image` property
The following macros are documented separately:
* <<.mlink colour>>
* <<.mlink datauri>>
All these macros are defined in the [[$:/core/macros/CSS]] tiddler.

View File

@ -1,51 +1,63 @@
caption: toc
created: 20140919155729620
modified: 20141117000000000
tags: Macros
title: TableOfContentsMacro
modified: 20150221224034000
tags: Macros [[Core Macros]]
title: Table-of-Contents Macros
type: text/vnd.tiddlywiki
The table of contents macro produces a hierarchical tree of tiddlers based on their tags.
~TiddlyWiki provides several macros for generating a tree of tiddler links by analysing [[tags|Tagging]]:
The top level entries of the table of contents are defined by a root tag. The subentries under each of those entries are tagged with the title of the entry. Entries can be ordered using the `list` field of the tag tiddler as described in [[Tagging]].
;<<.var toc>>
: A simple tree
;<<.var toc-expandable>>
: A tree in which all the branches can be expanded and collapsed
;<<.var toc-selective-expandable>>
: A tree in which the non-empty branches can be expanded and collapsed
;<<.var toc-tabbed-internal-nav>> and <<.var toc-tabbed-external-nav>>
: A two-panel browser:
:* on the left, a selectively expandable tree that behaves like a set of vertical tabs
:* on the right, the content of whichever tiddler the user selects in the tree
The text for each entry is taken from the ''caption'' field if it is present, otherwise the ''title'' is used.
The difference between the last two has to do with what happens when the user clicks a link in the right-hand panel:
Entries are rendered as a link to the corresponding tiddler unless the tiddler has the value ''no'' in the field ''toc-link''. In the examples below, the entry SecondThree is set up in this way to not appear as a link.
;<<.var toc-tabbed-internal-nav>>
: The target tiddler appears in the right-hand panel, replacing the tiddler that contained the link
;<<.var toc-tabbed-external-nav>>
: The target tiddler appears in the normal way (which depends on the user's configured storyview)
There are several variants of the macro:
!! Structure
* `<<toc>>` produces a simple hierarchical tree of links
* `<<toc-expandable>>` produces an expandable tree of links
* `<<toc-selective-expandable>>` produces an expandable tree of links where the expand/contract buttons are only shown for entries that possess child nodes
The top level of the tree consists of the tiddlers that carry a particular tag, known as the <<.def "root tag">>. Tiddlers tagged with any of those make up the next level down, and so on.
The macros all generate HTML ordered lists. The `<ol>` elements are given the class `tc-toc`, with the expandable variant also having the class `tc-toc-expandable` and the selective expandable variant also having the class `tc-toc-selective-expandable`.
At each level, the tiddlers can be [[ordered|Order of Tagged Tiddlers]] by means of the <<.field list>> field of the parent tag tiddler. They can also be ordered by the macro's <<.param sort>> parameter.
! Parameters
The tree displays the <<.field caption>> field of a tiddler if it has one, or the tiddler's title otherwise.
|!Position |!Name |!Description |!Default |
|1st |tag |The root tag that identifies the top level of the hierarchy | |
|2nd |sort |Optional sorting subfilter (eg `sort[title]`) | |
Each tiddler in the tree is normally displayed as a link. To suppress this, give the tiddler a <<.field toc-link>> field with the the value <<.value no>>. In the [[examples|Table-of-Contents Macros (Examples)]], the SecondThree tiddler is set up like this. Clicking such a tiddler in the tree causes its branch to expand or collapse.
The ''tag'' and ''sort'' parameters are combined to make a filter expression of the form:
The table of contents is generated as an HTML ordered list. The `<ol>` elements always have the class `tc-toc`. Expandable trees have the additional class `tc-toc-expandable`. Selectively expandable trees (including those in the two-panel browser) have `tc-toc-selective-expandable`.
```
[tag[$tag$]$sort$]
```
To make a table of contents appear in the sidebar, see [[How to add a new tab to the sidebar]].
! Examples
!! Parameters
In these examples, the top level entries of the table of contents examples are defined by the root tag ''Contents''. The subentries under each of those entries are tagged with the title of the parent entry, here ''First'', ''Second'', ''Third'', and ''Fourth''. One level deeper only ''~SecondThree'' has subentries.
;tag
: The root tag that identifies the top level of the tree
;sort
: An optional extra [[filter step|Filter Step]], e.g. `sort[title]`
Here is the tag structure shown with clickable tag pills:
These two parameters are combined into a single [[filter expression|Filter Expression]] like this:
{{Contents||$:/core/ui/TagTemplate}}
*{{First||$:/core/ui/TagTemplate}}
*{{Second||$:/core/ui/TagTemplate}}
**{{SecondThree||$:/core/ui/TagTemplate}}
*{{Third||$:/core/ui/TagTemplate}}
*{{Fourtth||$:/core/ui/TagTemplate}}
> `[tag[$tag$]$sort$]`
For instructions on adding a table of contents to the sidebar, see: [[How to add a new tab to the sidebar]].
<<.var toc-tabbed-internal-nav>> and <<.var toc-tabbed-external-nav>> take additional parameters:
<<tabs "[tag[table-of-contents-example]]" "TableOfContentsMacro Simple Example">>
;selectedTiddler
: The title of the [[state tiddler|StateMechanism]] for noting the currently selected tiddler, defaulting to `$:/temp/toc/selectedTiddler`. It is recommended that this be a [[system tiddler|SystemTiddlers]]
;unselectedText
: The text to display when no tiddler is selected in the tree
;missingText
: The text to display if the selected tiddler doesn't exist
;template
: Optionally, the title of a tiddler to use as a [[template|TemplateTiddlers]] for transcluding the selected tiddler into the right-hand panel
[[Examples|Table-of-Contents Macros (Examples)]]

View File

@ -1,36 +1,31 @@
caption: tabs
created: 20131228162203521
modified: 20141211141507313
tags: Macros
title: TabsMacro
modified: 20150221211706000
tags: Macros [[Core Macros]]
title: tabs Macro
type: text/vnd.tiddlywiki
The tabs macro displays a list of tiddlers as a tab control. The user can switch between tabs by clicking on them. The tabs are labelled with the title of the corresponding tiddler, unless there is a `caption` field present in which case it is used instead.
The <<.def tabs>> [[macro|Macros]] presents a [[selection of tiddlers|Title Selection]] as a set of tabs that the user can switch between.
By default the tab control arranges the tabs horizontally with the content underneath. You can also choose to have the tabs arranged vertically by passing the class `tc-vertical`.
The tabs display the <<.field caption>> field of a tiddler if it has one, or the tiddler's title otherwise.
! Parameters
By default the tabs are arranged horizontally above the content. To get vertical tabs, set the <<.param class>> parameter to <<.value tc-vertical>>.
|!Position |!Name |!Description |!Default |
|1st |tabsList |Filter giving the tiddlers to be displayed | |
|2nd |default |Name of the tiddler containing the default tab | |
|3rd |state |String to distinguish multiple tabs within the same tiddler (use of the system tiddler prefix is recommended) |''$:/state/tab'' |
|4th |class |Additional CSS classes for the three wrapper DIVs that make up the tabs (multiple classes can be separated with spaces) | |
|5th |template |Optional template through which to render the tab content | |
!! Parameters
Within the template the title of the current tab is available in the widget variable ''currentTab''. The ''currentTiddler'' variable is not affected by the tabs macro.
;tabsList
: A [[filter|Filters]] selecting which tiddlers to include
;default
: The title of the tiddler whose tab is to be selected by default
;state
: The prefix for the title of a [[state tiddler|StateMechanism]] for noting the currently selected tab, defaulting to `$:/state/tab`. It is recommended that this be a [[system tiddler|SystemTiddlers]]
;class
: Additional [[CSS|Cascading Style Sheets]] classes for the generated `div` elements. Multiple classes can be separated with spaces
;template
: Optionally, the title of a tiddler to use as a [[template|TemplateTiddlers]] for transcluding the content of the selected tab
! Examples
Within the template, the title of the selected tab is available in the <<.var currentTab>> variable.
Here are some examples of the tabs macro:
The <<.vlink currentTiddler>> variable is not affected by the <<.var tabs>> macro.
```
<<tabs "SampleTabOne SampleTabTwo SampleTabThree SampleTabFour" "SampleTabThree" "$:/state/tab1">>
<<tabs "[tag[sampletab]]" "SampleTabTwo" "$:/state/tab2" "tc-vertical">>
```
<<tabs "SampleTabOne SampleTabTwo SampleTabThree SampleTabFour" "SampleTabThree" "$:/state/tab1">>
<<tabs "[tag[sampletab]]" "SampleTabTwo" "$:/state/tab2" "tc-vertical">>
//Exercise//: how would you make sure that the second tab list is correctly sorted? Hint : read [[Tagging]] until the end.
<<.macro-examples "tabs">>

View File

@ -1,27 +1,15 @@
caption: tag
created: 20141206130540337
modified: 20141206130540337
tags: Macros
title: TagMacro
modified: 20150221224326000
tags: Macros [[Core Macros]]
title: tag Macro
type: text/vnd.tiddlywiki
The 'tag' macro displays a tag pill for a specified tag.
The <<.def tag>> [[macro|Macros]] generates a tag pill for a specified tag.
! Parameters
!! Parameters
|!Position |!Name |!Description |!Default |
|1st |tag |Title of tag |The current tiddler |
;tag
: The title of the tag, defaulting to the [[current tiddler|Current Tiddler]]
! Examples
For example:
```
* <<tag>>
* <<tag "HelloThere">>
```
Returns:
* <<tag>>
* <<tag "HelloThere">>
<<.macro-examples "tag">>

View File

@ -1,34 +1,24 @@
title: TimelineMacro
tags: Macros
modified: 20141103172520228
created: 20150220180357000
modified: 20150221224401000
title: timeline Macro
tags: Macros [[Core Macros]]
caption: timeline
The timeline macro produces a list of tiddlers in reverse chronological order of modification date that is grouped by the date of the day of modification.
The <<.def timeline>> [[macro|Macros]] returns a list of tiddlers in reverse chronological order of modification (or some other [[date field|Date Fields]]), grouped by day.
! Parameters
!! Parameters
|!Position |!Name |!Description |!Default |
|1st |limit |The maximum number of tiddlers to list (see below) |100 |
|2nd |format |A DateFormat string for formatting the date |DDth MMM YYYY |
|3rd |subfilter |A subfilter to include in the timeline filter (see below) | |
|4th |dateField |Optional name of date field to use |modified |
;limit
: The maximum number of tiddlers to include, defaulting to 100. But if <<.em any>> tiddlers are included for a particular day, <<.em all>> of the other tiddlers for that day will also be included -- even if this exceeds the limit
;format
: A string specifying the desired [[format|DateFormat]], defaulting to `DDth MMM YYYY`
;subfilter
: An optional extra [[filter step|Filter Step]], e.g. `tag[MyTag]`
;dateField
: The name of the date field to use, defaulting to `modified`
The subfilter and limit parameters are spliced into the filter string like this:
The tiddlers are selected by means of a [[filter expression|Filter Expression]], into which the <<.param subfilter>> and <<.param limit>> parameters are spliced as follows:
```
[!is[system]$subfilter$has[modified]!sort[modified]limit[$limit$]eachday[modified]]
```
> `[!is[system]$subfilter$has[modified]!sort[modified]limit[$limit$]eachday[modified]]`
To restrict the timeline to a particular tag, the subfilter can be set to something like `tag[mytag]`:
```
<<timeline limit:10 subfilter:"tag[mytag]">>
```
Note that the timeline macro does not truncate the entries for a particular day, instead always displaying all the tiddlers under each displayed day heading. This means that the limit parameter works in an unexpected way because it is possible for more than the specified number of tiddlers to be displayed.
! Examples
<$macrocall $name="wikitext-example-without-html"
src="<<timeline limit:30 format:'DD/MM/YYYY'>>
"/>
<<.macro-examples "timeline">>

View File

@ -1,18 +1,14 @@
created: 20131228162448664
modified: 20131228162605081
tags: Macros
title: VersionMacro
modified: 20150221214134000
tags: Macros [[Core Macros]]
title: version Macro
type: text/vnd.tiddlywiki
caption: version
The version macro returns the current TiddlyWiki version number.
The <<.def version>> [[macro|Macros]] returns the current version number of ~TiddlyWiki.
! Example
!! Parameters
The version macro takes no parameters:
(none)
```
Version number: <<version>>
```
Version number: <<version>>
<<.macro-examples "version">>

View File

@ -0,0 +1,30 @@
created: 20150220182252000
modified: 20150221221723000
tags: [[WikiText Examples]]
title: Macro Calls in WikiText (Examples)
type: text/vnd.tiddlywiki
\define sayhi-example-1() <<sayhi>>
\define sayhi-example-2() <<sayhi Bugs>>
\define sayhi-example-3() <<sayhi "Donald Duck" Disneyland>>
\define sayhi-example-4() <<sayhi "Mickey Mouse" "Mouse House">>
\define sayhi-example-5() <<sayhi name:'Minnie Mouse' address:[[Mouse House]]>>
\define sayhi-example-6() <<sayhi address:"Quacky Towers" name:"Donald Duck">>
\define sayhi-example-7()
<<sayhi "Mickey Mouse" """"Mouse House",
Rodent's Lane,
Squeaksville,
Ratland""">>
\end
<$importvariables filter="$:/editions/tw5.com/macro-examples/say-hi">
<$codeblock code={{$:/editions/tw5.com/macro-examples/say-hi}}/>
<$macrocall $name=".example" n="1" eg=<<sayhi-example-1>>/>
<$macrocall $name=".example" n="2" eg=<<sayhi-example-2>>/>
<$macrocall $name=".example" n="3" eg=<<sayhi-example-3>>/>
<$macrocall $name=".example" n="4" eg=<<sayhi-example-4>>/>
<$macrocall $name=".example" n="5" eg=<<sayhi-example-5>>/>
<$macrocall $name=".example" n="6" eg=<<sayhi-example-6>>/>
<$macrocall $name=".example" n="7" egvar="sayhi-example-7"/>
</$importvariables>

View File

@ -0,0 +1,18 @@
created: 20150221151206000
modified: 20150221151227000
tags: [[changecount Macro]] [[Macro Examples]]
title: changecount Macro (Examples)
type: text/vnd.tiddlywiki
<$macrocall $name=".example" n="1" eg="""<<changecount>>"""/>
The value will increase if you edit this tiddler and store it again, even without making any changes to its content.
To access the <<.var changecount>> of a different tiddler, use a <<.wlink TiddlerWidget>> widget:
<$macrocall $name=".example" n="2"
eg="""<$tiddler tiddler="Draft of 'New Tiddler'">
<<changecount>>
</$tiddler>"""/>
The value shown will increase whenever you create, store or delete [[New Tiddler]].

View File

@ -0,0 +1,11 @@
created: 20150221154356000
modified: 20150221154803000
tags: [[colour Macro]] [[Macro Examples]]
title: colour Macro (Examples)
type: text/vnd.tiddlywiki
<$macrocall $name=".example" n="1" eg="""<<colour code-border>>"""/>
<$macrocall $name=".example" n="2" eg="""<<colour foreground>>"""/>
<$macrocall $name=".example" n="3" eg="""<<colour page-background>>"""/>
<$macrocall $name=".example" n="4" eg="""<<colour sidebar-tab-background>>"""/>
<$macrocall $name=".example" n="5" eg="""<<colour tag-foreground>>"""/>

View File

@ -0,0 +1,19 @@
created: 20150221160534000
modified: 20150221223524000
tags: [[datauri Macro]] [[Macro Examples]]
title: datauri Macro (Examples)
type: text/vnd.tiddlywiki
<$macrocall $name=".example" n="2"
eg="""<style>
.jack {
background: url(<$macrocall $name="datauri" title="Motovun Jack.jpg" $output="text/plain"/>);
height: 300px;
}
</style>
<div class="jack"/>"""/>
The example has to invoke <<.var datauri>> through the <<.wid macrocall>> widget. It needs to prevent the macro's output from being parsed as WikiText, as that would transform the data URI into a <<.wlink LinkWidget>> widget and break the example. If the example was in a CSS tiddler, you could simply write:
> `background: url(<<datauri "Motovun Jack.jpg">>);`

View File

@ -0,0 +1,14 @@
created: 20150221151358000
modified: 20150221151415000
tags: [[dumpvariables Macro]] [[Macro Examples]]
title: dumpvariables Macro (Examples)
type: text/vnd.tiddlywiki
<$macrocall $name=".example" n="1"
eg="""<$set name="EXAMPLE" value="123.$(EXAMPLE2)$.789">
<$set name="EXAMPLE2" value="456">
<<dumpvariables>>
</$set>
</$set>"""/>

View File

@ -0,0 +1,13 @@
created: 20150221151358000
modified: 20150221160113000
tags: [[lingo Macro]] [[Macro Examples]]
title: lingo Macro (Examples)
type: text/vnd.tiddlywiki
This example shows the text used as the basis for the title of a newly created tiddler:
<$macrocall $name=".example" n="1" eg="""<<lingo DefaultNewTiddlerTitle>>"""/>
This example shows the name of the eighth month of the year, for use in [[formatting dates|DateFormat]]:
<$macrocall $name=".example" n="2" eg="""<<lingo Date/Long/Month/8>>"""/>

View File

@ -0,0 +1,13 @@
created: 20150221160534000
modified: 20150221160748000
tags: [[list-links Macro]] [[Macro Examples]]
title: list-links Macro (Examples)
type: text/vnd.tiddlywiki
This example lists all the tiddlers whose titles start with J:
<$macrocall $name=".example" n="1" eg="""<<list-links filter:"[prefix[J]]">>"""/>
This example lists the documentation tiddlers for the core macros, each of which has a <<.field caption>> field:
<$macrocall $name=".example" n="2" eg="""<<list-links filter:"[tag[Core Macros]]">>"""/>

View File

@ -0,0 +1,7 @@
created: 20150221160534000
modified: 20150221223613000
tags: [[makedatauri Macro]] [[Macro Examples]]
title: makedatauri Macro (Examples)
type: text/vnd.tiddlywiki
<$macrocall $name=".example" n="1" eg="""<<makedatauri "some example text" "text/plain">>"""/>

View File

@ -0,0 +1,9 @@
created: 20150221151358000
modified: 20150221170425000
tags: [[now Macro]] [[Macro Examples]]
title: now Macro (Examples)
type: text/vnd.tiddlywiki
<$macrocall $name=".example" n="1" eg="""<<now>>"""/>
<$macrocall $name=".example" n="2" eg="""<<now YYYY-0MM-0DD>>"""/>
<$macrocall $name=".example" n="3" eg="""<<now "hh:0mm:0sspm">>"""/>

View File

@ -0,0 +1,11 @@
created: 20150221171233000
modified: 20150221172546000
tags: [[qualify Macro]] [[Macro Examples]]
title: $:/editions/tw5.com/macro-examples/qualify-transcluded
type: text/vnd.tiddlywiki
<$macrocall $name=".example" n="1"
eg="""<ul>
<li><code><<qualify "BaseTiddler">></code></li>
<li><code><<transclusion>></code></li>
</ul>"""/>

View File

@ -0,0 +1,20 @@
created: 20150221172527000
tags: [[qualify Macro]] [[Macro Examples]]
title: qualify Macro (Examples)
type: text/vnd.tiddlywiki
The results returned by the <<.mlink qualify>> macro depend on its location in the transclusion stack.
The two examples below are identical, but produce different results because the second one has been transcluded from [[another tiddler|$:/editions/tw5.com/macro-examples/qualify-transcluded]].
Each example shows the result of calling <<.var qualify>> and then the value of the <<.vlink transclusion>> variable.
<$macrocall $name=".example" n="1"
eg="""<ul>
<li><code><<qualify "BaseTiddler">></code></li>
<li><code><<transclusion>></code></li>
</ul>"""/>
<blockquote>
{{$:/editions/tw5.com/macro-examples/qualify-transcluded}}
</blockquote>

View File

@ -0,0 +1,12 @@
created: 20150221182731000
modified: 20150221183441000
tags: [[resolvepath Macro]] [[Macro Examples]]
title: resolvepath Macro (Examples)
type: text/vnd.tiddlywiki
<$macrocall $name=".example" n="1" eg="""<<resolvepath "./backup" "http://example.com/store.php">>"""/>
<$macrocall $name=".example" n="2" eg="""<<resolvepath "backup" "http://example.com/store.php">>"""/>
<$macrocall $name=".example" n="3" eg="""<<resolvepath "../backup" "http://example.com/store.php">>"""/>
<$macrocall $name=".example" n="4" eg="""<<resolvepath "../jpg/Motovun_Jack.jpg" "http://example.com/resources/images/png/">>"""/>
<$macrocall $name=".example" n="5" eg="""<<resolvepath "../jpg/../png/Motovun_Jack.png">>"""/>
<$macrocall $name=".example" n="6" eg="""<<resolvepath "jpg/Motovun_Jack.jpg">>"""/>

View File

@ -0,0 +1,14 @@
created: 20150221211317000
modified: 20150221211719000
tags: [[tabs Macro]] [[Macro Examples]]
title: tabs Macro (Examples)
type: text/vnd.tiddlywiki
<$macrocall $name=".example" n="1"
eg="""<<tabs "SampleTabOne SampleTabTwo SampleTabThree SampleTabFour" "SampleTabOne" "$:/state/tab1">>"""/>
<$macrocall $name=".example" n="2"
eg="""<<tabs "[tag[sampletab]]" "SampleTabTwo" "$:/state/tab2" "tc-vertical">>"""/>
<$macrocall $name=".example" n="3"
eg="""<<tabs "[tag[sampletab]nsort[order]]" "SampleTabThree" "$:/state/tab3" "tc-vertical">>"""/>

View File

@ -0,0 +1,8 @@
created: 20150221211317000
modified: 20150221224519000
tags: [[tag Macro]] [[Macro Examples]]
title: tag Macro (Examples)
type: text/vnd.tiddlywiki
<$macrocall $name=".example" n="1" eg="""<<tag>>"""/>
<$macrocall $name=".example" n="2" eg="""<<tag Concepts>>"""/>

View File

@ -0,0 +1,8 @@
created: 20150221213650000
modified: 20150221224634000
tags: [[timeline Macro]] [[Macro Examples]]
title: timeline Macro (Examples)
type: text/vnd.tiddlywiki
<$macrocall $name=".example" n="1" eg="""<<timeline format:"DD/MM/YYYY">>"""/>
<$macrocall $name=".example" n="2" eg="""<<timeline limit:30 subfilter:"tag[Definitions]" format:"DD/MM/YYYY">>"""/>

View File

@ -0,0 +1,20 @@
created: 20150221193056000
modified: 20150221205038000
tags: [[Table-of-Contents Macros]] [[Macro Examples]]
title: Table-of-Contents Macros (Examples)
type: text/vnd.tiddlywiki
These examples derive tables of contents from the root tag <<.tag Contents>>.
You can explore the same structure with these clickable tag pills:
* {{Contents||$:/core/ui/TagTemplate}}
** {{First||$:/core/ui/TagTemplate}}
** {{Second||$:/core/ui/TagTemplate}}
*** {{SecondThree||$:/core/ui/TagTemplate}}
** {{Third||$:/core/ui/TagTemplate}}
** {{Fourth||$:/core/ui/TagTemplate}}
The tabbed example uses the real TableOfContents of this documentation instead.
<<tabs "[tag[table-of-contents-example]nsort[order]]" "Example Table of Contents: Simple">>

View File

@ -0,0 +1,7 @@
created: 20150221214110000
modified: 20150221214129000
tags: [[version Macro]] [[Macro Examples]]
title: version Macro (Examples)
type: text/vnd.tiddlywiki
<$macrocall $name=".example" n="1" eg="""Version number: <<version>>"""/>

View File

@ -0,0 +1,10 @@
created: 20150221145447000
modified: 20150221145626000
title: $:/editions/tw5.com/macro-examples/say-hi-using-variables
type: text/vnd.tiddlywiki
\define say-hi-using-variables()
Hi, I'm $(name)$ and I live in $(address)$.
\end
\define name() Bugs

View File

@ -0,0 +1,8 @@
created: 20150221145803000
modified: 20150221221536000
title: $:/editions/tw5.com/macro-examples/say-hi
type: text/vnd.tiddlywiki
\define sayhi(name:"Bugs Bunny" address:"Rabbit Hole Hill")
Hi, I'm $name$ and I live in $address$.
\end

View File

@ -0,0 +1,5 @@
created: 20150221145803000
title: $:/editions/tw5.com/macro-examples/tags-of-current-tiddler
type: text/vnd.tiddlywiki
\define tags-of-current-tiddler() {{!!tags}}

View File

@ -0,0 +1,27 @@
created: 20150221105732000
modified: 20150221222352000
tags: [[Macro Syntax]]
title: Macro Call Syntax
type: text/vnd.tiddlywiki
<<.preamble """What follows is a formal presentation of the syntax of the WikiText syntax for macro calls, using [[railroad diagrams|Railroad Diagrams]]. A [[simpler overview|Macro Calls in WikiText]] is also available.""">>
<$railroad text="""
"<<" name [: space [:{param-value}] ]">>"
"""/>
<<.place space>> denotes a sequence of [[whitespace characters|Filter Whitespace]].
The [[macro|Macros]]'s <<.place name>> is a sequence of non-whitespace characters other than `(` or `>`.
Each individual <<.place param-value>> has the following syntax:
<$railroad text="""
[: param-name [:space] ":" [:space] ] value [: space]
"""/>
The <<.place param-name>> is a sequence of letters (`A`--`Z`, `a`--`z`), digits (`0`--`9`), hyphens (`-`) and underscores (`_`).
The <<.place value>> is specified as follows:
<$railroad text={{$:/editions/tw5.com/railroad/macro-parameter-value}}/>

View File

@ -0,0 +1,52 @@
created: 20150220200255000
modified: 20150221222349000
tags: [[Macro Syntax]]
title: Macro Definition Syntax
type: text/vnd.tiddlywiki
<<.preamble """What follows is a formal presentation of the syntax of the `\define` pragma, using [[railroad diagrams|Railroad Diagrams]]. A [[simpler overview|Macro Definitions in WikiText]] is also available.""">>
<$railroad text="""
"\define" space name params [:space] rest
"""/>
<<.place space>> denotes a sequence of [[whitespace characters|Filter Whitespace]].
The [[macro|Macros]]'s <<.place name>> is a sequence of non-whitespace characters other than `(` or `>`.
The parameter declaration list (<<.place params>>) has the following syntax:
<$railroad text="""
"(" [:sep] [:{ param sep }] ")"
"""/>
The parameter separator (<<.place sep>>) is any sequence of characters that does not match a <<.place param-name>>. Among other things, this includes commas, spaces and linefeeds.
A <<.place param-name>> is a sequence of letters (`A`--`Z`, `a`--`z`), digits (`0`--`9`), hyphens (`-`) and underscores (`_`).
Each individual <<.place param>> has the following syntax:
<$railroad text="""
param-name [: [:space] ":" [:space] default ]
")"
"""/>
The optional <<.place default>> value of a parameter is specified as follows:
<$railroad text={{$:/editions/tw5.com/railroad/macro-parameter-value}}/>
The <<.place rest>> of the definition has the following syntax:
<$railroad text="""
( snippet | lf snippet lf "\end" [:space] ) lf
"""/>
<<.place lf>> denotes a linefeed.
The <<.place snippet>> is any sequence of characters that doesn't terminate the macro definition. That is to say, a single-line snippet cannot contain a linefeed, and a multi-line snippet cannot contain `\end` on a line of its own.
The snippet can contain placeholders with the following syntax:
<$railroad text="""
( "$" name "$" | "$" "(" name ")" "$" )
"""/>

View File

@ -0,0 +1,11 @@
created: 20150220191009000
modified: 20150221111554000
title: $:/editions/tw5.com/railroad/macro-parameter-value
type: text/vnd.tiddlywiki.railroad
( '"""' [:{/'anything but """'/}] '"""'
| '"' [:{/'anything but "'/}] '"'
| "'" [:{/"anything but '"/}] "'"
| "[[" [:{/"anything but ]"/}] "]]"
| {/"""anything but ' " or whitespace"""/}
)

View File

@ -0,0 +1,6 @@
created: 20150221222254000
modified: 20150221222354000
tags: Macros
title: Macro Syntax
<<list-links filter="[tag[Macro Syntax]]">>

View File

@ -1,5 +1,5 @@
created: 20131228164411884
modified: 20131228164955084
modified: 20150221225557000
tags: Mechanisms
title: StateMechanism
type: text/vnd.tiddlywiki
@ -38,6 +38,4 @@ However, we can't track the state in a tiddler called, say, [[$:/InfoPanelState]
The solution is to dynamically generate a unique title for each state tiddler that we need. We need to ensure that the same state tiddler title is generated each time a user interface element is rendered. To do that, we append together tokens representating each of the stack of transclusions that led to the current rendering location. Then that string of symbols is hashed to a simple numeric value.
The process of generating a state tiddler title is encapsulated in the QualifyMacro.
The process of generating a state tiddler title is encapsulated in the <<.mlink qualify>> macro.

View File

@ -1,6 +1,6 @@
caption: 5.1.3
created: 20141020171015200
modified: 20150118182805000
modified: 20150221230151000
tags: ReleaseNotes
title: Release 5.1.3
type: text/vnd.tiddlywiki
@ -27,7 +27,7 @@ released: 20141020171015200
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/0dcf54c3b59ed04645928f0ec4ced647e5a0da7f]] support for ActionWidgets
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/65504d5d41e45326ab1b1b6c0c21eea4c9772797]] new <<.olink addprefix>> and <<.olink addsuffix>> operators
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/0c8e5380778303cdd3308bed4a15290214841f8b]] support for custom password prompts
* [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/c26bd4c5a872f56c47e9f5cfc3fada468c53ddde]] the ListMacro to display ''caption'' field if present
* [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/c26bd4c5a872f56c47e9f5cfc3fada468c53ddde]] the <<.mlink list-links>> macro to display ''caption'' field if present
* [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/12e26009eef5e29140ba1a880ff033428d673630]] ImageWidget to allow percentage width and height to be specified
!! Bug Fixes
@ -38,7 +38,7 @@ released: 20141020171015200
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/3ca8d7b6cca46ffa424bcf9bdc134da464fc84f4]] problem with jumping toolbar icons under Firefox
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/f85b07e70b71d0622a9459e4b04e2027540abda8]] problem with untagged label being incorrectly coloured
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/b3dcd7d625ec83701ef3a77f3fb8101af57c154f]] problem with title background colours with the "Sticky Titles" theme
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/5211f9c40c874a167174e8c0d439db34189d3329]] problem with subfilter parameter of TimelineMacro
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/5211f9c40c874a167174e8c0d439db34189d3329]] problem with subfilter parameter of <<.mlink timeline>> macro
* [[Exclude|https://groups.google.com/d/topic/tiddlywiki/YPACpXhH9PY/discussion]] search string tiddler from search results
!! Node.js Changes
@ -65,4 +65,3 @@ released: 20141020171015200
* [[@simonbaird|https://github.com/simonbaird]]
* [[@TheDiveO|https://github.com/TheDiveO]]
* [[@xcazin|https://github.com/xcazin]]

View File

@ -1,6 +1,6 @@
caption: 5.1.5
created: 20141025120850184
modified: 20150118182717000
modified: 20150221225041000
tags: ReleaseNotes
title: Release 5.1.5
type: text/vnd.tiddlywiki
@ -39,13 +39,13 @@ released: 20141126153016142
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/13726ef73157d9e9d65ae4027d9c32aaa7cdcc90]] new canned filter for recently modified system tiddlers in [[$:/AdvancedSearch]]
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/c20c935faabbb63f679bc4720b52162c56b6af64]] new system image for videos: [[$:/core/images/video]]
* [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/c13cf94413c94ee56bebc60fab2d9231d1824d88]] search results to allow custom visualisations - see [[Customising search results]]
* [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/a3a50dbf6d96e7441e5e8ec183e40134bc4eb618]] TimelineMacro to be able to use different date fields
* [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/a3a50dbf6d96e7441e5e8ec183e40134bc4eb618]] <<.mlink timeline>> macro to be able to use different date fields
* [[Updated|https://github.com/Jermolene/TiddlyWiki5/commit/8260d000be1cf1caf35a557f6cd54a0fb8ccf4f0]] the <<.olink search>> operator to allow a field to be specified
* [[Updated|https://github.com/Jermolene/TiddlyWiki5/commit/73491f14dd63612d527632210d2c3873eb81188f]] the highlight plugin to display tabs as spaces
* [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/91a7c397911726e391ca368f96b50fbe1687d56a]] modal handling to permit variables to be passed to the modal (see [[WidgetMessage: tm-modal]])
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/853f5fd06402b16e271e8f119ef380de485aeff2]] simple logging to help track down drop/paste issues (see http://tiddlywiki.com/dev/#ImportLogging)
* [[Updated|https://github.com/Jermolene/TiddlyWiki5/commit/b520efdeb83f6ac7536a69cf5af2bab3f94cf77f]] [[WidgetMessage: tm-download-file]] and [[WidgetMessage: tm-save-wiki]] to allow variables to be specified for the rendering
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/f5055c0205d24102a36b9cf3a9dd9306e148a1f0]] [[TableOfContentsMacro Tabbed Example]]
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/f5055c0205d24102a36b9cf3a9dd9306e148a1f0]] [[Example Table of Contents: Tabbed Internal]]
* [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/79e428757b5562bd4a925b9b0428ea4ba70ad05a]] RevealWidget so that it can be used without specifying a state tiddler
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/90caf5bf42523cfb6cd603b979aadb719ddcede4]] "hooks" mechanism so that plugins can modify the default tiddler list
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/b882a0dff12dc2660426de53e64d8c018f3a9d84]] support for nested popups
@ -53,7 +53,7 @@ released: 20141126153016142
!! Bug Fixes
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/90096cbd367a7a685fb5dc5b2cbaa69a00d8199f]] problem with CodeMirror editor and missing tiddlers
* [[Exclude|https://github.com/Jermolene/TiddlyWiki5/commit/5093cdc86047209f23b9ead5ee0f216d0414e4f2]] drafts from TableOfContentsMacro
* [[Exclude|https://github.com/Jermolene/TiddlyWiki5/commit/5093cdc86047209f23b9ead5ee0f216d0414e4f2]] drafts from [[Table-of-Contents Macros]]
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/5599f9f9338a5f96080143b2192214a78b961509]] problem with encoding of HTML tiddlers
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/835e3a945244dd8a07f4c7fd570eb890e9fdcc2c]] problem with sticky titles being covered by vertical tabs
* [[Removed|https://github.com/Jermolene/TiddlyWiki5/commit/d1bbe7253c135ceed138fd02c82b0f861d5dda6b]] flicker when automatically resizing textareas

View File

@ -1,6 +1,6 @@
caption: 5.1.6
created: 20141127120850184
modified: 20150118182735000
modified: 20150221194210000
tags: ReleaseNotes
title: Release 5.1.6
type: text/vnd.tiddlywiki
@ -16,9 +16,9 @@ released: 20141219155007260
!! Hackability Improvements
* [[Allow|https://github.com/Jermolene/TiddlyWiki5/commit/b29973312d7c16292cabb493e5914668f7c3f127]] buttons to be styled to look like internal links
* [[Disabled|https://github.com/Jermolene/TiddlyWiki5/commit/5b38c21a417d2e5e2b85aed8010c88af32420e24]] linking when transcluding ''caption'' field in TableOfContentsMacro
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/b220c19fb7b789eb6d00c9d1a71414676d87130e]] support for templates to tabbed TableOfContentsMacro
* [[Allow|https://github.com/Jermolene/TiddlyWiki5/commit/31b5eb1578640fabe8712f0cd4edd49708bc4493]] shadow tiddlers to appear in TableOfContentsMacro
* [[Disabled|https://github.com/Jermolene/TiddlyWiki5/commit/5b38c21a417d2e5e2b85aed8010c88af32420e24]] linking when transcluding ''caption'' field in [[Table-of-Contents Macros]]
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/b220c19fb7b789eb6d00c9d1a71414676d87130e]] support for templates to tabbed [[Table-of-Contents Macros]]
* [[Allow|https://github.com/Jermolene/TiddlyWiki5/commit/31b5eb1578640fabe8712f0cd4edd49708bc4493]] shadow tiddlers to appear in [[Table-of-Contents Macros]]
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/5154a25ab95f0cc08eb079a624be4fd3353e6dbd]] tooltip to BrowseWidget
* [[Improved|https://github.com/Jermolene/TiddlyWiki5/commit/42dba113ccdb18d7e76ac7a773c7dca532207007]] handling of missing tiddlers by the <<.olink has>> and <<.olink field>> operators

View File

@ -1,5 +1,5 @@
created: 20140516150234142
modified: 20150118182530000
modified: 20150221225737000
tags: BetaReleaseNotes
title: Release 5.0.11-beta
type: text/vnd.tiddlywiki
@ -36,7 +36,7 @@ See [[Notes for upgrading to 5.0.11-beta]] for more details of these changes:
!! Hackability Improvements
* Improved vertical layouts of TabsMacro
* Improved vertical layouts of <<.mlink tabs>> macro
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/93566cdc332226b77eaba8a70fa166f3b8fcfe1e]] "standard" tab to [[advanced search|$:/AdvancedSearch]]
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/e83759e86d2a9e05e4b85dae50925fe988f8e239]] new filter operators <<.olink before>> and <<.olink after>>
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/570cad1c7f90e685961130918f09a7f9b2951f8c]] new <<.olink get>> operator

View File

@ -1,6 +1,6 @@
caption: 5.0.14-beta
created: 20140718150234142
modified: 20150124211128000
modified: 20150221225749000
tags: BetaReleaseNotes
title: Release 5.0.14-beta
type: text/vnd.tiddlywiki
@ -64,7 +64,7 @@ For 5.0.14-beta, the setting has been changed. Visit [[control panel|$:/ControlP
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/b4d47858e587c96f3a68cc28cffff181ec45f55f]] support for the InfoMechanism
* [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/f08f57c5d24eb0146ac2cb77472a5fc5f135f1e9]] CheckboxWidget to allow it to toggle fields as well as tags
* [[Refactored|https://github.com/Jermolene/TiddlyWiki5/commit/21c137a66c37f010b36697bb6bed5321138fbb9f]] [[control panel|$:/ControlPanel]] theme tweaks to be stored in individual tiddlers
* [[Extend|https://github.com/Jermolene/TiddlyWiki5/commit/e18d8a88661a1c2caa1b722841747c75ca6af437]] the TabsMacro to allow tabs to be templated
* [[Extend|https://github.com/Jermolene/TiddlyWiki5/commit/e18d8a88661a1c2caa1b722841747c75ca6af437]] the <<.mlink tabs>> macro to allow tabs to be templated
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/91acad0f7ce8637945a953dfcb122cd31292626d]] (and [[here|https://github.com/Jermolene/TiddlyWiki5/commit/8612bc4006e717e4fa3c562fa72a85650206b66f]]) SystemTags support for inserting content above and below the story river
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/f793816dfa687ae7791143b33487fd5f95f3265c]] support for transcluding plugin subtiddlers with the TranscludeWidget
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/c73853288c5b4b0716da94fea2f2edec09345643]] (and [[here|https://github.com/Jermolene/TiddlyWiki5/commit/08f775eac8cb053d08c1c561e65a5eeb87c4c6b6]]) support for importing from `*.htm` and `*.hta` files as well as the existing support for `*.html` files

Some files were not shown because too many files have changed in this diff Show More