From 9641345b92ad42cb35203e9289b5799a6079727a Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Mon, 3 Oct 2022 14:40:27 +0100 Subject: [PATCH] Docs updates --- .../macros/import/say-hi-using-variables.tid | 3 ++- .../tw5.com/tiddlers/macros/import/say-hi.tid | 5 +++-- .../macros/import/tags-of-current-tiddler.tid | 2 ++ .../macros/import/tv-wikilink-tooltip.tid | 3 ++- .../tiddlers/pragmas/Pragma_ _define.tid | 20 +++++++++++++++-- .../tiddlers/pragmas/Pragma_ _import.tid | 13 +++++++++-- .../tiddlers/pragmas/Pragma_ _parameters.tid | 15 +++++++++++-- .../tiddlers/pragmas/Pragma_ _rules.tid | 22 +++++++++++++++++-- .../tiddlers/pragmas/Pragma_ _whitespace.tid | 18 +++++++++++---- .../tw5.com/tiddlers/variables/Variables.tid | 3 ++- .../wikitext/Variables in WikiText.tid | 3 ++- 11 files changed, 89 insertions(+), 18 deletions(-) diff --git a/editions/tw5.com/tiddlers/macros/import/say-hi-using-variables.tid b/editions/tw5.com/tiddlers/macros/import/say-hi-using-variables.tid index 4aa265fa3..3a100c68f 100644 --- a/editions/tw5.com/tiddlers/macros/import/say-hi-using-variables.tid +++ b/editions/tw5.com/tiddlers/macros/import/say-hi-using-variables.tid @@ -1,5 +1,6 @@ +code-body: yes created: 20150221145447000 -modified: 20150221145626000 +modified: 20221003132544224 title: $:/editions/tw5.com/macro-examples/say-hi-using-variables type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/macros/import/say-hi.tid b/editions/tw5.com/tiddlers/macros/import/say-hi.tid index 2d2d31afc..dfd0684f6 100644 --- a/editions/tw5.com/tiddlers/macros/import/say-hi.tid +++ b/editions/tw5.com/tiddlers/macros/import/say-hi.tid @@ -1,8 +1,9 @@ +code-body: yes created: 20150221145803000 -modified: 20150221221536000 +modified: 20221003132533754 title: $:/editions/tw5.com/macro-examples/say-hi type: text/vnd.tiddlywiki -\define sayhi(name:"Bugs Bunny" address:"Rabbit Hole Hill") +\define sayhi(name:"Bugs Bunny",address:"Rabbit Hole Hill") Hi, I'm $name$ and I live in $address$. \end diff --git a/editions/tw5.com/tiddlers/macros/import/tags-of-current-tiddler.tid b/editions/tw5.com/tiddlers/macros/import/tags-of-current-tiddler.tid index b1bfc753c..5a41b3f64 100644 --- a/editions/tw5.com/tiddlers/macros/import/tags-of-current-tiddler.tid +++ b/editions/tw5.com/tiddlers/macros/import/tags-of-current-tiddler.tid @@ -1,4 +1,6 @@ +code-body: yes created: 20150221145803000 +modified: 20221003132607664 title: $:/editions/tw5.com/macro-examples/tags-of-current-tiddler type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/macros/import/tv-wikilink-tooltip.tid b/editions/tw5.com/tiddlers/macros/import/tv-wikilink-tooltip.tid index 11b442b8c..ddb734393 100644 --- a/editions/tw5.com/tiddlers/macros/import/tv-wikilink-tooltip.tid +++ b/editions/tw5.com/tiddlers/macros/import/tv-wikilink-tooltip.tid @@ -1,5 +1,6 @@ +code-body: yes created: 20150228120252000 -modified: 20150228120554000 +modified: 20221003132558078 title: $:/editions/tw5.com/macro-examples/tv-wikilink-tooltip type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/pragmas/Pragma_ _define.tid b/editions/tw5.com/tiddlers/pragmas/Pragma_ _define.tid index 4f8208720..7a68f8412 100644 --- a/editions/tw5.com/tiddlers/pragmas/Pragma_ _define.tid +++ b/editions/tw5.com/tiddlers/pragmas/Pragma_ _define.tid @@ -1,13 +1,29 @@ created: 20220917112233317 -modified: 20220917155832411 +modified: 20221003133242496 tags: Pragmas title: Pragma: \define type: text/vnd.tiddlywiki -The ''\define'' [[pragma|Pragmas]] +The ''\define'' [[pragma|Pragmas]] is used to [[define macros|Macro Definitions]]. It is a shortcut syntax for the SetVariableWidget. + +The usual form allows macros to span multiple lines: + +``` +\define ([:],[:]...) + +\end +``` + +There is also a single line form for shorter macros: + +``` +\define ([:],[:]...) +``` The first line of the definition specifies the macro name and any parameters. Each parameter has a name and, optionally, a default value that is used if no value is supplied on a particular call to the macro. The lines that follow contain the text of the macro text (i.e. the snippet represented by the macro name), until `\end` appears on a line by itself: +For example: + <$codeblock code={{$:/editions/tw5.com/macro-examples/say-hi}}/> Alternatively, the entire definition can be presented on a single line without an `\end` marker: diff --git a/editions/tw5.com/tiddlers/pragmas/Pragma_ _import.tid b/editions/tw5.com/tiddlers/pragmas/Pragma_ _import.tid index e82b769b0..a0b336840 100644 --- a/editions/tw5.com/tiddlers/pragmas/Pragma_ _import.tid +++ b/editions/tw5.com/tiddlers/pragmas/Pragma_ _import.tid @@ -1,8 +1,17 @@ created: 20220917113054582 -modified: 20220917113329624 +modified: 20221003120802195 tags: Pragmas title: Pragma: \import type: text/vnd.tiddlywiki -The ''\import'' [[pragma|Pragmas]] +The ''\import'' [[pragma|Pragmas]] is used to import definitions from other tiddlers that are identified with a filter. It is a shortcut syntax for the ImportVariablesWidget. +``` +\import +``` + +For example: + +``` +\import [all[shadows+tiddlers]tag[$:/tags/Macro]] +``` diff --git a/editions/tw5.com/tiddlers/pragmas/Pragma_ _parameters.tid b/editions/tw5.com/tiddlers/pragmas/Pragma_ _parameters.tid index 8a1ed5f12..43f3bee7c 100644 --- a/editions/tw5.com/tiddlers/pragmas/Pragma_ _parameters.tid +++ b/editions/tw5.com/tiddlers/pragmas/Pragma_ _parameters.tid @@ -1,7 +1,18 @@ created: 20220917113154900 -modified: 20220917113205051 +modified: 20221003121441054 tags: Pragmas title: Pragma: \parameters type: text/vnd.tiddlywiki -The ''\parameters'' [[pragma|Pragmas]] \ No newline at end of file +The ''\parameters'' [[pragma|Pragmas]] is used within [[procedure|Procedure Definitions]] and [[widget|Widget Definitions]] definitions to declare the parameters that are expected, and their default values. It is a shortcut syntax for the ParametersWidget. + +``` +\parameters ([:],[:]...) +``` + +For example: + +``` +\parameters (firstname:"Joe",lastname:"Blogs") +``` + diff --git a/editions/tw5.com/tiddlers/pragmas/Pragma_ _rules.tid b/editions/tw5.com/tiddlers/pragmas/Pragma_ _rules.tid index b6c8f0671..5831e9db7 100644 --- a/editions/tw5.com/tiddlers/pragmas/Pragma_ _rules.tid +++ b/editions/tw5.com/tiddlers/pragmas/Pragma_ _rules.tid @@ -1,7 +1,25 @@ created: 20220917112931273 -modified: 20220917113254747 +modified: 20221003121749187 tags: Pragmas title: Pragma: \rules type: text/vnd.tiddlywiki -The ''\rules'' [[pragma|Pragmas]] adjusts the set of rules used to parse the remaining text. \ No newline at end of file +The ''\rules'' [[pragma|Pragmas]] adjusts the set of parser rules used to parse the remaining text. + +``` +\rules only|expect +``` + +The list of available parser rules can be consulted in $:/ControlPanel -> Info -> Advanced -> Parsing. + +For example, in stylesheets it is typical to only use the rules associated with macros and transclusions: + +``` +\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline +``` + +Some users prefer not to use CamelCase links: + +``` +\rules except prettylink +``` \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/pragmas/Pragma_ _whitespace.tid b/editions/tw5.com/tiddlers/pragmas/Pragma_ _whitespace.tid index 7c5d4d471..2191f3d28 100644 --- a/editions/tw5.com/tiddlers/pragmas/Pragma_ _whitespace.tid +++ b/editions/tw5.com/tiddlers/pragmas/Pragma_ _whitespace.tid @@ -1,10 +1,20 @@ created: 20220917113002350 -modified: 20220917113304284 +modified: 20221003121147795 tags: Pragmas title: Pragma: \whitespace type: text/vnd.tiddlywiki -The ''\whitespace'' [[pragma|Pragmas]] +<<.from-version "5.1.15">> The ''\whitespace'' [[pragma|Pragmas]] determines how spaces and newlines are treated within wikitext. Note that this only applies to the printable text, and not to other text, such as the values of attributes. -;`\whitespace trim` or `\whitespace notrim` -: <<.from-version "5.1.15">> Control whether whitespace is trimmed from the start and end of text runs (the default is ''notrim''). This setting can be useful when the whitespace generated by linebreaks disturbs formatting +* ''notrim'' -- whitespace text is not subject to special processing (the default) +* ''trim'' -- whitespace text is removed + +``` +\whitespace trim|notrim +``` + +For example: + +``` +\whitespace trim +``` diff --git a/editions/tw5.com/tiddlers/variables/Variables.tid b/editions/tw5.com/tiddlers/variables/Variables.tid index 06fd78a80..1df1cb677 100644 --- a/editions/tw5.com/tiddlers/variables/Variables.tid +++ b/editions/tw5.com/tiddlers/variables/Variables.tid @@ -1,5 +1,5 @@ created: 20141002133113496 -modified: 20220909111836951 +modified: 20220930195819232 tags: Concepts Reference title: Variables type: text/vnd.tiddlywiki @@ -21,3 +21,4 @@ By themselves, the snippets are <<.em not>> parsed as WikiText. However, a varia The <<.mlink dumpvariables>> macro lists all variables (including macros) that are available at that position in the widget tree. ~TiddlyWiki's core has [[several variables|Core Variables]] built in. + diff --git a/editions/tw5.com/tiddlers/wikitext/Variables in WikiText.tid b/editions/tw5.com/tiddlers/wikitext/Variables in WikiText.tid index 4c465528b..9fda21f04 100644 --- a/editions/tw5.com/tiddlers/wikitext/Variables in WikiText.tid +++ b/editions/tw5.com/tiddlers/wikitext/Variables in WikiText.tid @@ -1,6 +1,6 @@ caption: Variables created: 20141002141231992 -modified: 20220917075007507 +modified: 20220930195709700 tags: WikiText title: Variables in WikiText type: text/vnd.tiddlywiki @@ -34,3 +34,4 @@ The `\define` pragma below [[defines a macro|Macro Definitions]] called <<.var t This example uses the <<.olink backlinks>> [[operator|Filter Operators]] to list all tiddlers that link to this one. <$macrocall $name=".example" n="3" eg="""<backlinks[]]">>"""/> +